Repository navigation
Conversation
The handle was pointer-only, so panel width was the one part of the layout a keyboard user could not reach. - Arrow keys nudge it by 8px, Shift makes the step 48px, Home/End park it at either extreme. Keys are spatial: ArrowLeft always moves the handle left, which widens or narrows depending on which edge it is anchored to. - The handle is focusable and announces itself as a window splitter (aria-label / valuenow / valuemin / valuemax) instead of a bare separator. - The 1px line lights up on keyboard focus too — otherwise focus would sit on something invisible. The direction and step rules are a pure function (`nextWidthForKey`) with unit tests; the new props are optional so existing call sites keep compiling. Co-Authored-By: Claude Opus 5 <[email protected]>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7ed9174. Configure here.
| case "Home": | ||
| return widerToTheLeft ? maxWidth : minWidth; | ||
| case "End": | ||
| return widerToTheLeft ? minWidth : maxWidth; |
There was a problem hiding this comment.
Home/End invert announced range
Medium Severity
The Home and End keys in useResizableWidth set the panel width to maxWidth and minWidth respectively when edge is "left". This behavior is inverted from typical expectations for range controls and conflicts with the aria-valuemin/aria-valuemax values, making it confusing for assistive technologies.
Reviewed by Cursor Bugbot for commit 7ed9174. Configure here.
| if (next === null) return; | ||
| event.preventDefault(); | ||
| commit(next); | ||
| }, |
There was a problem hiding this comment.
Keyboard resize fights active drag
Low Severity
onKeyDown always commits even when dragStateRef is active. A key press mid-drag writes localStorage immediately, while pointer move still derives width from the original startWidth, and onPointerCancel reverts the UI to startWidth without undoing that persist, so displayed and stored width can diverge.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 7ed9174. Configure here.
ApprovabilityVerdict: Needs human review Unresolved review comment identifies a medium-severity accessibility issue where Home/End key behavior inverts relative to the announced ARIA value range, potentially confusing assistive technology users. This bug in an accessibility-focused PR warrants human review. You can customize Macroscope's approvability policy. Learn more. |
|
Closing this — opened in error on my side; these changes were meant to stay in my own fork, not to go upstream. Sorry for the noise. |


What changed
RightPanelResizeHandlewas pointer-only:role="separator"with pointer handlers, notabIndex, no name, no value. Panel width was the one part of the layout a keyboard user could not reach.aria-label,aria-valuenow,aria-valuemin,aria-valuemax— instead of an unnamed separator.group-focus-visible:bg-primary), so focus never sits on something invisible.Keys are spatial:
ArrowLeftalways moves the handle left, which widens or narrows depending on which edge the panel is anchored to. That rule lives in a pure function,nextWidthForKey, so the direction and step logic is testable without a DOM.The new props on
RightPanelResizeHandleare optional, so existing call sites keep compiling;PreviewPanelShellpasses them.Why it should exist
useResizableWidthalready owns clamping and persistence — the keyboard path is ~40 lines on top of machinery that exists. Without it the panel has a visible, draggable affordance that simply does not exist for anyone not using a pointer.Before / after
The change is only visible while the handle has focus, because before this patch the handle could not receive focus at all.
Interaction, walked through in a real browser on this branch: Tab reaches the handle right after the composer's send button; it reports
Resize preview panel,valuenow 540,min 360,max 714.Shift+ArrowLeft×3 widens the panel 540 → 684,Endparks it at 360,ArrowLeft×8 brings it to 424. Focus ring and line colour verified in the dark theme.Test
apps/web/src/hooks/useResizableWidth.test.tscoversnextWidthForKey: both edges, both step sizes, Home/End, and the keys it must ignore.vp test run --project unit apps/web/src/hooks/useResizableWidth.test.ts→ 6 passed.Notes
Read CONTRIBUTING first — happy for this to be closed or deferred. It is small, self-contained, and does not change any existing behaviour for pointer users.
Note
Low Risk
Localized UI/a11y change to panel resizing; pointer behavior unchanged and width still clamped and persisted through existing hook logic.
Overview
Makes the preview panel resize handle keyboard-accessible and properly announced to assistive tech, without changing pointer drag behavior.
useResizableWidthnow exposesonKeyDownand a sharedcommitpath so arrow keys (8px), Shift+arrows (48px), and Home/End resize the panel with the same clamping andlocalStoragepersistence as drag-end. Direction is edge-aware via exported pure helpernextWidthForKey, covered by new unit tests.RightPanelResizeHandlebecomes focusable (tabIndex={0}) witharia-label/ value min-max, and shows focus on the 1px indicator.PreviewPanelShellpasses width bounds and the label"Resize preview panel".Reviewed by Cursor Bugbot for commit 7ed9174. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Make the right-panel resize handle keyboard operable
RightPanelResizeHandlecomponent gainstabIndex=0, ARIA attributes (aria-label,aria-valuenow,aria-valuemin,aria-valuemax), and a focus-visible highlight on the indicator line.useResizableWidthgains anonKeyDownhandler: Arrow keys move the panel width by a small step, Shift+Arrow moves by a coarse step, and Home/End jump to the min/max bounds. The new width is clamped and immediately persisted to localStorage.nextWidthForKeyis exported from useResizableWidth.ts to compute the next width from key input, aware of which edge the handle sits on.PreviewPanelShellnow passeslabel,minWidth,maxWidth, and currentwidthto the handle to populate the ARIA value semantics correctly.📊 Macroscope summarized 7ed9174. 3 files reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted
🗂️ Filtered Issues
No issues evaluated.