Skip to content

test(web): exercise chat citations and audio through real browser owners - #46115

Merged
hyoban merged 1 commit into
mainfrom
test/cleanup-20261112-1100-burn1
Nov 12, 2026
Merged

hyoban merged 1 commit into
mainfrom
test/cleanup-20261112-1100-burn1

Conversation

@hyoban

@hyoban hyoban commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Behavior protected

Rewrites 10 existing rendered Web specs into 8 focused Chromium Browser Mode files. The old fake player callbacks, geometry/observer doubles, repeated disclosure rows, private closest/measurement assertions, and thin tooltip suites now exercise the real owners. No product code, new feature scenarios, guard allowances, or large assets are added.

Existing spec (under web/app/components/base/) Concrete quality improvement and browser evidence
audio-btn/__tests__/index.spec.tsx Real AudioPlayerManager/AudioPlayer replace captured callbacks. Pin actual HTTP routes/body, decoded blob source, advancing native time, pause/end, and synchronous cached-play takeover; remove fake timer/event-echo matrices.
new-audio-button/__tests__/index.spec.tsx Real provider translations and media engine replace manager spies. Native pause/resume/end and operable error recovery prove the displayed action, while HTTP assertions protect public/app/installed routing.
chat/chat/citation/__tests__/index.spec.tsx Real font measurements and ResizeObserver replace clientWidth/observer doubles. A boundary width catches missing overflow reservation; native Tab/Enter/Space, retained focus, resize, grouped popup dismissal/reopen and public receipt targets replace cleanup spies/test IDs.
chat/chat/citation/__tests__/tooltip.spec.tsx Removed the isolated leaf suite; its metric explanation is proved by hovering the real citation diagnostic control and reading actual production copy.
chat/chat/citation/__tests__/progress-tooltip.spec.tsx Folded into the real citation diagnostic owner. A live score update must update both the visible control and its hovered explanation; Escape dismisses the actual portal.
chat/chat/thought/__tests__/index.spec.tsx Merge duplicate parsing/render/toggle rows into tool journeys. Real locale labels, native focus and keyboard disclosure prove request/result pairing, pending results, completion and legacy fallback text.
chat/chat/answer/__tests__/tool-detail.spec.tsx Removed the redundant child suite after proving its knowledge label, pending/finished status and request/response disclosure through Thought; the real click handler is mutation checked.
chat/chat/answer/__tests__/reasoning-panel.spec.tsx Controlled time remains at the clock boundary. Native details visibility and keyboard focus prove completion collapse/reopen and the completion latch; live node deltas must occupy separate readable paragraphs instead of inspecting summary ancestry.
chat/chat/answer/__tests__/workflow-process.spec.tsx Replace programmatic focus/empty-container checks with native Tab/Enter/Space, retained header focus and a public readonly transition. Real English resources and real tracing retain status, external expansion and localized permission-error contracts.
chat/chat/answer/__tests__/agent-content.spec.tsx Merge duplicate final/annotation render rows; retain streaming results and native focus across completion. Real hover reveals download actions, and activated native anchors independently pin each normalized/historical attachment filename and transport URL.

Shared side-effect-free chat, audio and citation presets consolidate the render/query/locale setup, native audio fixtures and route rows. Every retained mock is an immediately documented Next-router or HTTP boundary. Participating owned-module mocks: 2 → 0. All 8 Browser files remain below 500 lines.

Scenario audit and queue

  • Browser migrations/merges: 10 source specs → 8 Browser files; 0 unit files retained. Existing cases are merged or strengthened, without backfilling unrelated gaps.
  • The cached synchronous play regression is preserved through two real controls sharing a playing message. The old synchronous error factory case is unreachable through the supported real AudioPlayer: load failures follow an awaited HTTP response, playback failures follow an awaited promise, and native media errors arrive as browser events. HTTP failure/recovery remains covered. This is the only removed artificial synchronous race row.
  • The old manually injected loaded/per-event rows and persistent Loading expectation were fake-engine artifacts: Chromium can emit play for the real MediaSource while HTTP bytes are pending. Real decoded playback, native pause/end and error recovery replace those event echoes. No rollback, queued-save, remote-sync or remote-response case was removed.
  • Rechecked all 672 open PRs / 13,334 expanded paths before selection. The original eight remediation entries remain occupied. Open feat(web): move Contact support to paid sidebar #46058 still owns the policy script, so all remediation requiring allowance deletion—including the previous batch's deferred PAT patch—remains deferred. This PR removes/adds 0/0 allowlist entries and does not edit that shared script. Final refresh: 672 PRs / 13,337 paths, zero runner-equivalent path conflicts across all 21 changed paths. Citation popup.spec.tsx/popup.tsx remain untouched for fix(web): move API error feedback to business flows #45199.
  • Attachment uploader session cleanup is deferred for a dedicated faithful conversation-owner rewrite; its existing async cases are left intact.
  • No production bug established; no issue or guide PR needed. The current web/docs/test.md already covers the principles applied here.

Validation

  • Focused Browser Mode: 8 files / 37 passing tests, --maxWorkers=2; no full local unit/browser suite or concurrent test commands.
  • Browser-spec policy, complete required root static check, Web type-check and diff check: pass. Normal commit hooks: pass.
  • Sequential targeted production mutations: 17/17 caught, including both cached-play ordering regressions, native pause, route payloads, reasoning latch/paragraphs, tool pairing/disclosure, citation overflow/resize/grouping/metrics, activated download URL, completed tool status and tracing toggle. Every temporary production edit is restored byte-for-byte.
  • Main CI: success on aecdbfd348; all checks 48 success / 11 configured skips, required 9 success / 2 configured skips. No CI rerun or source-fix round.
  • Codecov project/web: green, 90.13% (+0.00 percentage points displayed); patch and every other project context are green. Final API reports are complete with 12/12 sessions. A temporary red status was published with incomplete uploads and resolved after the final session arrived; no empty commit, padding or rerun was used.

@hyoban hyoban added the test-cleanup Web test cleanup / Browser Mode migration label Nov 12, 2026
@github-actions github-actions Bot added web This relates to changes on the web. size:XXL This PR changes 1000+ lines, ignoring generated files. labels Nov 12, 2026
@codecov

codecov Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.14%. Comparing base (2dd7506) to head (aecdbfd).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #46115   +/-   ##
=======================================
  Coverage   90.14%   90.14%           
=======================================
  Files        6307     6307           
  Lines      394780   394780           
  Branches    79187    79187           
=======================================
+ Hits       355888   355893    +5     
+ Misses      32777    32772    -5     
  Partials     6115     6115           
Flag Coverage Δ
dify-ui 92.65% <ø> (ø)
web 90.13% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hyoban
hyoban marked this pull request as ready for review November 12, 2026 05:09
@hyoban
hyoban added this pull request to the merge queue Nov 12, 2026
Merged via the queue into main with commit e2e4b82 Nov 12, 2026
62 checks passed
@hyoban
hyoban deleted the test/cleanup-20261112-1100-burn1 branch November 12, 2026 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL This PR changes 1000+ lines, ignoring generated files. test-cleanup Web test cleanup / Browser Mode migration web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants