The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
fix(sidebar): publish the effective maximum to every resize consumer\n\nReview caught that the previous commit fixed one consumer and stopped.\n`useSidebar()` still exposed the configured `maxWidth`, so `SidebarRail`\nannounced `aria-valuemax="420"` for a column that cannot exceed 207px at a\n414px viewport.\n\n`setWidth` had the same flaw and it is the worse half: it clamped against\nthe raw maximum, so a drag in a narrow window could STORE a width the column\ncan never render — putting the stored and rendered values back into\ndisagreement, which is the defect this branch exists to remove.\n\nBoth now use `effectiveMax`, so the ceiling is as single-valued as the\ncurrent width.\n
M3gA-Minde67cfe9c5449
diff --git a/app/src/components/ui/Sidebar.tsx b/app/src/components/ui/Sidebar.tsxindex 92619a1fa0..cf3a3d43fa 100644--- a/app/src/components/ui/Sidebar.tsx+++ b/app/src/components/ui/Sidebar.tsx@@ -202,11 +202,15 @@ export const SidebarProvider = forwardRef<HTMLDivElement, SidebarProviderProps>(const setWidth = useCallback((next: number) => {- const clamped = clampWidth(Math.round(next), minWidth, maxWidth);+ // `effectiveMax`, not `maxWidth`: a drag in a narrow window must not be+ // able to STORE a width the column can never render. Clamping here+ // against the raw maximum would put the stored value and the rendered+ // one back into disagreement — the same defect one layer up.+ const clamped = clampWidth(Math.round(next), minWidth, effectiveMax);if (widthProp === undefined) setUncontrolledWidth(clamped);onWidthChange?.(clamped);},- [widthProp, onWidthChange, minWidth, maxWidth]+ [widthProp, onWidthChange, minWidth, effectiveMax]);useEffect(() => {@@ -230,9 +234,13 @@ export const SidebarProvider = forwardRef<HTMLDivElement, SidebarProviderProps>(width,setWidth,minWidth,- maxWidth,+ // The ACTIVE maximum, so every consumer agrees on the ceiling as well+ // as on the current value. `SidebarRail` publishes this as+ // `aria-valuemax`; exposing the raw 420 here announced a ceiling the+ // column could not reach in a narrow window.+ maxWidth: effectiveMax,}),- [open, setOpen, toggleSidebar, width, setWidth, minWidth, maxWidth]+ [open, setOpen, toggleSidebar, width, setWidth, minWidth, effectiveMax]);return (diff --git a/app/src/components/ui/Sidebar.viewport-clamp.test.tsx b/app/src/components/ui/Sidebar.viewport-clamp.test.tsxindex 9375dbf409..7ee6c5c932 100644--- a/app/src/components/ui/Sidebar.viewport-clamp.test.tsx+++ b/app/src/components/ui/Sidebar.viewport-clamp.test.tsx@@ -74,6 +74,16 @@ describe('Sidebar viewport clamp', () => {expect(screen.getByTestId('rail')).toHaveAttribute('aria-valuenow', '207');});+ it('announces the reachable ceiling, not the configured one', () => {+ // The same class of defect as the `aria-valuenow` one, one level up: the+ // context published the raw 420 as the maximum, so the separator advertised+ // a ceiling the column cannot reach at this viewport (#5941, CodeRabbit).+ setViewport(414);+ renderSidebar(420);++ expect(screen.getByTestId('rail')).toHaveAttribute('aria-valuemax', '207');+ });+it('never goes below the minimum, however narrow the window', () => {// Below 2 * minWidth a fraction stops being meaningful; the floor wins so// the two clamps cannot disagree.