Skip to content

🤖 fix: clamp right sidebar width to prevent overflow#2147

Open
jaaydenh wants to merge 9 commits intomainfrom
fix/right-sidebar-width-clamp
Open

🤖 fix: clamp right sidebar width to prevent overflow#2147
jaaydenh wants to merge 9 commits intomainfrom
fix/right-sidebar-width-clamp

Conversation

@jaaydenh
Copy link
Contributor

@jaaydenh jaaydenh commented Feb 4, 2026

Summary

Prevents the workspace view from overflowing horizontally (and showing a bottom scrollbar) when the right sidebar is resized or the app window is narrowed.

Background

WorkspaceShell allows horizontal scrolling (overflow-x-auto). With ChatPane having a desktop minimum width (min-w-96 = 384px) and the right sidebar using a fixed pixel width, resizing could make the combined widths exceed the available container width.

Implementation

  • Clamp the right sidebar’s effective max width to: min(ABS_MAX, max(MIN, containerWidth - chatMinWidth)).
    • Uses useResizeObserver() on the WorkspaceShell root element.
    • Avoids rewriting the stored width in stacked (flex-col) mode.
  • Add a defensive maxWidth: "100%" to the right sidebar container so a persisted width can’t overflow narrow/stacked layouts.
  • Add a UI integration test that asserts the sidebar cannot be resized beyond the effective max.

Validation

  • make static-check

Risks

Low-to-moderate: affects workspace layout sizing. The clamp has a safe fallback when container width is unknown.


Generated with mux • Model: openai:gpt-5.2 • Thinking: xhigh • Cost: $5.34

@github-actions github-actions bot added the bug label Feb 4, 2026
Copy link

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

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: b2a6ab978f

ℹ️ 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".

@jaaydenh jaaydenh force-pushed the fix/right-sidebar-width-clamp branch from c2c9401 to 3330efb Compare February 5, 2026 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant