Skip to content

feat(web): inline workspace Files with editing and rich previews - #2

Merged
testikun merged 2 commits into
codex/web-ux-597from
codex/workspace-files
Sep 28, 2026
Merged

testikun merged 2 commits into
codex/web-ux-597from
codex/workspace-files

Conversation

@testikun

@testikun testikun commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

Problem

The workbar's Generated files view only exposed successful write/edit outputs. Files need a workspace explorer and inline previews, with explicit continuation for long lists/text. The initial narrow layout covered the document with the tree and lacked editable text and a Markdown outline. Related: openpi-dev#597 and openpi-dev#598.

This PR is stacked on codex/web-ux-597 at 79a4f63, preserving the concurrent native iframe browser implementation.

Value

Users browse existing workspace files beside their previews, edit text without opening another window, save explicitly, and navigate document sections. Drafts survive switching files or Sessions in the same browser page, and version conflicts preserve local edits for reconciliation.

Approach

  • Replace the generated-file list/routing with a Session-scoped workspace tree, filename search, single-use continuation cursors and revision-bound text pages. Keep tree state and stop hidden reads.
  • Use a shared breadcrumb/action header above independent preview/tree columns. Remove narrow-screen overlays, automatic tree collapse and absolutely positioned actions. A folder icon explicitly toggles the tree.
  • Add Preview/Edit controls with selection/hover/focus feedback, retained editor selection, Save and Cmd/Ctrl+S, draft preview and explicit conflict reconciliation. Reuse authenticated WebHost/ArtifactReader boundaries for workspace-only UTF-8 saves, revision checks and atomic replacement; external read grants remain read-only.
  • Add a Markdown outline with section navigation, current-section indication, keyboard focus, Escape and outside-click dismissal. Support Markdown/Mermaid, code, CSV/TSV, static sandbox HTML/SVG, images, PDF paging/zoom and bounded Office content previews. Heavy parsers load on demand; Office processing uses a disposable worker.
  • Record the frozen DSH reference, implementation boundaries, ablation and evidence in docs/research/WEB_WORKSPACE_FILES_2026-09-28.md. No DSH source was copied.

Validation

  • bun run check: passed.
  • bun run test: Node 1959 passed, 5 conditional/platform skips; Vitest 823 passed. One existing terminal-focus timing failure in the first iteration run passed on a complete rerun without changing that test.
  • Real-host Chromium file suite: 3/3 passed. Covers document formats, authenticated downloads, actual saves, save shortcut, draft restoration, external-edit conflicts/reconciliation, HTML draft Preview/Edit round trips and caret retention, outline navigation/Escape, light/dark themes, 320/390/456/560/720px geometry and axe with the outline open.
  • Host/HTTP checks cover UTF-8/permissions, revision conflicts, overlapping saves, binary/size restrictions, external grants, symlinks, revocation during save, authentication and Origin validation.
  • Earlier full Chromium run: 57/68 passed; all 11 failures reproduced at the same assertions on untouched base e526d11 (legacy workspace labels, archive fixtures, settings heading, prompt recovery and model focus). After integrating 79a4f63, the other 56/56 passed. This iteration reran the three directly affected browser tests; it does not claim the full E2E suite is green or disable those baseline tests.
  • Native isolated Pi runtime provenance was checked. Actual AGENTS.md browsing and outline display were inspected. The user's currently unsaved local editor was left intact; the final interaction suite uses a separate real-host fixture.
  • Ablation removed redundant preview lazy/Suspense wrapping, narrow overlay/auto-collapse rules and duplicate directory chrome. Two real columns and React-driven heading scans pass without an added layout controller or DOM observer service.

Impact

  • User-visible: Generated files becomes Files; inline rich preview, text editing and outline navigation. Transcript tool-edit evidence remains available; manual saves do not impersonate Pi write/edit tool results.
  • Model tools/context: unchanged. Persisted configuration/Session format: unchanged. Save explicitly modifies the selected workspace file; drafts are memory-only and do not survive a page reload.
  • Runtime: bounded authenticated directory/text reads and optimistic version-checked saves. Atomic replacement prevents partial file contents; this does not lock unrelated external filesystem writers.
  • Limits: 20 MiB read/download, 1 MiB UTF-8 editing, up to 16 retained drafts; bounded Office expansion/time/tables. Office content preview does not reproduce all application layouts. HTML/SVG blocks scripts/network. Safari and complex production Office documents were not validated.

@testikun testikun changed the title feat(web): workspace Files with inline previews and continued loading feat(web): inline workspace Files with editing and rich previews Sep 28, 2026
@testikun
testikun merged commit 2df37d4 into codex/web-ux-597 Sep 28, 2026
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant