Repository navigation
feat(ui): add file reader controls and preserve preview lifecycle - #176339
vyctorbrzezowski merged 20 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: stale review; fresh review needed. Summary Next step Review history (1 earlier review cycle)
|
3af1924 to
5768852
Compare
5768852 to
92c0264
Compare
|
The file menu shows path-copy success feedback. Mobile plain-text and Markdown attachments expose one Download action while retaining their reader controls. Native Control UI captures using synthetic mocked-Gateway data. These compare the captured repair variants; they do not certify the final combined revision. Full-context before/after images come first, followed by the corresponding detail crops. |
92c0264 to
73ec204
Compare
ebd33fc to
7c30f2f
Compare
7c30f2f to
77db630
Compare
77db630 to
002fa52
Compare










What Problem This Solves
File previews need usable reading controls without losing edits, selection, or file identity when users switch views.
User Impact
Adds desktop and mobile file controls for search, wrapping, source/preview mode, copying, and downloads. HTML and SVG render as previews, while temporary and pinned files retain the correct draft and save lifecycle. Toggling syntax highlighting preserves the selected text and toolbar focus.
Why This Change Was Made
Keeps presentation controls separate from the existing draft, save, and file-identity owners. SVG rendering no longer depends on an optional lightbox action. UI element declarations stay with their owning types so core test checks do not load the renderer dependency graph.
Risk and coverage
File previews share draft, save, and file-identity state. Reader transitions must preserve unsaved input and text selection.
The quota-recovery saved-clear status failure was reproduced on pinned main
e75403fwith identical relevant sources. Authentication recovery succeeds while the UI status remains stale; no quota fix is included in this change.Evidence
The source-aware save regression opens Edit file through the current menu and reopens after the real project-change event. It verifies that the stale workspace draft stays separate and that the new workspace saves its own content. The focused case passed (10.11 s command wall). Its Linux replay also passed.
The copy-retirement fixture opens its menu before freezing feedback time, preserving native opening behavior and the existing fallback, retirement, and success assertions. All six focused cases passed (18.003 s); eight integrated copy/native-link cases also passed (18.78 s). The direct MCP component import is reconciled with the current upstream owner. Scoped checks and independent review passed.
File-action tests now wait for the native menu to finish opening before selecting an action. The one-line helper change preserves production interaction during opening, all file/HTML/sandbox assertions, and existing timeouts. All three HTML sandbox cases passed on the integrated source (40.13 s command wall); a focused file reveal/save case also passed, retaining Files search and focus. Types, scoped lint, formatting, and independent review passed. The review confirmed that this readiness wait does not mask behavior covered by these tests; the underlying lost-click mechanism remains unproved.
File-preview, sidebar, and new-session checks passed: 12 unit and 13 Chromium cases (6.66 s command wall).
Core agents/sessions test types passed without incremental caching (1.65 s); UI types passed (5.00 s), and UI test types passed (25.76 s).
Scoped lint passed (8.91 s). Independent review found no actionable findings.
Earlier scoped runs passed all 12 selected file-link, HTML preview, and download scenarios. The two repaired reveal/download cases passed in 22.03 s wall; exact paths, selected roots, focus, search, and browser download behavior remain asserted.
File-search coverage now explicitly opens and dismisses the tooltip that can appear over Close while the Search input retains focus, before checking that the next Escape closes search and restores focus. All 18 cases passed (
--maxWorkers=1; 7.60 s wall); match navigation, query reset, and Close-button assertions remain. The original failure was reproduced by waiting for that tooltip to open.The earlier image-lightbox run passed four native cases (
--maxWorkers=1; 20.33 s wall), preserving image identity and modal behavior.CI timing for the updated tests is pending; the measured local costs above are scoped runs.
Visual evidence
Captured before:
dccff201b07e. Captured after:5856f7237579.Synthetic fixtures and a mock Gateway show the integrated session UI at these revisions. These images are not isolated proof of this PR; stills do not establish interaction or live-service results.
Published comparisons: Files and mobile conversation.
Files on desktop — dark
The baseline reader replaces the catalog; the updated view keeps the populated catalog beside the reader. Full views include both file tabs; crops focus on the catalog and reader.
Full view
Detail 1
Additional views and states
Files on desktop — light
The same file and tabs in light mode. The baseline long line clips horizontally; the updated reader wraps it. This does not claim identical wrapping.
Full view
Detail 1
HTML preview on mobile
Both versions render the same local HTML preview. The updated view has one file rail with source, edit, and search controls.
Full view
Detail 1
Validation after base reconciliation
Preview lifecycle coverage still awaits file opening through the existing helper. The reconciled sidebar scroll test uses the current scoped element types without an unused import. No assertions or production behavior changed in the reconciliation.
On the combined candidate,
node scripts/run-vitest.mjs ui/src/pages/chat/components/chat-session-workspace-loading.test.ts --maxWorkers=1passes all 22 cases (2.50 s command wall; 1.83 s Vitest duration). Focused lint reports zero warnings/errors and formatting passes. New CI is pending.