Skip to content

feat(ui): add file reader controls and preserve preview lifecycle - #176339

Merged
vyctorbrzezowski merged 20 commits into
mainfrom
brzezowski/session-ui-v3/file-readers-and-preview-lifecycle
Oct 21, 2026
Merged

vyctorbrzezowski merged 20 commits into
mainfrom
brzezowski/session-ui-v3/file-readers-and-preview-lifecycle

Conversation

@vyctorbrzezowski

@vyctorbrzezowski vyctorbrzezowski commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

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 e75403f with 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

Before After
Files on desktop — dark: Before — full view Files on desktop — dark: After — full view

Detail 1

Before After
Files on desktop — dark: Before — detail 1 Files on desktop — dark: After — 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

Before After
Files on desktop — light: Before — full view Files on desktop — light: After — full view

Detail 1

Before After
Files on desktop — light: Before — detail 1 Files on desktop — light: After — 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

Before After
HTML preview on mobile: Before — full view HTML preview on mobile: After — full view

Detail 1

Before After
HTML preview on mobile: Before — detail 1 HTML preview on mobile: After — 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=1 passes 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.

@clawsweeper

clawsweeper Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 18, 2026
@clawsweeper

clawsweeper Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: stale review; fresh review needed.

Summary
The latest durable ClawSweeper review was for head 3af19242bed158c2dda42c92a05518cc0671219e, but the PR head is now 002fa52da82b62b6d672378968e45a2990831fc1. Its old verdict and PR readiness labels are no longer current.

Next step
Run or wait for a fresh ClawSweeper review on the current PR head.

Review history (1 earlier review cycle)
  • reviewed 2026-10-18T19:15:07.452Z sha 3af1924 :: blocked before merge. :: [P1] [P1] Preserve the saved wrapping choice in desktop readers | [P2] [P2] Connect mobile reader presentation to the chat shell | [P2] [P2] Route Files tab closing through the new draft-aware operation

@vyctorbrzezowski
vyctorbrzezowski force-pushed the brzezowski/session-ui-v3/file-readers-and-preview-lifecycle branch from 3af1924 to 5768852 Compare October 19, 2026 11:37
@vyctorbrzezowski
vyctorbrzezowski force-pushed the brzezowski/session-ui-v3/file-readers-and-preview-lifecycle branch from 5768852 to 92c0264 Compare October 19, 2026 11:44
@vyctorbrzezowski
vyctorbrzezowski marked this pull request as ready for review October 19, 2026 11:46
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

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.

Before: Copy path menu without success feedback — full context

After: Copy path menu showing Copied! — full context

Before: plain-text attachment with duplicate Download actions — full context

After: plain-text attachment with one Download action — full context

Before: Markdown attachment with duplicate Download actions — full context

After: Markdown attachment with one Download action — full context

Before: plain-text attachment with duplicate Download actions — detail crop

After: plain-text attachment with one Download action — detail crop

Before: Markdown attachment with duplicate Download actions — detail crop

After: Markdown attachment with one Download action — detail crop

@vyctorbrzezowski
vyctorbrzezowski force-pushed the brzezowski/session-ui-v3/file-readers-and-preview-lifecycle branch from 92c0264 to 73ec204 Compare October 19, 2026 14:53
@vyctorbrzezowski vyctorbrzezowski added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 19, 2026
@vyctorbrzezowski
vyctorbrzezowski force-pushed the brzezowski/session-ui-v3/file-readers-and-preview-lifecycle branch 2 times, most recently from ebd33fc to 7c30f2f Compare October 19, 2026 20:08
@vyctorbrzezowski
vyctorbrzezowski force-pushed the brzezowski/session-ui-v3/file-readers-and-preview-lifecycle branch from 7c30f2f to 77db630 Compare October 19, 2026 21:11
@vyctorbrzezowski
vyctorbrzezowski force-pushed the brzezowski/session-ui-v3/file-readers-and-preview-lifecycle branch from 77db630 to 002fa52 Compare October 19, 2026 23:01
@clawsweeper clawsweeper Bot removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Oct 19, 2026
@vyctorbrzezowski vyctorbrzezowski self-assigned this Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui ci:full Keep ordinary native-locale CI selection on the next PR run. P2 Normal backlog priority with limited blast radius. size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant