Skip to content

test(web): exercise chat navigation and layout in Browser Mode - #46118

Merged
hyoban merged 5 commits into
mainfrom
test/cleanup-20261112-1140-burn2
Nov 12, 2026
Merged

hyoban merged 5 commits into
mainfrom
test/cleanup-20261112-1140-burn2

Conversation

@hyoban

@hyoban hyoban commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Replace ten old chat suites with real owner journeys in Chromium. This removes seven participating child/module doubles and replaces callback/prop echoes and fabricated layout with accepted conversation content, native navigation, focus, scrolling, disclosure, media UI and activated downloads. The change is test-only.

All paths below are relative to web/app/components/base/chat/chat/. The ten source specs are consolidated into ten Browser behavior domains; no scenario remains duplicated in unit.

Existing spec Concrete quality improvement
__tests__/index.spec.tsx Real caller applies sends, edits and stop transitions. Real message geometry proves order and streaming action availability. The real agent renderer replaces the null live-region fixture; tokens never enter lifecycle announcements.
__tests__/use-chat-layout.spec.tsx Removes fake ResizeObserver, RAF queues, body/scroll metrics and disconnect spies. Native wheel input proves manual-scroll preservation and a new conversation reset; real growing textarea, footer clearance and responsive composer width prove layout. Preserves the initial-history scroll regression as an expected failure (#46120).
__tests__/log-actions.spec.tsx Removes six Answer/Question/composer/audio/annotation doubles. Real Chat → Answer → Operation → Log opens the selected item in its own caller, with pointer hover, capability withdrawal and owner filtering.
log/__tests__/index.spec.tsx Merges the redundant leaf into that real owner journey; selected item and stopped surface propagation are both independently mutation-sensitive.
__tests__/try-to-ask.spec.tsx Merges the leaf into real Chat. Native Tab/Enter selects the second suggestion and displays the accepted question, instead of counting calls.
__tests__/content-switch.spec.tsx Merges callback matrices into real question, answer and form-only Chat navigation. Actual sibling content/identity, displayed index and disabled endpoints replace frozen props; both directions remain covered.
chat-input-area/__tests__/operation.spec.tsx Removes the uploader prop-recorder. Real upload popover methods, Escape removal/focus, readonly controls, accepted draft and microphone/canvas UI replace forwarding/callback assertions. Only device capture remains mocked; unavailable target/config guards remain.
answer/__tests__/suggested-questions.spec.tsx Merges the leaf into real opening-statement Chat. Blank filtering, accepted selected content, native disabled/Tab behavior and public item replacement replace send spies and assigned focus.
answer/__tests__/index.spec.tsx Real custom agent renderer replaces showThoughts prop echo. Real form submission and completed review, native reasoning/details and process keyboard disclosure, form-only siblings and citation popup removal/focus replace isolated branch/slot assertions. Generated/message files activate real download anchors with independently pinned names/URLs.
answer/__tests__/basic-content.spec.tsx Exercises the actual Answer owner. Saved/empty annotation transitions and readable UNC/backslash text remain; verified receipts now scroll to their real rendered source, and removing verification removes the link.

Shared colocated presets compose real per-test locale/query providers and typed form fixtures without registering hooks or stubbing globals on import. Every retained literal mock has an immediate boundary comment. The largest Browser file is 224 lines.

Validation:

  • Focused Chromium: 10 files, 46 pass + 1 expected failure, --maxWorkers=2.
  • Browser policy guard passes; allowlist 0 removed / 0 added. The eight original remediation files remain directly blocked, and the other nine allowance files require editing the shared policy file occupied by open feat(web): move Contact support to paid sidebar #46058.
  • Full root check, final fixture check, Web type-check and normal commit hooks pass (0 errors; existing root warnings unchanged).
  • Sequential targeted production mutations: 20/20 caught, all production SHA-256 values restored exactly. The two layout mutations were rerun from an independently passing native-wheel baseline; actual failures are footer obstruction, narrowed input and the interrupted manual scroll. A temporary content-size observer makes the initial-history expected failure unexpectedly pass, confirming that the retained assertion detects the product defect; that probe is also restored.

Scenario audit: redundant render/forwarding rows were merged; pure avatar/custom-node slot echoes and private disconnect/missing-ref stability proofs were dropped. The archived-conversation case now renders real answer content. The real Chat owner always attaches these refs. No race, rollback, queued-save, remote-sync or remote-response scenario was removed. No new feature-gap coverage or production change is included.

Production issue: #46120. The expected-failure comment links the issue, and the issue links this cleanup PR. The same content-size omission was also observed during narrower viewport reflow; this PR does not fix production. Existing web/docs/test.md covers the applicable principles, so no guide PR is needed.

Final CI on 768e633d48: Main CI Pipeline succeeds; required checks 9 success / 2 configured skips. Codecov project/web passes at 90.13% (+0.00 percentage points displayed). The optional project/api check is still pending publication despite complete head/base reports with 12 sessions each; no rerun, padding or empty-commit workaround.

@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.15%. Comparing base (8d37aea) to head (768e633).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #46118   +/-   ##
=======================================
  Coverage   90.15%   90.15%           
=======================================
  Files        6307     6307           
  Lines      394792   394792           
  Branches    79187    79187           
=======================================
+ Hits       355935   355944    +9     
+ Misses      32749    32739   -10     
- Partials     6108     6109    +1     
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 2de7390 Nov 12, 2026
62 checks passed
@hyoban
hyoban deleted the test/cleanup-20261112-1140-burn2 branch November 12, 2026 05:18
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