Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(sidebar): lift the resize rail above the content card so its hit area works\n\nHalf the rail's widened pointer target never received events. Aiming at what\nlooks like the grab area did nothing.\n\nIt is a stacking problem, not a sizing one, and the widths were already correct.\n`SidebarRail` is `w-0` with an absolutely-positioned hit area that overhangs it\nby 4px on each side (`-left-1 -right-1`). That child carried `z-10`. So does\n`SidebarInset`, the content card — `relative z-10` at Sidebar.tsx:408 — and\n`RootShellLayout` renders the card AFTER the rail. Equal z-index means DOM order\ndecides, so the card painted over the overhanging half and `elementFromPoint` at\nthe rail's own centre returned the content viewport.\n\nMeasured before the fix, at a 224px sidebar edge with the hit area spanning\nx=220..228:\n\n x=221 -> SPAN (the rail) x=224 -> DIV (content viewport)\n x=222 -> SPAN (the rail) x=227 -> DIV (content viewport)\n\nSo the 8px target the widening was meant to buy was 4px, and the dead half was\nthe one the cursor naturally lands on when the resize cursor appears.\n\nRaising `SidebarRail` itself to `z-20` rather than the hit-area child, because\nthe 1px seam indicator is the same shape of problem: it sits at the rail's\n`left-0` with no z-index of its own, and `SidebarInset` butts against the\nsidebar with no left margin, so it was under the card too. Lifting the rail\nlifts both children together. `SidebarInset`'s own `after:z-20` shadow cannot\ncompete — `relative z-10` makes it a stacking context, so that pseudo-element is\nscoped inside it.\n\nThe clamp is inert above the card: the rail is 8px of transparent hit area plus\na 1px seam that only paints on hover/focus, so nothing new is drawn over the\ncontent.\n\nTest: app-shell-sidebar-resize.spec.ts gains a regression guard that samples\nfive x positions across the hit area's real box and asserts every one resolves\ninside the rail. It samples rather than probing once because the failure was\nprecisely that one half worked and the other did not. The file's header comment\nrecorded the dead half as a standing caveat; that is now corrected to describe\nthe fix.\n\nNOT EXECUTED. Local builds and test runs are prohibited in this phase, so this\nis reasoned from source: Sidebar.tsx:330 (rail), :336 (hit area), :408\n(SidebarInset), RootShellLayout.tsx:256-277 (render order). Prettier clean, tsc\nreports no errors in the touched files. CI is the check.\n\n## Related\n\nCloses #5906\n

M3gA-Mind77f2329b959a
diff --git a/app/src/components/ui/Sidebar.tsx b/app/src/components/ui/Sidebar.tsx
index eae4bb9451..b1f3b78125 100644
--- a/app/src/components/ui/Sidebar.tsx
+++ b/app/src/components/ui/Sidebar.tsx
@@ -327,7 +327,17 @@ export const SidebarRail = forwardRef<HTMLDivElement, SidebarRailProps>(
// wider than its other three by exactly that much. The seam is drawn
// by the absolutely-positioned indicator below instead, which costs
// no width — and it only paints on hover/focus anyway.
- 'group relative w-0 flex-none cursor-col-resize select-none self-stretch',
+ //
+ // `z-20` is load-bearing, not decoration. `SidebarInset` — the content
+ // card, rendered AFTER this element by `RootShellLayout` — carries
+ // `relative z-10`, and the hit area below carried `z-10` too. Equal
+ // z-index means DOM order decides, so the card painted over the half
+ // of the hit area that overhangs it and pointer events never reached
+ // the rail there: `elementFromPoint` at the rail's own centre returned
+ // the content viewport, not this element (#5906). Raising the rail
+ // itself rather than the child lifts BOTH the hit area and the 1px
+ // seam, which share the cause.
+ 'group relative z-20 w-0 flex-none cursor-col-resize select-none self-stretch',
'bg-transparent focus:outline-hidden',
className
)}
diff --git a/app/test/playwright/specs/app-shell-sidebar-resize.spec.ts b/app/test/playwright/specs/app-shell-sidebar-resize.spec.ts
index 4d96cca016..7e2afe247f 100644
--- a/app/test/playwright/specs/app-shell-sidebar-resize.spec.ts
+++ b/app/test/playwright/specs/app-shell-sidebar-resize.spec.ts
@@ -51,13 +51,18 @@ const widthOf = (page: Page) =>
* So: point at the hit area, read colour off the seam, and assert the rail's
* presence by count rather than by visibility.
*
- * And point at its LEFT half specifically. Measured with `elementFromPoint`
- * (sidebar right edge at x=224, hit area x=220..228):
+ * The LEFT-half-only caveat this comment used to carry is FIXED (#5906). It
+ * read: measured with `elementFromPoint` at a 224px sidebar edge, x=221 and
+ * x=222 reached the rail while x=224 and x=227 reached the content viewport —
+ * so half the widened hit area was dead and aiming at the element's centre
+ * (what `hover()` and `boundingBox()` centre do) landed on the dead side.
*
- * x=221 -> SPAN.absolute inset-y-0 -left-1 -right-1 (the rail)
- * x=222 -> SPAN (the rail)
- * x=224 -> DIV.relative flex flex-1 ... (content viewport)
- * x=227 -> DIV (content viewport)
+ * Cause: `SidebarInset` carries `relative z-10` and is rendered AFTER the rail,
+ * and the hit area carried `z-10` too, so equal z-index let DOM order decide.
+ * `SidebarRail` now carries `z-20`, which lifts the hit area and the seam
+ * together. `railPoint` below still aims at the sidebar edge — that is where a
+ * user's cursor is when the resize cursor appears — and the new test at the end
+ * of this file asserts the formerly dead half now receives events.
*
* The content surface is painted over the `-right-1` half despite the hit
* area's `z-10`, so only x 220..223 actually reaches the rail. Aiming at the
@@ -140,6 +145,44 @@ test.describe('App shell — sidebar resize (#5676 AC-4)', () => {
expect(resized).not.toBe(before);
});
+ test('the full width of the hit area receives pointer events (#5906)', async ({ page }) => {
+ // The regression guard for the stacking fix. Before it, the content card
+ // (`SidebarInset`, `relative z-10`, rendered after the rail) painted over
+ // the half of the hit area that overhangs it, so `elementFromPoint` there
+ // returned the content viewport and a drag started on nothing.
+ //
+ // Walks the hit area's real box and asserts every sampled x resolves to a
+ // node inside the rail. Sampling rather than one point: the failure was
+ // exactly that one half worked and the other did not, so a single probe at
+ // the wrong offset reports the wrong answer either way.
+ const box = await hitArea(page).boundingBox();
+ expect(box).not.toBeNull();
+ expect(box!.width).toBeGreaterThan(0);
+
+ const y = box!.y + box!.height / 2;
+ const offsets = [1, box!.width / 4, box!.width / 2, (box!.width * 3) / 4, box!.width - 1];
+
+ const owners = await page.evaluate(
+ ({ xs, yy }) =>
+ xs.map(x => {
+ const el = document.elementFromPoint(x, yy);
+ const railEl = document.querySelector('[data-testid="root-shell-divider"]');
+ return {
+ x: Math.round(x),
+ insideRail: Boolean(railEl && el && (el === railEl || railEl.contains(el))),
+ tag: el ? el.tagName : 'null',
+ };
+ }),
+ { xs: offsets.map(o => box!.x + o), yy: y }
+ );
+
+ const dead = owners.filter(o => !o.insideRail);
+ expect(
+ dead,
+ `these x positions do not reach the rail: ${dead.map(d => `${d.x} -> ${d.tag}`).join(', ')}`
+ ).toEqual([]);
+ });
+
test('the rail is absent while collapsed — the icon column is fixed, not draggable', async ({
page,
}) => {