Skip to content

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

fix(conversations): keep new thread action visible while scrolling\n\nMove the new conversation control above the thread list so it remains accessible when conversations overflow the sidebar. Preserve scrollbar gutter alignment and use a dedicated spacing wrapper for consistent layout.\n\nAuto-committed-on: macbook\n

Steven Enamakel8830ea7ea755
diff --git a/app/src/features/conversations/threadList/ThreadList.tsx b/app/src/features/conversations/threadList/ThreadList.tsx
index 687b71fd69..5884484b3e 100644
--- a/app/src/features/conversations/threadList/ThreadList.tsx
+++ b/app/src/features/conversations/threadList/ThreadList.tsx
@@ -52,6 +52,71 @@ export function ThreadList({
return (
// Card background / rounded corners come from TwoPanelLayout's pane styling.
<div className="h-full flex flex-col">
+ {/* Pinned above the scroller, not inside it. It used to be the list's
+ first child and scrolled away with the threads, so on any account with
+ more than a screenful of conversations the one control that starts a
+ new one was reachable only by scrolling back to the top.
+
+ The wrapper is `overflow-hidden` purely to carry the same
+ `scrollbar-gutter` as the list below it. A gutter is only reserved on
+ a scroll container, and `overflow: hidden` makes an element one
+ (programmatically scrollable) without it ever scrolling — so on
+ Windows, where the bar is laid out in flow and the gutter is real,
+ this row keeps the exact left edge the thread pills have. On macOS and
+ Linux the bar overlays, the gutter is inert, and both are simply
+ `px-2`. Without this the row would sit a scrollbar's width left of
+ every pill under it, on one platform only.
+
+ `pb-1` replaces the `mb-1` the button carried as a list child: same
+ gap, but owned by the band now that the button no longer sits on the
+ column's `gap-0.5` rhythm. */}
+ <div className="flex-none overflow-hidden px-2 pb-1 [scrollbar-gutter:stable_both-edges]">
+ {/* "New conversation" as a row, not a header icon. It is the same
+ affordance as a thread row — pick a conversation to work in — so it
+ takes the same shape: `h-8` pill, same radius, same hover fill, same
+ 14px label, sitting in the same column. As a 20px icon docked in a
+ section header it was both the smallest hit target in the sidebar
+ and the only control there that did not look like the thing it
+ produced. That header is gone with it: it was a group label for a
+ list that is already the only thing in its region, under a separator
+ that already divides it from the nav above.
+
+ A `<button>` rather than a `div[role=button]` like the thread rows:
+ those rows carry nested action buttons (rename, delete) and cannot
+ legally nest a button inside a button, which is why they hand-roll
+ the role and key handling. This row has no children, so it can be
+ the real element and get Enter/Space, focus and semantics for free.
+
+ Outline, not filled: a solid accent button would make the loudest
+ thing in the sidebar an action nobody needs most of the time, and it
+ would outrank the selected conversation, which is the one row that
+ should carry emphasis. A border states the affordance and leaves
+ `text-content-muted` matching an unselected thread row. The border
+ uses the same `content-faint` token as the composer's outline, so
+ the two read as one edge language rather than two.
+
+ `mb-1` on top of the column's `gap-0.5`: this row is a different
+ kind of thing from the conversations under it, and an outlined box
+ sitting on the exact rhythm of the plain rows reads as the first
+ item in the list rather than as its own control. */}
+ <button
+ type="button"
+ data-testid="new-thread-button"
+ data-analytics-id="chat-sidebar-new-thread"
+ onClick={onCreateThread}
+ title={t('chat.newThreadShortcut')}
+ className="group flex h-8 w-full flex-none cursor-pointer items-center gap-1.5 rounded-md border border-content-faint/35 px-3 text-left text-[14px] text-content-muted transition-colors hover:border-content-faint/60 hover:bg-surface/40 hover:text-content-secondary dark:hover:bg-surface/60">
+ <svg
+ className="h-3.5 w-3.5 flex-none"
+ fill="none"
+ stroke="currentColor"
+ viewBox="0 0 24 24"
+ aria-hidden="true">
+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 4v16m8-8H4" />
+ </svg>
+ <span className="truncate">{t('chat.newConversation')}</span>
+ </button>
+ </div>
{/* Rows carry no padding gutter of their own — a thread pill spans the
full width the scroll container gives it, so its hover/selected fill
reads as the width of the list rather than a floating inset card, with
@@ -89,51 +154,6 @@ export function ThreadList({
margin also lands after the last row and pads the scroll floor
unevenly against `pb-3`. */}
<div className="flex flex-1 flex-col gap-0.5 overflow-y-auto px-2 pb-3 [scrollbar-gutter:stable_both-edges] [scrollbar-width:thin]">
- {/* "New conversation" as a row, not a header icon. It is the same
- affordance as a thread row — pick a conversation to work in — so it
- takes the same shape: `h-8` pill, same radius, same hover fill, same
- 14px label, sitting in the same column. As a 20px icon docked in a
- section header it was both the smallest hit target in the sidebar
- and the only control there that did not look like the thing it
- produced. That header is gone with it: it was a group label for a
- list that is already the only thing in its region, under a separator
- that already divides it from the nav above.
-
- A `<button>` rather than a `div[role=button]` like the thread rows:
- those rows carry nested action buttons (rename, delete) and cannot
- legally nest a button inside a button, which is why they hand-roll
- the role and key handling. This row has no children, so it can be
- the real element and get Enter/Space, focus and semantics for free.
-
- Outline, not filled: a solid accent button would make the loudest
- thing in the sidebar an action nobody needs most of the time, and it
- would outrank the selected conversation, which is the one row that
- should carry emphasis. A border states the affordance and leaves
- `text-content-muted` matching an unselected thread row. The border
- uses the same `content-faint` token as the composer's outline, so
- the two read as one edge language rather than two.
-
- `mb-1` on top of the column's `gap-0.5`: this row is a different
- kind of thing from the conversations under it, and an outlined box
- sitting on the exact rhythm of the plain rows reads as the first
- item in the list rather than as its own control. */}
- <button
- type="button"
- data-testid="new-thread-button"
- data-analytics-id="chat-sidebar-new-thread"
- onClick={onCreateThread}
- title={t('chat.newThreadShortcut')}
- className="group mb-1 flex h-8 w-full flex-none cursor-pointer items-center gap-1.5 rounded-md border border-content-faint/35 px-3 text-left text-[14px] text-content-muted transition-colors hover:border-content-faint/60 hover:bg-surface/40 hover:text-content-secondary dark:hover:bg-surface/60">
- <svg
- className="h-3.5 w-3.5 flex-none"
- fill="none"
- stroke="currentColor"
- viewBox="0 0 24 24"
- aria-hidden="true">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 4v16m8-8H4" />
- </svg>
- <span className="truncate">{t('chat.newConversation')}</span>
- </button>
{threads.length === 0 ? (
<p className="px-4 py-6 text-xs text-content-faint text-center">{t('chat.noThreads')}</p>
) : (