Skip to content

Add a full-width toggle to the file panel - #790

Merged
agegr merged 2 commits into
agegr:mainfrom
uvforce:pr/file-panel-expand
Sep 18, 2026
Merged

agegr merged 2 commits into
agegr:mainfrom
uvforce:pr/file-panel-expand

Conversation

@uvforce

@uvforce uvforce commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Problem

The file panel is useful beside the chat, but its split width is restrictive when reading wide code, tables, documents, or interactive HTML previews. Dragging the separator helps only up to the layout's maximum width, and hiding the rest of the app manually would lose the convenient split layout.

Change

Add an expand/restore button next to the existing hide-panel button.

  • Expanded mode temporarily covers the app's available viewport without using the browser Fullscreen API.
  • The existing file panel and FileViewer stay mounted, so interactive HTML state, file-viewer state, and scroll position are not reset by the layout switch.
  • Restoring returns to the previous split width; the saved sidebar and file-panel widths are never overwritten.
  • Hiding an expanded panel clears expanded mode, so reopening returns to the normal split.
  • Background sidebar/chat controls and resize handles are inert while covered.
  • The button is omitted on mobile, where the file panel already fills the viewport.
  • Labels are included for English, Simplified Chinese, and Traditional Chinese.

The implementation is frontend-only and applies to the whole file panel rather than any one file type.

Tests

  • Added browser coverage at desktop and mobile widths using an interactive HTML fixture.
  • Verified manual split resizing, repeated expand/restore cycles, keyboard activation, exact width restoration, unchanged localStorage widths, iframe identity, form state, scroll position, and hide/reopen behavior.
  • npm test: 973 passed.
  • TypeScript, ESLint, git diff --check, and production build passed.
  • Full production-build E2E passed locally with system Chrome at 1280px and 390px.

Let readers temporarily expand the mounted file viewer across the app without changing the saved split width or reloading interactive previews. Restore the split with the same button, return to it after hiding the panel, and omit the redundant control on mobile where the panel is already full width.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-10T07:03:50.699073Z 961ae3c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 961ae3ca34

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread components/AppShell.tsx Outdated
<button
type="button"
className="file-panel-expand-button"
onClick={() => setRightPanelExpanded((expanded) => !expanded)}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Close toolbar flyouts before entering full width

When the System, Tools, Session, Agents, or Branches flyout is open, this handler expands the file panel without clearing activeTopPanel. Those flyouts remain rendered as fixed elements with zIndex: 500 at components/AppShell.tsx:2142-2150, above the full-width panel's z-index: 250; meanwhile their parent is made inert. The result is a stale, visibly overlaid but noninteractive flyout obscuring the file viewer until full-width mode is exited. Clear the active flyout when expanding, or otherwise ensure it cannot render above the expanded panel.

Useful? React with 👍 / 👎.

@agegr agegr left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compact and practical: one state flag, a CSS class that overlays the already-mounted panel, and inert on the covered regions so focus cannot land behind it. Saved widths untouched, mobile excluded. Merges cleanly onto current main; tsc, eslint, and the AppShell tests pass. Approving.

Full-width mode marks the chat column inert, so an already-open session or agents dropdown stayed painted above the viewer with no way to close it.

Co-authored-by: Cursor <cursoragent@cursor.com>
@agegr
agegr merged commit ffb2daf into agegr:main Sep 18, 2026
2 checks passed
lclichen pushed a commit to lclichen/pi-web that referenced this pull request Sep 22, 2026
* Add a full-width toggle to the file panel

Let readers temporarily expand the mounted file viewer across the app without changing the saved split width or reloading interactive previews. Restore the split with the same button, return to it after hiding the panel, and omit the redundant control on mobile where the panel is already full width.

* fix: dismiss top-bar menus when expanding the file panel

Full-width mode marks the chat column inert, so an already-open session or agents dropdown stayed painted above the viewer with no way to close it.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: wayne.luo <wayne.luo@bybit.com>
Co-authored-by: Alex Yang <agegcn@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit ffb2daf)
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.

2 participants