diff --git a/README.md b/README.md index 33ea558df3484..9435493c76d49 100644 --- a/README.md +++ b/README.md @@ -56,8 +56,8 @@ This is a personal fork of [pingdotgg/t3code](https://github.com/pingdotgg/t3cod - **Linear issue panel** — on web and desktop, a `linear.app//issue/KEY-123` link in any message opens the issue as a tab in the right panel instead of the browser, and bare identifiers like `SP-123` do the same for the team keys you list. The tab shows the title, description, and comments, with the issue's properties as a row of chips that use Linear's own status and priority glyphs; the assignee, creator, project, and team open their Linear pages, and the parent, sub-issues, blocking and related issues, and attached links each get a section when the issue has them. Sub-issues and relations open as further tabs, the git branch name copies with one click, it refreshes on demand, and you can post a comment. Unsent comments survive tab switches within the same browser session; hovering a link shows a preview card. The personal API key (stored server-side, one per environment) and the team keys live in Settings → Extras → Linear. Mobile keeps opening these links in the system browser. - **File path actions.** The open-in menu on a file tab ends with Reveal in Finder (File Explorer or Files on other hosts), Copy relative path, and Copy full path. Right-clicking the file name in the breadcrumb, the file tab, a file in the tree, or a diff header offers the same copy pair. Reveal, and the right-click menu's Open and Open with, only appear while you are on the machine that hosts the environment, since launching an app on another computer helps nobody. The menu's default-app entry is now called "Default app" rather than "Finder", because a file opens in whatever app owns its type. - **Saved prompt library** — reusable prompts (title + content) managed in Settings → Prompts and synced across connected environments with whole-library last-write-wins, including catch-up for environments that were offline during an edit. `/prompt` in the composer opens a filterable picker (titles and content previews) that inserts the prompt at the cursor without sending; the command palette's **Prompts...** submenu inserts the selected prompt into the composer on Enter and copies it on Cmd+Enter on macOS or Ctrl+Enter on Windows and Linux. Web and desktop. -- **Sidebar polish** — the Active section has its own named, foldable header with an inbox icon, and unsent drafts get a foldable Drafts section at the top of the web and desktop sidebar; Pinned, Active, Snoozed, Settled, and Archived keep their fold state per device. A folded custom group, Pinned, or Active still shows a thread that starts waiting for approval or an answer, gets a guest request, or fails, until you fold or unfold it again (web, desktop, and mobile; also boring-mode project folders on web and desktop). Thread rows add hover buttons to pin or unpin, fork the conversation, and archive (archive when done while a turn runs, or cancel a pending archive). Settings → Extras adds compact two-line thread cards (row details move beside the title), a choice of when rows show their provider icon, and an option to put the New thread button in the project filter row. Projects carry color accents shared across connected machines and shown in mobile thread lists, with optional row tinting for sidebar rows and search results, the archive shelf, Settings → Archived, and command palette projects and threads (Settings → Extras on web, Settings → Appearance on mobile). -- **Active work filter** — a bolt button before the project filter shows only your active work: threads that are working, monitoring, waiting on subagents, or need you, plus threads you marked as active. Mark a thread with the bolt hover button (between Pin and Snooze), its menu, the command palette, or the agent `t3_thread_organize` tool; marked threads show a small bolt, including on mobile, are never auto-settled, and lose the mark when settled or archived. Threads stay in the filtered list after their work stops, and newly active threads join it, until you turn the filter off; snoozing, archiving, or settling removes them. Settings → Extras offers **Include Done threads in active filter**, off by default, for unread completed replies. With the filter on, every section opens and empty groups are hidden; folding still works and the previous fold state comes back when the filter is turned off. Settings → Extras can also hide the Settle hover button. Mobile has the same filter: a bolt before the environment and project filters on iPhone, or beside the filter button on iPad and Android, with mark and unmark in the long-press menu and **Include Done** under Settings → General, all remembered per device. +- **Sidebar polish** — the Active section has its own named, foldable header with an inbox icon, and unsent drafts get a foldable Drafts section at the top of the web and desktop sidebar; Pinned, Active, Snoozed, Settled, and Archived keep their fold state per device. A folded custom group, Pinned, or Active still shows a thread that starts waiting for approval or an answer, gets a guest request, or fails, until you fold or unfold it again (web, desktop, and mobile; also boring-mode project folders on web and desktop). Thread rows add hover buttons to pin or unpin, fork the conversation, and archive (archive when done while a turn runs, or cancel a pending archive); a pending archive's marker sits where the Archive button appears. Settings → Extras adds compact two-line thread cards (row details move beside the title), a choice of when rows show their provider icon, and an option to put the New thread button in the project filter row. Projects carry color accents shared across connected machines and shown in mobile thread lists, with optional row tinting for sidebar rows and search results, the archive shelf, Settings → Archived, and command palette projects and threads (Settings → Extras on web, Settings → Appearance on mobile). +- **Active work filter** — a bolt button before the project filter shows only your active work: threads that are working, monitoring, waiting on subagents, or need you, plus threads you marked as active. Mark a thread with the bolt hover button (beside Archive), its menu, the command palette, or the agent `t3_thread_organize` tool; marked threads show a small bolt where that button appears, including on mobile, stay visible when their group, Pinned, or Active is folded (web, desktop, and mobile; also boring-mode project folders on web and desktop), are never auto-settled, and lose the mark when settled or archived. Threads stay in the filtered list after their work stops, and newly active threads join it, until you turn the filter off; snoozing, archiving, or settling removes them. Settings → Extras offers **Include Done threads in active filter**, off by default, for unread completed replies. With the filter on, every section opens and empty groups are hidden; folding still works and the previous fold state comes back when the filter is turned off. Settings → Extras can also hide the Settle hover button. Mobile has the same filter: a bolt before the environment and project filters on iPhone, or beside the filter button on iPad and Android, with mark and unmark in the long-press menu and **Include Done** under Settings → General, all remembered per device. - **Thread actions in the command palette** — the palette acts on the open thread: Archive, Pin or Unpin, Mark or Unmark as active, Settle or Un-settle, and Fork, each shown only where it applies, plus Copy thread ID, upstream's Copy thread, and Copy PR link. Copy thread ID and Archive also have their own keybinding commands. - **Final-response navigator** — beside the navigator for your own messages, web and desktop threads add a mirrored navigator for the agent's final responses, with hover previews and click-to-jump. Each navigator lists its messages in order with even spacing, tightening as the thread grows; once even the tightest spacing no longer fits, it scrolls to follow what you're reading instead of overlapping strips. The thread details card stays above the right navigator. Messages that other agents sent into the thread show in blue on the left navigator, and hover previews include each message's time. A pin button on your messages and on final responses marks their navigator strip in amber so you can find them again; pins are kept per thread in that browser. - **Open the floating preview in your browser** — on web and desktop, the floating browser preview's hover controls include **Open in system browser**, matching the right-panel preview. diff --git a/apps/web/src/components/Sidebar.drag.test.ts b/apps/web/src/components/Sidebar.drag.test.ts index 108c89d669f5f..7e821d822ad2d 100644 --- a/apps/web/src/components/Sidebar.drag.test.ts +++ b/apps/web/src/components/Sidebar.drag.test.ts @@ -509,6 +509,9 @@ describe("sidebar drag projection", () => { const open = preview({ ...input, routeThreadKey: "a2" }, "a2", over); expect(open.get(over)?.y).toBe(-83); expect(open.get(sidebarMarkerId("settled-header"))?.y).toBe(0); + // So does a bolted thread. + const bolted = preview({ ...input, keepsFoldedRow: (key) => key === "a2" }, "a2", over); + expect(bolted.get(sidebarMarkerId("settled-header"))?.y).toBe(0); }); it("uses the canonical settled rank and the destination's slim height", () => { diff --git a/apps/web/src/components/Sidebar.drag.ts b/apps/web/src/components/Sidebar.drag.ts index 5372955d47be4..9e0665a246d7e 100644 --- a/apps/web/src/components/Sidebar.drag.ts +++ b/apps/web/src/components/Sidebar.drag.ts @@ -108,9 +108,11 @@ export function createSidebarSortingStrategy(input: { * rows do not drift below their at-rest drop rects. */ boundaryLabelHeights?: Partial>; /** Fork: folded groups (null: Active). A drop into one hides the row, so the - * preview opens no slot under its header (the open thread excepted) and a - * folded Active opens no placeholder; the header is the drop target. */ + * preview opens no slot under its header (the open or a kept thread excepted) + * and a folded Active opens no placeholder; the header is the drop target. */ foldedGroupIds?: ReadonlySet; + /** Fork: rows a folded group keeps visible, such as bolted threads. */ + keepsFoldedRow?: (key: string) => boolean; }): SortingStrategy { if (input.enabled === false) return () => stationary; const { items } = input; @@ -213,7 +215,12 @@ export function createSidebarSortingStrategy(input: { const rows = groups.active.filter( (row) => (row.customGroupId ?? null) === id && - !(folded && row.key === active.key && row.key !== input.routeThreadKey), + !( + folded && + row.key === active.key && + row.key !== input.routeThreadKey && + input.keepsFoldedRow?.(row.key) !== true + ), ); if (rows.length) projected.push(...rows); else if (id === null && !folded) marker("active-placeholder"); diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx index 59e4ec592a930..f80994b6e0990 100644 --- a/apps/web/src/components/Sidebar.tsx +++ b/apps/web/src/components/Sidebar.tsx @@ -1115,8 +1115,8 @@ function useSidebarThreads(input: { return visible.length === settledThreads.length ? settledThreads : visible; })(); const hiddenSettledCount = Math.max(0, settledCount - visibleSettledThreads.length); - // A folded group keeps the open thread's row. Fork: it also keeps threads - // that started needing the user since the fold was last toggled. + // A folded group keeps the open thread's row. Fork: it also keeps bolted + // threads and threads that started needing the user since the last toggle. const surfacesAttention = foldedAttention.observe(threads); const foldedRows = (list: readonly EnvironmentThreadShell[], fold: string) => list.filter( @@ -2889,6 +2889,7 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve settledOrder: draggedSettledOrder, ...(draggedActiveOrder === undefined ? {} : { activeOrder: draggedActiveOrder }), foldedGroupIds, + keepsFoldedRow: (key) => threadByKey.get(key)?.activeMarkedAt != null, settledExpanded: settledShelfExpanded, settledVisibleCount, routeThreadKey: routeRowThreadKey, diff --git a/apps/web/src/components/sidebar/SidebarThreadRow.tsx b/apps/web/src/components/sidebar/SidebarThreadRow.tsx index 7ba9d7c15a9da..35746f2d744be 100644 --- a/apps/web/src/components/sidebar/SidebarThreadRow.tsx +++ b/apps/web/src/components/sidebar/SidebarThreadRow.tsx @@ -1728,14 +1728,6 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP )} {listeningIndicator} - {renderArchivePendingIndicator( - canOperateThread && - !sortable?.isDragging && - cn( - "group-has-[:focus-visible]/sidebar-row:hidden group-any-hover/sidebar-row:hidden", - snoozeMenuOpen && "hidden", - ), - )} {showPin ? ( )} + {/* Fork: centered under the hover Archive button, which overhangs by 4px. */} + {renderArchivePendingIndicator( + cn( + "ml-1.5 mr-0.75", + canOperateThread && + "group-has-[:focus-visible]/sidebar-row:hidden group-any-hover/sidebar-row:hidden", + canOperateThread && snoozeMenuOpen && "hidden", + ), + )} ) : null} - {props.activeMarkSupported && canOperateThread ? ( + {showForkButton ? ( - + } /> - - {props.isActiveMarked ? "Unmark as active" : "Mark as active"} - + Fork conversation ) : null} {showSnoozeButton ? ( @@ -1936,21 +1935,28 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP Settle thread ) : null} - {showForkButton ? ( + {props.activeMarkSupported && canOperateThread ? ( - + } /> - Fork conversation + + {props.isActiveMarked ? "Unmark as active" : "Mark as active"} + ) : null} {canOperateThread ? ( diff --git a/packages/client-runtime/src/state/threadInbox.test.ts b/packages/client-runtime/src/state/threadInbox.test.ts index 1cf4dd17d950d..bc711fa9d0a7e 100644 --- a/packages/client-runtime/src/state/threadInbox.test.ts +++ b/packages/client-runtime/src/state/threadInbox.test.ts @@ -289,6 +289,10 @@ describe("createFoldedAttentionTracker", () => { expect(tracker.observe([failed])(failed, "group:g")).toBe(true); const seen = { ...failed, lastVisitedAt: "2026-06-01T03:00:00.000Z" }; expect(tracker.observe([seen])(seen, "group:g")).toBe(false); + // Fork: a bolted thread stays through every fold toggle. + const bolted = { ...seen, activeMarkedAt: "2026-06-01T04:00:00.000Z" }; + tracker.acknowledge("group:g"); + expect(tracker.observe([bolted])(bolted, "group:g")).toBe(true); }); it("re-raises only new requests, and keeps acknowledgements across absence", () => { diff --git a/packages/client-runtime/src/state/threadInbox.ts b/packages/client-runtime/src/state/threadInbox.ts index 7ab8323c7256a..9994a596cc4b5 100644 --- a/packages/client-runtime/src/state/threadInbox.ts +++ b/packages/client-runtime/src/state/threadInbox.ts @@ -331,9 +331,9 @@ function asksAnew(previous: Attention | undefined, next: Attention): boolean { } /** - * A folded group hides its threads, except one that started needing the user - * (approval, question, guest request, unseen failure) after the fold was last - * toggled. Keep one at module scope; `observe` live shells when they change and + * A folded group hides its threads, except bolted ones and one that started + * needing the user (approval, question, guest request, unseen failure) since the + * fold was last toggled. Keep one at module scope; `observe` live shells and * `acknowledge` a fold on every toggle. Fold keys are the caller's. */ export function createFoldedAttentionTracker() { @@ -343,7 +343,11 @@ export function createFoldedAttentionTracker() { // and restores them (an environment toggled off and on) re-raises nothing. const states = new Map(); const acknowledged = new Map(); - const surfaces = (thread: ThreadKeyInput, fold: string) => + const surfaces = ( + thread: ThreadKeyInput & Pick, + fold: string, + ) => + thread.activeMarkedAt != null || (states.get(keyOf(thread))?.since ?? 0) > (acknowledged.get(fold) ?? 0); return { observe(threads: readonly AttentionThreadInput[]): typeof surfaces {