feat(web): opt-in full-width side panels - #751
Open
aliguy wants to merge 1 commit into
Open
Conversation
The right dock and split-pane panels are clamped by the composer feasibility probe: a resize drag is rejected as soon as the chat column can no longer render its composer, so a panel tops out at roughly half the window. That is the right default, but it leaves no way to give the embedded browser (or a diff, terminal, or file pane) the whole window when a page needs the room. Add an off-by-default "Full-width panels" setting. When on, the dock opens at the full width of the chat shell and both the dock and split-pane panels can be dragged edge to edge, bounded only by the shell itself. Panes with a natural size (the phone-shaped device pane) keep their preferred width in both modes. The width math moves into a pure panelWidthPolicy module so the dock and split-pane surfaces share one testable source of truth.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed
Adds an off-by-default Full-width panels setting under Settings > Behavior > Panels.
When it is on:
When it is off, behavior is exactly what it is today.
The width math moved into a new pure module,
apps/web/src/lib/panelWidthPolicy.ts, soRightDockandSplitChatSurfaceshare one testable source of truth instead of each carrying its own arithmetic inline.Why
Panel width is currently bounded by
canComposerHandlePanelWidthinapps/web/src/lib/panelResize.ts. Every resize drag on the right dock and on split-pane panels runs that probe, and the drag is rejected as soon as the chat composer would overflow its viewport or fall underCOMPOSER_COMPACT_MIN_LEFT_CONTROLS_WIDTH_PX. In practice a panel tops out near half the window, and there is no affordance to go past it.That default is right for a diff you are reading alongside the conversation. It is wrong for the embedded browser, which is the surface people most want to hand the whole window to. Real sites assume a desktop viewport, so at roughly half a laptop screen sign-in flows and dense app UIs end up cramped, wrap badly, and push controls out of reach, with no maximize control to escape it. Google sign-in pages are the case that prompted this: comfortable at full width, awkward at half.
The fix keeps the safe default and gives the user an explicit way out of it. A setting rather than a new default, because the clamp exists for a good reason and most panels should keep it.
Scope note
This changes how wide a panel is allowed to be. It does not change how
BrowserPanelrenders inside the panel, does not add an OS-level fullscreen mode for the webview, and does not touch scrolling inside the embedded page. If any of those are separate defects, happy to file them separately rather than fold them in here.UI Changes
No screenshots attached, and I would rather say so than pad the PR: I could not get reliable before/after captures of the drag out of my dev environment. Happy to add them if that blocks review. The visible differences are:
renderBooleanSettingRowswitch plus its reset affordance. It is also indexed in settings search underbehavior:full-width-panels.Verification
bun run typecheck: 7/7 tasks pass, 0 errorsoxfmt: cleanoxlint: 0 errors (433 pre-existing warnings, count unchanged)bun run test:web:focused src/lib/panelWidthPolicy.test.ts: 12/12 passapps/websuite: 3970 passed, 6 failed. All 6 are "test timed out" insrc/components/ChatMarkdown.test.tsxandsrc/components/Sidebar.import.test.tson a slow Windows box. I re-ran both files withapps/web/srcreverted to unmodifiedorigin/mainin the same checkout and they fail identically, so they are not from this change.Checklist