Skip to content

fix(app): keep the Files sidebar and its resize handle inside a narrow panel - #68740

Open
opencodejr[bot] wants to merge 2 commits into
devfrom
opencodejr/issue-fix-68737
Open

opencodejr[bot] wants to merge 2 commits into
devfrom
opencodejr/issue-fix-68737

Conversation

@opencodejr

@opencodejr opencodejr Bot commented Dec 6, 2026

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #68737

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

See #68737. SessionReviewV2Sidebar always drew the sidebar at its stored width, limited only to 200–480px. The sidebar is not allowed to shrink, so when the side panel or the window was narrower than that width, the sidebar overflowed the panel. The preview was clipped and the absolutely positioned resize handle ended up outside the panel, sometimes past the window, so it could not be grabbed to drag the sidebar back. The sidebar now watches the panel body's width with a ResizeObserver and draws itself at min(stored width, panel width). The stored width is not changed, so it comes back when the panel widens again. The resize handle's drag starts from the drawn width, so dragging back takes effect immediately.

How did you verify your code works?

Reproduced on dev@f1e5f7b by running Desktop from source with opencode-desktop-drive: open the side panel's Open file tab, drag the Files sidebar to 480px, then drag the chat/side-panel divider until the panel is 320px wide. Before the fix: the panel spanned x 952–1272 but the sidebar ended at x 1432, the handle sat at x 1428 in a 1280px window, and elementFromPoint at the handle no longer hit it. After the fix: the sidebar is 320px and ends at the panel edge, the handle at x 1268 is hit, and dragging it 100px left made the sidebar 218px. Shrinking the window to 900px also keeps the sidebar and handle inside the panel. In packages/session-ui, bun test src gave 757 pass, 3 skip, 0 fail, and bun run typecheck:tsc passed (the typecheck script itself failed with Script not found "check"). No regression test was added: it needs a browser layout (a Playwright component test).

Screenshots / recordings

The reproduction on #68737 has the recording and script, where there is one.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Opened by the bot from its reproduction of #68737 (simulated), fixed in a sandbox and reviewed in a separate session. A maintainer should review it before merging.

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixes the reported problem. I ran the #68737 reproduction in Desktop from source on both the base and this branch. On the base, once the side panel is narrowed to 320px, the 480px sidebar runs past the panel and its handle sits outside the window where it can't be grabbed. With this change the sidebar stops at the panel edge and the handle can be grabbed: dragging it 100px left brings the sidebar to 220px. A 900px window also stays inside the panel. In packages/session-ui, bun test src and typecheck:tsc both pass.

The public API is unchanged.

One optional suggestion is in an inline comment: at full panel width the preview is now 0px wide.

Before

After

@opencodejr

opencodejr Bot commented Dec 6, 2026

Copy link
Copy Markdown
Contributor Author

When a narrow panel limits the Files sidebar, it now keeps 120px of the panel for the file preview instead of filling the whole panel. The saved width is unchanged and comes back when the panel gets wider.

Thanks for running the reproduction. I took the optional suggestion from the inline comment: the sidebar now always leaves at least 120px of the panel for the preview, so it no longer drops to 0px at full panel width. bun test src and typecheck:tsc still pass in packages/session-ui.

Pushed in c660337 on opencodejr/issue-fix-68737.

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The new commit handles my earlier point about the preview: when the panel is narrowed, the sidebar now leaves 120px for the file preview. I re-ran the #68737 reproduction in Desktop from source. With the panel narrowed to 320px, the sidebar is 200px and the preview 120px, and the resize handle stays inside the panel where it can be grabbed. A 900px window gives the same result. In packages/session-ui, bun test src and typecheck:tsc both pass.

The public API is unchanged. I have no new concerns.

Before

After

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Files pane: resize handle becomes unreachable on narrow panels

0 participants