Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.
Refine light-mode sidebar surfaces (#4268)
Julius Marminge593289c3c771
diff --git a/apps/mobile/src/features/home/HomeHeader.tsx b/apps/mobile/src/features/home/HomeHeader.tsxindex 3a0342a82..cf9cf378e 100644--- a/apps/mobile/src/features/home/HomeHeader.tsx+++ b/apps/mobile/src/features/home/HomeHeader.tsx@@ -4,6 +4,8 @@ import type {SidebarThreadSortOrder,} from "@t3tools/contracts";import type { MenuAction } from "@react-native-menu/menu";+import { useAtomValue } from "@effect/atom-react";+import { AsyncResult } from "effect/unstable/reactivity";import { NativeHeaderToolbar, NativeStackScreenOptions } from "../../native/StackHeader";import { useCallback, useMemo, useRef } from "react";import { Platform, Pressable, Text as RNText, TextInput, View } from "react-native";@@ -14,6 +16,7 @@ import { ControlPillMenu } from "../../components/ControlPill";import { SymbolView } from "../../components/AppSymbol";import { T3Wordmark } from "../../components/T3Wordmark";import { useThemeColor } from "../../lib/useThemeColor";+import { mobilePreferencesAtom } from "../../state/preferences";import { useHardwareKeyboardCommand } from "../keyboard/hardwareKeyboardCommands";import { withNativeGlassHeaderItem } from "../layout/native-glass-header-items";import { createNativeMailSearchToolbarItem } from "../layout/native-mail-search-toolbar";@@ -21,6 +24,7 @@ import type { HomeProjectSortOrder } from "./homeThreadList";import {buildHomeListFilterMenu,type HomeListFilterMenuEnvironment,+ type HomeListFilterMenuProject,} from "./home-list-filter-menu";import {hasCustomHomeListOptions,@@ -33,13 +37,16 @@ export type HomeHeaderEnvironment = HomeListFilterMenuEnvironment;export function HomeHeader(props: {readonly environments: ReadonlyArray<HomeHeaderEnvironment>;+ readonly projects: ReadonlyArray<HomeListFilterMenuProject>;readonly searchQuery: string;readonly selectedEnvironmentId: EnvironmentId | null;+ readonly selectedProjectKey: string | null;readonly projectSortOrder: HomeProjectSortOrder;readonly threadSortOrder: SidebarThreadSortOrder;readonly projectGroupingMode: SidebarProjectGroupingMode;readonly onSearchQueryChange: (query: string) => void;readonly onEnvironmentChange: (environmentId: EnvironmentId | null) => void;+ readonly onProjectChange: (projectKey: string | null) => void;readonly onProjectSortOrderChange: (sortOrder: HomeProjectSortOrder) => void;readonly onThreadSortOrderChange: (sortOrder: SidebarThreadSortOrder) => void;readonly onProjectGroupingModeChange: (mode: SidebarProjectGroupingMode) => void;@@ -59,11 +66,24 @@ function checkedMenuState(checked: boolean) {return checked ? ("on" as const) : undefined;}+/** Thread List v2 lays the list out in fixed creation order, so the+ sort/group filter controls would be silently ignored — hide them and+ key the "customized" icon state off the environment filter alone. */+function useThreadListV2FilterGate() {+ const preferencesResult = useAtomValue(mobilePreferencesAtom);+ return (+ AsyncResult.isSuccess(preferencesResult) && preferencesResult.value.threadListV2Enabled === true+ );+}+function AndroidHomeHeader(props: HomeHeaderProps) {const insets = useSafeAreaInsets();const iconColor = useThemeColor("--color-icon");const mutedColor = useThemeColor("--color-foreground-muted");- const hasCustomListOptions = hasCustomHomeListOptions(props);+ const threadListV2Enabled = useThreadListV2FilterGate();+ const hasCustomListOptions = threadListV2Enabled+ ? props.selectedEnvironmentId !== null || props.selectedProjectKey !== null+ : hasCustomHomeListOptions(props);const menuActions = useMemo<MenuAction[]>(() => [{@@ -82,40 +102,67 @@ function AndroidHomeHeader(props: HomeHeaderProps) {})),],},- {- id: "project-sort",- title: "Sort projects",- subactions: PROJECT_SORT_OPTIONS.map((option) => ({- id: `project-sort:${option.value}`,- title: option.label,- state: checkedMenuState(props.projectSortOrder === option.value),- })),- },- {- id: "thread-sort",- title: "Sort threads",- subactions: THREAD_SORT_OPTIONS.map((option) => ({- id: `thread-sort:${option.value}`,- title: option.label,- state: checkedMenuState(props.threadSortOrder === option.value),- })),- },- {- id: "project-grouping",- title: "Group projects",- subactions: PROJECT_GROUPING_OPTIONS.map((option) => ({- id: `project-grouping:${option.value}`,- title: option.label,- state: checkedMenuState(props.projectGroupingMode === option.value),- })),- },+ ...(props.projects.length === 0+ ? []+ : ([+ {+ id: "project",+ title: "Project",+ subactions: [+ {+ id: "project:all",+ title: "All projects",+ state: checkedMenuState(props.selectedProjectKey === null),+ },+ ...props.projects.map((project) => ({+ id: `project:${project.key}`,+ title: project.label,+ state: checkedMenuState(props.selectedProjectKey === project.key),+ })),+ ],+ },+ ] satisfies MenuAction[])),+ ...(threadListV2Enabled+ ? []+ : ([+ {+ id: "project-sort",+ title: "Sort projects",+ subactions: PROJECT_SORT_OPTIONS.map((option) => ({+ id: `project-sort:${option.value}`,+ title: option.label,+ state: checkedMenuState(props.projectSortOrder === option.value),+ })),+ },+ {+ id: "thread-sort",+ title: "Sort threads",+ subactions: THREAD_SORT_OPTIONS.map((option) => ({+ id: `thread-sort:${option.value}`,+ title: option.label,+ state: checkedMenuState(props.threadSortOrder === option.value),+ })),+ },+ {+ id: "project-grouping",+ title: "Group projects",+ subactions: PROJECT_GROUPING_OPTIONS.map((option) => ({+ id: `project-grouping:${option.value}`,+ title: option.label,+ state: checkedMenuState(props.projectGroupingMode === option.value),+ })),+ },+ ] satisfies MenuAction[])),],[props.environments,props.projectGroupingMode,props.projectSortOrder,+ props.projects,props.selectedEnvironmentId,+ props.selectedProjectKey,props.threadSortOrder,+ threadListV2Enabled,],);const handleMenuAction = useCallback(@@ -137,6 +184,19 @@ function AndroidHomeHeader(props: HomeHeaderProps) {return;}+ if (id === "project:all") {+ props.onProjectChange(null);+ return;+ }++ if (id.startsWith("project:")) {+ const projectKey = id.slice("project:".length);+ if (props.projects.some((project) => project.key === projectKey)) {+ props.onProjectChange(projectKey);+ }+ return;+ }+const projectSort = PROJECT_SORT_OPTIONS.find((option) => id === `project-sort:${option.value}`,);@@ -255,17 +315,24 @@ function AndroidHomeHeader(props: HomeHeaderProps) {function IosHomeHeader(props: HomeHeaderProps) {const searchBarRef = useRef<SearchBarCommands>(null);const iconColor = useThemeColor("--color-icon");- const hasCustomListOptions = hasCustomHomeListOptions(props);+ const threadListV2Enabled = useThreadListV2FilterGate();+ const hasCustomListOptions = threadListV2Enabled+ ? props.selectedEnvironmentId !== null || props.selectedProjectKey !== null+ : hasCustomHomeListOptions(props);const focusSearch = useCallback(() => {searchBarRef.current?.focus();return searchBarRef.current !== null;}, []);useHardwareKeyboardCommand("focusSearch", focusSearch);- const filterMenu = buildHomeListFilterMenu(props);+ const filterMenu = buildHomeListFilterMenu({+ ...props,+ listOrganization: !threadListV2Enabled,+ });return (<><NativeStackScreenOptions+ optionsVersion={filterMenu.items}options={{// Static header config (glass, title, fonts) lives in Stack.tsx// (GLASS_HEADER_OPTIONS). Only dynamic values are set here.@@ -366,6 +433,28 @@ function IosHomeHeader(props: HomeHeaderProps) {))}</NativeHeaderToolbar.Menu>+ {props.projects.length > 0 ? (+ <NativeHeaderToolbar.Menu title="Project">+ <NativeHeaderToolbar.Label>Project</NativeHeaderToolbar.Label>+ <NativeHeaderToolbar.MenuAction+ isOn={props.selectedProjectKey === null}+ onPress={() => props.onProjectChange(null)}+ subtitle="Show threads from every project"+ >+ <NativeHeaderToolbar.Label>All projects</NativeHeaderToolbar.Label>+ </NativeHeaderToolbar.MenuAction>+ {props.projects.map((project) => (+ <NativeHeaderToolbar.MenuAction+ key={project.key}+ isOn={props.selectedProjectKey === project.key}+ onPress={() => props.onProjectChange(project.key)}+ >+ <NativeHeaderToolbar.Label>{project.label}</NativeHeaderToolbar.Label>+ </NativeHeaderToolbar.MenuAction>+ ))}+ </NativeHeaderToolbar.Menu>+ ) : null}+<NativeHeaderToolbar.Menu title="Sort projects"><NativeHeaderToolbar.Label>Sort projects</NativeHeaderToolbar.Label>{PROJECT_SORT_OPTIONS.map((option) => (diff --git a/apps/mobile/src/features/home/HomeRouteScreen.tsx b/apps/mobile/src/features/home/HomeRouteScreen.tsxindex 502d2bab1..d4b19cdb0 100644--- a/apps/mobile/src/features/home/HomeRouteScreen.tsx+++ b/apps/mobile/src/features/home/HomeRouteScreen.tsx@@ -1,9 +1,10 @@import * as Arr from "effect/Array";import * as Order from "effect/Order";import { useNavigation } from "@react-navigation/native";-import { useMemo, useState } from "react";+import { useEffect, useMemo, useState } from "react";import { NativeHeaderToolbar, NativeStackScreenOptions } from "../../native/StackHeader";+import { scopedProjectKey } from "../../lib/scopedEntities";import { useProjects, useThreadShells } from "../../state/entities";import { usePendingNewTasks } from "../../state/use-pending-new-tasks";import { useWorkspaceState } from "../../state/workspace";@@ -58,6 +59,28 @@ export function HomeRouteScreen() {setThreadSortOrder,} = useHomeListOptions(availableEnvironmentIds);const selectedEnvironmentId = listOptions.selectedEnvironmentId;+ const [selectedProjectKey, setSelectedProjectKey] = useState<string | null>(null);+ const projectFilterOptions = useMemo(+ () =>+ projects+ .filter(+ (project) =>+ selectedEnvironmentId === null || project.environmentId === selectedEnvironmentId,+ )+ .map((project) => ({+ key: scopedProjectKey(project.environmentId, project.id),+ label: project.title,+ })),+ [projects, selectedEnvironmentId],+ );+ useEffect(() => {+ if (+ selectedProjectKey !== null &&+ !projectFilterOptions.some((project) => project.key === selectedProjectKey)+ ) {+ setSelectedProjectKey(null);+ }+ }, [projectFilterOptions, selectedProjectKey]);// In split layouts the persistent sidebar IS the thread list — Home becomes// an empty detail pane so selecting a thread never transitions layouts.@@ -90,12 +113,15 @@ export function HomeRouteScreen() {<NativeStackScreenOptions options={{ title: "Threads", headerTitle: "Threads" }} /><HomeHeaderenvironments={environments}+ projects={projectFilterOptions}searchQuery={searchQuery}selectedEnvironmentId={selectedEnvironmentId}+ selectedProjectKey={selectedProjectKey}projectSortOrder={listOptions.projectSortOrder}threadSortOrder={listOptions.threadSortOrder}projectGroupingMode={listOptions.projectGroupingMode}onEnvironmentChange={setSelectedEnvironmentId}+ onProjectChange={setSelectedProjectKey}onOpenSettings={() => navigation.navigate("SettingsSheet", { screen: "Settings" })}onProjectGroupingModeChange={setProjectGroupingMode}onProjectSortOrderChange={setProjectSortOrder}@@ -115,6 +141,7 @@ export function HomeRouteScreen() {onSettleThread={settleThread}onUnsettleThread={unsettleThread}onEnvironmentChange={setSelectedEnvironmentId}+ onProjectChange={setSelectedProjectKey}onOpenEnvironments={() =>navigation.navigate("SettingsSheet", { screen: "SettingsEnvironments" })}@@ -151,6 +178,7 @@ export function HomeRouteScreen() {savedConnectionsById={savedConnectionsById}searchQuery={searchQuery}selectedEnvironmentId={selectedEnvironmentId}+ selectedProjectKey={selectedProjectKey}threads={threads}threadSortOrder={listOptions.threadSortOrder}/>diff --git a/apps/mobile/src/features/home/HomeScreen.tsx b/apps/mobile/src/features/home/HomeScreen.tsxindex d1339a9bb..41180c486 100644--- a/apps/mobile/src/features/home/HomeScreen.tsx+++ b/apps/mobile/src/features/home/HomeScreen.tsx@@ -38,7 +38,12 @@ import {ThreadListShowMoreRow,} from "../threads/thread-list-items";import { ThreadListV2Row } from "../threads/thread-list-v2-items";-import { buildThreadListV2Items, type ThreadListV2Item } from "../threads/threadListV2";+import {+ buildThreadListV2Items,+ THREAD_LIST_V2_SETTLED_INITIAL_COUNT,+ THREAD_LIST_V2_SETTLED_PAGE_COUNT,+ type ThreadListV2Item,+} from "../threads/threadListV2";import type { HomeListFilterMenuEnvironment } from "./home-list-filter-menu";import {buildHomeListLayout,@@ -65,11 +70,13 @@ interface HomeScreenProps {readonly environments: ReadonlyArray<HomeListFilterMenuEnvironment>;readonly searchQuery: string;readonly selectedEnvironmentId: EnvironmentId | null;+ readonly selectedProjectKey: string | null;readonly projectSortOrder: HomeProjectSortOrder;readonly threadSortOrder: SidebarThreadSortOrder;readonly projectGroupingMode: SidebarProjectGroupingMode;readonly onSearchQueryChange: (query: string) => void;readonly onEnvironmentChange: (environmentId: EnvironmentId | null) => void;+ readonly onProjectChange: (projectKey: string | null) => void;readonly onProjectSortOrderChange: (sortOrder: HomeProjectSortOrder) => void;readonly onThreadSortOrderChange: (sortOrder: SidebarThreadSortOrder) => void;readonly onProjectGroupingModeChange: (mode: SidebarProjectGroupingMode) => void;@@ -91,10 +98,6 @@ interface HomeScreenProps {/* ─── Layout constants ───────────────────────────────────────────────── */const ESTIMATED_THREAD_ROW_HEIGHT = 72;-// v2 settled-tail paging: recent history is the common lookup; the deep-// tail stays behind an explicit Show more.-const THREAD_LIST_V2_SETTLED_INITIAL_COUNT = 10;-const THREAD_LIST_V2_SETTLED_PAGE_COUNT = 25;/*** Top spacing between the list and the Android custom header. The Android* header (AndroidHomeHeader) is rendered in-flow above this screen and@@ -169,80 +172,6 @@ function HomeTopContentSpacer() {return <View className="h-4" />;}-function ThreadListV2ProjectScope(props: {- readonly projects: ReadonlyArray<EnvironmentProject>;- readonly selectedKey: string | null;- readonly onChange: (key: string | null) => void;-}) {- if (props.projects.length === 0) return null;-- return (- <ScrollView- horizontal- contentContainerStyle={{- gap: 8,- paddingHorizontal: 16,- paddingBottom: 8,- paddingTop: Platform.OS === "ios" ? 12 : 4,- }}- keyboardShouldPersistTaps="handled"- showsHorizontalScrollIndicator={false}- >- {props.projects.length > 1 ? (- <Pressable- accessibilityLabel="Show all threads"- accessibilityRole="button"- accessibilityState={{ selected: props.selectedKey === null }}- hitSlop={4}- onPress={() => props.onChange(null)}- className={cn(- "min-h-8 items-center justify-center rounded-lg border px-3",- props.selectedKey === null- ? "border-border bg-subtle-strong"- : "border-black/15 dark:border-white/15",- )}- >- <Text className="text-sm font-t3-medium text-foreground">All</Text>- </Pressable>- ) : null}- {props.projects.map((project) => {- const key = scopedProjectKey(project.environmentId, project.id);- const selected = props.selectedKey === key;- return (- <Pressable- key={key}- accessibilityLabel={`Show ${project.title} threads`}- accessibilityRole="button"- accessibilityState={{ selected }}- hitSlop={4}- onPress={() => props.onChange(selected ? null : key)}- className={cn(- "min-h-8 flex-row items-center gap-1.5 rounded-lg border py-1 pl-2 pr-3",- selected ? "border-border bg-subtle-strong" : "border-black/15 dark:border-white/15",- )}- >- <ProjectFavicon- environmentId={project.environmentId}- projectTitle={project.title}- size={15}- workspaceRoot={project.workspaceRoot}- />- <Text- className={cn(- "max-w-36 text-sm font-t3-medium",- selected ? "text-foreground" : "text-foreground-muted",- )}- numberOfLines={1}- >- {project.title}- </Text>- </Pressable>- );- })}- </ScrollView>- );-}-/* ─── Main screen ────────────────────────────────────────────────────── */export function HomeScreen(props: HomeScreenProps) {@@ -314,12 +243,51 @@ export function HomeScreen(props: HomeScreenProps) {onScrollBeginDrag: handleScrollBeginDrag,});+ const scopedProject = useMemo(+ () =>+ props.selectedProjectKey === null+ ? null+ : (props.projects.find(+ (project) =>+ scopedProjectKey(project.environmentId, project.id) === props.selectedProjectKey &&+ (props.selectedEnvironmentId === null ||+ project.environmentId === props.selectedEnvironmentId),+ ) ?? null),+ [props.projects, props.selectedEnvironmentId, props.selectedProjectKey],+ );+ const scopedProjects = useMemo(+ () => (scopedProject === null ? props.projects : [scopedProject]),+ [props.projects, scopedProject],+ );+ const scopedThreads = useMemo(+ () =>+ scopedProject === null+ ? props.threads+ : props.threads.filter(+ (thread) =>+ thread.environmentId === scopedProject.environmentId &&+ thread.projectId === scopedProject.id,+ ),+ [props.threads, scopedProject],+ );+ const scopedPendingTasks = useMemo(+ () =>+ scopedProject === null+ ? props.pendingTasks+ : props.pendingTasks.filter(+ (pendingTask) =>+ pendingTask.message.environmentId === scopedProject.environmentId &&+ pendingTask.creation.projectId === scopedProject.id,+ ),+ [props.pendingTasks, scopedProject],+ );+const projectGroups = useMemo(() =>buildHomeThreadGroups({- projects: props.projects,- threads: props.threads,- pendingTasks: props.pendingTasks,+ projects: scopedProjects,+ threads: scopedThreads,+ pendingTasks: scopedPendingTasks,environmentId: props.selectedEnvironmentId,searchQuery: props.searchQuery,projectSortOrder: props.projectSortOrder,@@ -327,14 +295,14 @@ export function HomeScreen(props: HomeScreenProps) {projectGroupingMode: props.projectGroupingMode,}),[- props.pendingTasks,props.projectGroupingMode,- props.projects,props.projectSortOrder,props.searchQuery,props.selectedEnvironmentId,props.threadSortOrder,- props.threads,+ scopedPendingTasks,+ scopedProjects,+ scopedThreads,],);@@ -365,7 +333,8 @@ export function HomeScreen(props: HomeScreenProps) {return map;}, [props.projects]);- const [v2ProjectScopeKey, setV2ProjectScopeKey] = useState<string | null>(null);+ const v2ProjectScopeKey = props.selectedProjectKey;+ const setV2ProjectScopeKey = props.onProjectChange;const v2ScopeProjects = useMemo(() =>props.selectedEnvironmentId === null@@ -382,12 +351,6 @@ export function HomeScreen(props: HomeScreenProps) {) ?? null),[v2ProjectScopeKey, v2ScopeProjects],);- useEffect(() => {- if (v2ProjectScopeKey !== null && v2ScopedProject === null) {- setV2ProjectScopeKey(null);- }- }, [v2ProjectScopeKey, v2ScopedProject]);-// Thread List v2 (beta): one flat list in creation order, no grouping.// Settled threads collapse into a recency tail below the card block.// Settled threads stay in the live shell stream (settled ≠ archived), so@@ -442,6 +405,10 @@ export function HomeScreen(props: HomeScreenProps) {const [nowMinute, setNowMinute] = useState(() => new Date().toISOString().slice(0, 16));useEffect(() => {if (!threadListV2Enabled) return;+ // Refresh immediately on enable: the mount-time value can be hours old+ // by the time the beta is switched on, which would misclassify the+ // inactivity auto-settle boundary until the first tick.+ setNowMinute(new Date().toISOString().slice(0, 16));const id = setInterval(() => setNowMinute(new Date().toISOString().slice(0, 16)), 60_000);return () => clearInterval(id);}, [threadListV2Enabled]);@@ -509,6 +476,11 @@ export function HomeScreen(props: HomeScreenProps) {(item.thread.session?.providerInstanceId ?? item.thread.modelSelection.instanceId),)?.driver ?? null}+ environmentLabel={+ Object.keys(props.savedConnectionsById).length > 1+ ? (props.savedConnectionsById[item.thread.environmentId]?.environmentLabel ?? null)+ : null+ }onSelectThread={props.onSelectThread}onDeleteThread={handleDeleteThread}onArchiveThread={props.onArchiveThread}@@ -535,6 +507,7 @@ export function HomeScreen(props: HomeScreenProps) {projectCwdByKey,props.onArchiveThread,props.onSelectThread,+ props.savedConnectionsById,serverConfigs,settlementEnvironmentIds,],@@ -731,14 +704,11 @@ export function HomeScreen(props: HomeScreenProps) {pendingTask.creation.projectId === v2ScopedProject.id)) &&(v2SearchQuery.length === 0 || pendingTask.title.toLocaleLowerCase().includes(v2SearchQuery)),);+ // Project scoping lives in the header filter menu (no inline chip row on+ // mobile — the menu is the one filter surface).const v2ListHeader = (<>{listHeader}- <ThreadListV2ProjectScope- projects={v2ScopeProjects}- selectedKey={v2ProjectScopeKey}- onChange={setV2ProjectScopeKey}- />{v2PendingTasks.map((pendingTask, index) => (<PendingTaskListRowkey={pendingTask.message.messageId}@@ -758,6 +728,11 @@ export function HomeScreen(props: HomeScreenProps) {const listEmpty = !hasResults ? (hasSearchQuery ? (<EmptyState title="No results" detail={`No threads matching "${props.searchQuery}".`} />+ ) : scopedProject !== null ? (+ <EmptyState+ title={`No threads in ${scopedProject.title}`}+ detail="Choose another project or create a new task."+ />) : selectedEnvironmentLabel ? (<EmptyStatetitle={`No threads in ${selectedEnvironmentLabel}`}@@ -792,7 +767,11 @@ export function HomeScreen(props: HomeScreenProps) {data={threadListV2Items}renderItem={renderV2Item}keyExtractor={v2KeyExtractor}- extraData={{ projectByKey, serverConfigs }}+ extraData={{+ projectByKey,+ serverConfigs,+ savedConnectionsById: props.savedConnectionsById,+ }}ListHeaderComponent={v2ListHeader}ListFooterComponent={threadListV2Layout.hiddenSettledCount > 0 ? (diff --git a/apps/mobile/src/features/home/home-list-filter-menu.test.ts b/apps/mobile/src/features/home/home-list-filter-menu.test.tsnew file mode 100644index 000000000..916e32671--- /dev/null+++ b/apps/mobile/src/features/home/home-list-filter-menu.test.ts@@ -0,0 +1,44 @@+import { describe, expect, it, vi } from "vite-plus/test";++import { buildHomeListFilterMenu } from "./home-list-filter-menu";++describe("buildHomeListFilterMenu", () => {+ it("adds a project scope submenu that selects and clears the same scope as the chips", () => {+ const onProjectChange = vi.fn();+ const menu = buildHomeListFilterMenu({+ environments: [],+ projects: [+ { key: "environment-1:project-1", label: "Codething" },+ { key: "environment-1:project-2", label: "Website" },+ ],+ selectedEnvironmentId: null,+ selectedProjectKey: "environment-1:project-1",+ projectSortOrder: "updated_at",+ threadSortOrder: "updated_at",+ projectGroupingMode: "repository",+ onEnvironmentChange: vi.fn(),+ onProjectChange,+ onProjectSortOrderChange: vi.fn(),+ onThreadSortOrderChange: vi.fn(),+ onProjectGroupingModeChange: vi.fn(),+ });++ const projectMenu = menu.items.find(+ (item) => item.type === "submenu" && item.title === "Project",+ );+ expect(projectMenu).toMatchObject({+ type: "submenu",+ items: [+ { title: "All projects", state: "off" },+ { title: "Codething", state: "on" },+ { title: "Website", state: "off" },+ ],+ });+ if (projectMenu?.type !== "submenu") throw new Error("Expected project submenu");++ projectMenu.items[0]?.onPress();+ projectMenu.items[2]?.onPress();+ expect(onProjectChange).toHaveBeenNthCalledWith(1, null);+ expect(onProjectChange).toHaveBeenNthCalledWith(2, "environment-1:project-2");+ });+});diff --git a/apps/mobile/src/features/home/home-list-filter-menu.ts b/apps/mobile/src/features/home/home-list-filter-menu.tsindex 46ea63967..73fda2f5d 100644--- a/apps/mobile/src/features/home/home-list-filter-menu.ts+++ b/apps/mobile/src/features/home/home-list-filter-menu.ts@@ -16,6 +16,11 @@ export interface HomeListFilterMenuEnvironment {readonly label: string;}+export interface HomeListFilterMenuProject {+ readonly key: string;+ readonly label: string;+}+type HomeListFilterMenuAction = {readonly type: "action";readonly title: string;@@ -37,15 +42,22 @@ export interface HomeListFilterMenu {export function buildHomeListFilterMenu(props: {readonly environments: ReadonlyArray<HomeListFilterMenuEnvironment>;+ readonly projects: ReadonlyArray<HomeListFilterMenuProject>;readonly selectedEnvironmentId: EnvironmentId | null;+ readonly selectedProjectKey: string | null;readonly projectSortOrder: HomeProjectSortOrder;readonly threadSortOrder: SidebarThreadSortOrder;readonly projectGroupingMode: SidebarProjectGroupingMode;readonly onEnvironmentChange: (environmentId: EnvironmentId | null) => void;+ readonly onProjectChange: (projectKey: string | null) => void;readonly onProjectSortOrderChange: (sortOrder: HomeProjectSortOrder) => void;readonly onThreadSortOrderChange: (sortOrder: SidebarThreadSortOrder) => void;readonly onProjectGroupingModeChange: (mode: SidebarProjectGroupingMode) => void;readonly onOpenSettings?: () => void;+ /** False hides the sort/group submenus. Thread List v2 uses a fixed+ creation-order layout, so offering those controls while it silently+ ignores them would be a lie; the environment filter still applies. */+ readonly listOrganization?: boolean;}): HomeListFilterMenu {const items: Array<HomeListFilterMenuAction | HomeListFilterMenuSubmenu> = [];@@ -57,61 +69,86 @@ export function buildHomeListFilterMenu(props: {});}- items.push(- {+ items.push({+ type: "submenu",+ title: "Environment",+ items: [+ {+ type: "action",+ title: "All environments",+ subtitle: "Show threads from every environment",+ state: props.selectedEnvironmentId === null ? "on" : "off",+ onPress: () => props.onEnvironmentChange(null),+ },+ ...props.environments.map((environment) => ({+ type: "action" as const,+ title: environment.label,+ state:+ props.selectedEnvironmentId === environment.environmentId+ ? ("on" as const)+ : ("off" as const),+ onPress: () => props.onEnvironmentChange(environment.environmentId),+ })),+ ],+ });++ if (props.projects.length > 0) {+ items.push({type: "submenu",- title: "Environment",+ title: "Project",items: [{type: "action",- title: "All environments",- subtitle: "Show threads from every environment",- state: props.selectedEnvironmentId === null ? "on" : "off",- onPress: () => props.onEnvironmentChange(null),+ title: "All projects",+ subtitle: "Show threads from every project",+ state: props.selectedProjectKey === null ? "on" : "off",+ onPress: () => props.onProjectChange(null),},- ...props.environments.map((environment) => ({+ ...props.projects.map((project) => ({type: "action" as const,- title: environment.label,- state:- props.selectedEnvironmentId === environment.environmentId- ? ("on" as const)- : ("off" as const),- onPress: () => props.onEnvironmentChange(environment.environmentId),+ title: project.label,+ state: props.selectedProjectKey === project.key ? ("on" as const) : ("off" as const),+ onPress: () => props.onProjectChange(project.key),})),],- },- {- type: "submenu",- title: "Sort projects",- items: PROJECT_SORT_OPTIONS.map((option) => ({- type: "action",- title: option.label,- state: props.projectSortOrder === option.value ? "on" : "off",- onPress: () => props.onProjectSortOrderChange(option.value),- })),- },- {- type: "submenu",- title: "Sort threads",- items: THREAD_SORT_OPTIONS.map((option) => ({- type: "action",- title: option.label,- state: props.threadSortOrder === option.value ? "on" : "off",- onPress: () => props.onThreadSortOrderChange(option.value),- })),- },- {- type: "submenu",- title: "Group projects",- items: PROJECT_GROUPING_OPTIONS.map((option) => ({- type: "action",- title: option.label,- subtitle: option.subtitle,- state: props.projectGroupingMode === option.value ? "on" : "off",- onPress: () => props.onProjectGroupingModeChange(option.value),- })),- },- );+ });+ }++ if (props.listOrganization !== false) {+ items.push(+ {+ type: "submenu",+ title: "Sort projects",+ items: PROJECT_SORT_OPTIONS.map((option) => ({+ type: "action",+ title: option.label,+ state: props.projectSortOrder === option.value ? "on" : "off",+ onPress: () => props.onProjectSortOrderChange(option.value),+ })),+ },+ {+ type: "submenu",+ title: "Sort threads",+ items: THREAD_SORT_OPTIONS.map((option) => ({+ type: "action",+ title: option.label,+ state: props.threadSortOrder === option.value ? "on" : "off",+ onPress: () => props.onThreadSortOrderChange(option.value),+ })),+ },+ {+ type: "submenu",+ title: "Group projects",+ items: PROJECT_GROUPING_OPTIONS.map((option) => ({+ type: "action",+ title: option.label,+ subtitle: option.subtitle,+ state: props.projectGroupingMode === option.value ? "on" : "off",+ onPress: () => props.onProjectGroupingModeChange(option.value),+ })),+ },+ );+ }return {title: "Thread list options",diff --git a/apps/mobile/src/features/home/home-list-options.test.ts b/apps/mobile/src/features/home/home-list-options.test.tsindex 788be2590..651a64f6f 100644--- a/apps/mobile/src/features/home/home-list-options.test.ts+++ b/apps/mobile/src/features/home/home-list-options.test.ts@@ -27,5 +27,8 @@ describe("home list options", () => {hasCustomHomeListOptions({ ...defaults, selectedEnvironmentId: "environment-1" as never }),).toBe(true);expect(hasCustomHomeListOptions({ ...defaults, projectGroupingMode: "separate" })).toBe(true);+ expect(+ hasCustomHomeListOptions({ ...defaults, selectedProjectKey: "environment-1:project-1" }),+ ).toBe(true);});});diff --git a/apps/mobile/src/features/home/home-list-options.ts b/apps/mobile/src/features/home/home-list-options.tsindex 648810343..919cec55e 100644--- a/apps/mobile/src/features/home/home-list-options.ts+++ b/apps/mobile/src/features/home/home-list-options.ts@@ -93,13 +93,16 @@ export function HomeListOptionsProvider({ children }: PropsWithChildren) {return createElement(HomeListOptionsContext, { value }, children);}-export function hasCustomHomeListOptions(options: HomeListOptions): boolean {+export function hasCustomHomeListOptions(+ options: HomeListOptions & { readonly selectedProjectKey?: string | null },+): boolean {const defaultProjectSortOrder =DEFAULT_SIDEBAR_PROJECT_SORT_ORDER === "manual"? "updated_at": DEFAULT_SIDEBAR_PROJECT_SORT_ORDER;return (options.selectedEnvironmentId !== null ||+ (options.selectedProjectKey !== null && options.selectedProjectKey !== undefined) ||options.projectSortOrder !== defaultProjectSortOrder ||options.threadSortOrder !== DEFAULT_SIDEBAR_THREAD_SORT_ORDER ||options.projectGroupingMode !== DEFAULT_SIDEBAR_PROJECT_GROUPING_MODEdiff --git a/apps/mobile/src/features/home/thread-swipe-actions.tsx b/apps/mobile/src/features/home/thread-swipe-actions.tsxindex 666169f30..186c606ae 100644--- a/apps/mobile/src/features/home/thread-swipe-actions.tsx+++ b/apps/mobile/src/features/home/thread-swipe-actions.tsx@@ -36,6 +36,8 @@ import { AppText as Text } from "../../components/AppText";const ACTION_ITEM_WIDTH = 58;const ACTION_CIRCLE_SIZE = 36;const ACTION_ICON_SIZE = 15;+const COMPACT_ACTION_CIRCLE_SIZE = 28;+const COMPACT_ACTION_ICON_SIZE = 13;export const THREAD_SWIPE_ACTIONS_WIDTH = ACTION_ITEM_WIDTH * 2;export const THREAD_SWIPE_SPRING = {@@ -163,6 +165,9 @@ export function useSwipeableScrollGate(options?: {export function ThreadSwipeable(props: {readonly backgroundColor: ColorValue;readonly children: (close: () => void) => ReactNode;+ /** Uses action visuals that fit inside compact 44pt rows. The press target+ * still spans the row's full height and width. */+ readonly compactActions?: boolean;readonly containerStyle?: StyleProp<ViewStyle>;/** Disables NEW swipe activations (e.g. while the list scrolls). */readonly enabled?: boolean;@@ -258,6 +263,7 @@ export function ThreadSwipeable(props: {renderRightActions={(_progress, translation, methods) => (<ThreadSwipeActionsbackgroundColor={props.backgroundColor}+ compact={props.compactActions === true}fullSwipeAction={props.fullSwipeAction ?? "delete"}fullSwipeThreshold={fullSwipeThreshold}onDelete={props.onDelete}@@ -285,6 +291,7 @@ export function ThreadSwipeable(props: {function SwipeActionButton(props: {readonly accessibilityLabel: string;readonly backgroundColor: string;+ readonly compact: boolean;readonly entryRange: readonly [number, number];readonly fullSwipeThreshold: number;readonly icon: ComponentProps<typeof SymbolView>["name"];@@ -293,6 +300,8 @@ function SwipeActionButton(props: {readonly stretchesOnFullSwipe: boolean;readonly translation: SharedValue<number>;}) {+ const circleSize = props.compact ? COMPACT_ACTION_CIRCLE_SIZE : ACTION_CIRCLE_SIZE;+ const iconSize = props.compact ? COMPACT_ACTION_ICON_SIZE : ACTION_ICON_SIZE;const actionStyle = useAnimatedStyle(() => {const reveal = Math.max(-props.translation.value, 0);const entryProgress = interpolate(reveal, props.entryRange, [0, 1], Extrapolation.CLAMP);@@ -324,7 +333,7 @@ function SwipeActionButton(props: {return {transform: [{ translateX: -stretch }],- width: ACTION_CIRCLE_SIZE + stretch,+ width: circleSize + stretch,};});const iconStyle = useAnimatedStyle(() => {@@ -386,13 +395,13 @@ function SwipeActionButton(props: {width: "100%",})}>- <View style={{ height: ACTION_CIRCLE_SIZE, width: ACTION_CIRCLE_SIZE }}>+ <View style={{ height: circleSize, width: circleSize }}><Animated.Viewstyle={[{backgroundColor: props.backgroundColor,borderRadius: 999,- height: ACTION_CIRCLE_SIZE,+ height: circleSize,left: 0,position: "absolute",top: 0,@@ -404,25 +413,25 @@ function SwipeActionButton(props: {style={[{alignItems: "center",- height: ACTION_CIRCLE_SIZE,+ height: circleSize,justifyContent: "center",left: 0,position: "absolute",top: 0,- width: ACTION_CIRCLE_SIZE,+ width: circleSize,},iconStyle,]}>- <SymbolView- name={props.icon}- size={ACTION_ICON_SIZE}- tintColor="#ffffff"- type="monochrome"- />+ <SymbolView name={props.icon} size={iconSize} tintColor="#ffffff" type="monochrome" /></Animated.View></View>- <Animated.View style={[{ paddingTop: 2 }, labelStyle]}>+ <Animated.View+ style={[+ { height: 14, justifyContent: "center", paddingTop: props.compact ? 0 : 2 },+ labelStyle,+ ]}+ ><Text className="text-3xs font-t3-medium text-foreground-muted" numberOfLines={1}>{props.label}</Text>@@ -434,6 +443,7 @@ function SwipeActionButton(props: {export function ThreadSwipeActions(props: {readonly backgroundColor: ColorValue;+ readonly compact: boolean;readonly fullSwipeAction?: "delete" | "primary";readonly fullSwipeThreshold: number;readonly onDelete: () => void;@@ -466,6 +476,7 @@ export function ThreadSwipeActions(props: {<SwipeActionButtonaccessibilityLabel={props.primaryAction.accessibilityLabel}backgroundColor="#007aff"+ compact={props.compact}entryRange={[ACTION_ITEM_WIDTH * 0.55, THREAD_SWIPE_ACTIONS_WIDTH * 0.85]}fullSwipeThreshold={props.fullSwipeThreshold}icon={props.primaryAction.icon}@@ -477,6 +488,7 @@ export function ThreadSwipeActions(props: {<SwipeActionButtonaccessibilityLabel={`Delete ${props.threadTitle}`}backgroundColor="#ff2d55"+ compact={props.compact}entryRange={[8, ACTION_ITEM_WIDTH * 0.72]}fullSwipeThreshold={props.fullSwipeThreshold}icon="trash"diff --git a/apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx b/apps/mobile/src/features/threads/ThreadNavigationSidebar.tsxindex f7ee4eaa7..13f628351 100644--- a/apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx+++ b/apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx@@ -5,9 +5,12 @@ import type {} from "@t3tools/client-runtime/state/shell";import { LegendList } from "@legendapp/list/react-native";import type { MenuAction } from "@react-native-menu/menu";-import { useCallback, useMemo, useRef, useState, type ReactNode } from "react";+import { useAtomValue } from "@effect/atom-react";+import { AsyncResult } from "effect/unstable/reactivity";+import type { EnvironmentId } from "@t3tools/contracts";+import { useCallback, useEffect, useMemo, useRef, useState, type ReactNode } from "react";import type { LayoutChangeEvent, NativeScrollEvent, NativeSyntheticEvent } from "react-native";-import { Platform, StyleSheet, TextInput, View, useColorScheme } from "react-native";+import { Platform, Pressable, StyleSheet, TextInput, View, useColorScheme } from "react-native";import { Gesture, GestureDetector } from "react-native-gesture-handler";import type { SwipeableMethods } from "react-native-gesture-handler/ReanimatedSwipeable";import { useSafeAreaInsets } from "react-native-safe-area-context";@@ -22,7 +25,9 @@ import { NativeStackScreenOptions } from "../../native/StackHeader";import { scopedProjectKey, scopedThreadKey } from "../../lib/scopedEntities";import { useThemeColor } from "../../lib/useThemeColor";import { useProjects, useThreadShells } from "../../state/entities";-import { usePendingNewTasks } from "../../state/use-pending-new-tasks";+import { mobilePreferencesAtom } from "../../state/preferences";+import { environmentServerConfigsAtom } from "../../state/server";+import { usePendingNewTasks, type PendingNewTask } from "../../state/use-pending-new-tasks";import { useWorkspaceState } from "../../state/workspace";import { useSavedRemoteConnections } from "../../state/use-remote-environment-registry";import { useHardwareKeyboardCommand } from "../keyboard/hardwareKeyboardCommands";@@ -59,6 +64,27 @@ import {ThreadListRow,ThreadListShowMoreRow,} from "./thread-list-items";+import { ThreadListV2Row } from "./thread-list-v2-items";+import {+ buildThreadListV2Items,+ THREAD_LIST_V2_SETTLED_INITIAL_COUNT,+ THREAD_LIST_V2_SETTLED_PAGE_COUNT,+ type ThreadListV2Item,+} from "./threadListV2";++/** The sidebar list serves both lists: v1 grouped items or, when the Thread+ List v2 beta is on, queued offline tasks, flat v2 rows, and a settled+ "Show more" pager. */+type SidebarListItem =+ | HomeListItem+ | {+ readonly type: "v2-pending-task";+ readonly key: string;+ readonly pendingTask: PendingNewTask;+ readonly isLast: boolean;+ }+ | { readonly type: "v2-thread"; readonly key: string; readonly item: ThreadListV2Item }+ | { readonly type: "v2-show-more"; readonly key: string; readonly hiddenCount: number };/*** Shared capsule behind the sidebar header buttons — a native liquid-glass@@ -169,7 +195,12 @@ function ThreadNavigationSidebarPane(const openSwipeableRef = useRef<SwipeableMethods | null>(null);const headerIsOverContentRef = useRef(false);const sidebarScrollGesture = useMemo(() => Gesture.Native(), []);- const { archiveThread, confirmDeleteThread } = useThreadListActions();+ const { archiveThread, confirmDeleteThread, settleThread, unsettleThread } =+ useThreadListActions();+ const preferencesResult = useAtomValue(mobilePreferencesAtom);+ const threadListV2Enabled =+ AsyncResult.isSuccess(preferencesResult) &&+ preferencesResult.value.threadListV2Enabled === true;const pendingTasks = usePendingNewTasks();const { openPendingTask, confirmDeletePendingTask } = usePendingTaskListActions();const environments = useMemo(@@ -193,19 +224,77 @@ function ThreadNavigationSidebarPane(setProjectSortOrder,setThreadSortOrder,} = useHomeListOptions(availableEnvironmentIds);+ const [selectedProjectKey, setSelectedProjectKey] = useState<string | null>(null);+ const projectFilterOptions = useMemo(+ () =>+ projects+ .filter(+ (project) =>+ options.selectedEnvironmentId === null ||+ project.environmentId === options.selectedEnvironmentId,+ )+ .map((project) => ({+ key: scopedProjectKey(project.environmentId, project.id),+ label: project.title,+ })),+ [options.selectedEnvironmentId, projects],+ );+ const selectedProject = useMemo(+ () =>+ selectedProjectKey === null+ ? null+ : (projects.find(+ (project) => scopedProjectKey(project.environmentId, project.id) === selectedProjectKey,+ ) ?? null),+ [projects, selectedProjectKey],+ );+ useEffect(() => {+ if (+ selectedProjectKey !== null &&+ !projectFilterOptions.some((project) => project.key === selectedProjectKey)+ ) {+ setSelectedProjectKey(null);+ }+ }, [projectFilterOptions, selectedProjectKey]);+ const scopedProjects = useMemo(+ () => (selectedProject === null ? projects : [selectedProject]),+ [projects, selectedProject],+ );+ const scopedThreads = useMemo(+ () =>+ selectedProject === null+ ? threads+ : threads.filter(+ (thread) =>+ thread.environmentId === selectedProject.environmentId &&+ thread.projectId === selectedProject.id,+ ),+ [selectedProject, threads],+ );+ const scopedPendingTasks = useMemo(+ () =>+ selectedProject === null+ ? pendingTasks+ : pendingTasks.filter(+ (pendingTask) =>+ pendingTask.message.environmentId === selectedProject.environmentId &&+ pendingTask.creation.projectId === selectedProject.id,+ ),+ [pendingTasks, selectedProject],+ );const groups = useMemo(() =>buildHomeThreadGroups({- projects,- threads,- pendingTasks,+ projects: scopedProjects,+ threads: scopedThreads,+ pendingTasks: scopedPendingTasks,environmentId: options.selectedEnvironmentId,searchQuery: props.searchQuery,projectSortOrder: options.projectSortOrder,threadSortOrder: options.threadSortOrder,projectGroupingMode: options.projectGroupingMode,}),- [options, pendingTasks, projects, props.searchQuery, threads],+ [options, props.searchQuery, scopedPendingTasks, scopedProjects, scopedThreads],);const [groupDisplayStates, setGroupDisplayStates] = useState<ReadonlyMap<string, HomeGroupDisplayState>@@ -237,6 +326,153 @@ function ThreadNavigationSidebarPane(}return map;}, [projects]);+ const projectByKey = useMemo(() => {+ const map = new Map<string, EnvironmentProject>();+ for (const project of projects) {+ map.set(scopedProjectKey(project.environmentId, project.id), project);+ }+ return map;+ }, [projects]);++ // Thread List v2 (beta) support — same model as the compact Home list+ // (HomeScreen.tsx): flat creation-order card block + settled recency tail.+ // PR states stream in per-row; merged/closed PRs auto-settle their thread+ // on the next partition.+ const [changeRequestStateByKey, setChangeRequestStateByKey] = useState<+ ReadonlyMap<string, "open" | "closed" | "merged">+ >(() => new Map());+ const handleChangeRequestState = useCallback(+ (threadKey: string, state: "open" | "closed" | "merged" | null) => {+ setChangeRequestStateByKey((current) => {+ if ((current.get(threadKey) ?? null) === state) return current;+ const next = new Map(current);+ if (state === null) {+ next.delete(threadKey);+ } else {+ next.set(threadKey, state);+ }+ return next;+ });+ },+ [],+ );+ // The settled tail renders in pages; expansion resets when the filter+ // context changes so environment/search flips never inherit a deep page.+ const [settledVisibleCount, setSettledVisibleCount] = useState(+ THREAD_LIST_V2_SETTLED_INITIAL_COUNT,+ );+ const settledResetKey = `${options.selectedEnvironmentId ?? "all"}:${selectedProjectKey ?? "all"}:${props.searchQuery.trim()}`;+ const lastSettledResetKeyRef = useRef(settledResetKey);+ if (lastSettledResetKeyRef.current !== settledResetKey) {+ lastSettledResetKeyRef.current = settledResetKey;+ setSettledVisibleCount(THREAD_LIST_V2_SETTLED_INITIAL_COUNT);+ }+ const showMoreSettled = useCallback(+ () => setSettledVisibleCount((count) => count + THREAD_LIST_V2_SETTLED_PAGE_COUNT),+ [],+ );+ // now ticks per minute so the inactivity auto-settle boundary is actually+ // crossed while the pane stays open; without a clock dependency the+ // partition memoizes a frozen "now".+ const [nowMinute, setNowMinute] = useState(() => new Date().toISOString().slice(0, 16));+ useEffect(() => {+ if (!threadListV2Enabled) return;+ // Refresh immediately on enable: the mount-time value can be hours old+ // by the time the beta is switched on, which would misclassify the+ // inactivity auto-settle boundary until the first tick.+ setNowMinute(new Date().toISOString().slice(0, 16));+ const id = setInterval(() => setNowMinute(new Date().toISOString().slice(0, 16)), 60_000);+ return () => clearInterval(id);+ }, [threadListV2Enabled]);+ // Threads on servers without the settlement capability never classify as+ // settled (the user could neither un-settle nor pin them).+ const serverConfigs = useAtomValue(environmentServerConfigsAtom);+ const settlementEnvironmentIds = useMemo(() => {+ const supported = new Set<EnvironmentId>();+ for (const [environmentId, config] of serverConfigs) {+ if (config.environment.capabilities.threadSettlement === true) {+ supported.add(environmentId);+ }+ }+ return supported;+ }, [serverConfigs]);+ const threadListV2Layout = useMemo(() => {+ if (!threadListV2Enabled) return { items: [], hiddenSettledCount: 0 };+ return buildThreadListV2Items({+ threads: threads.filter((thread) => thread.archivedAt === null),+ environmentId: options.selectedEnvironmentId,+ projectRef:+ selectedProject === null+ ? null+ : {+ environmentId: selectedProject.environmentId,+ projectId: selectedProject.id,+ },+ searchQuery: props.searchQuery,+ changeRequestStateByKey,+ settlementEnvironmentIds,+ settledLimit: settledVisibleCount,+ now: `${nowMinute}:00.000Z`,+ });+ }, [+ changeRequestStateByKey,+ nowMinute,+ options.selectedEnvironmentId,+ props.searchQuery,+ settledVisibleCount,+ settlementEnvironmentIds,+ threadListV2Enabled,+ threads,+ selectedProject,+ ]);+ const listItems = useMemo<readonly SidebarListItem[]>(() => {+ if (!threadListV2Enabled) return listLayout.items;+ // Queued offline tasks render above the thread rows (mirrors the+ // compact Home v2 list): they are not thread shells, so the v2 item+ // builder never sees them, but they must stay visible and deletable+ // while their environment is offline. Same environment scope and+ // search filter as the list.+ const v2SearchQuery = props.searchQuery.trim().toLocaleLowerCase();+ const v2PendingTasks = pendingTasks.filter(+ (pendingTask) =>+ (options.selectedEnvironmentId === null ||+ pendingTask.message.environmentId === options.selectedEnvironmentId) &&+ (selectedProject === null ||+ (pendingTask.message.environmentId === selectedProject.environmentId &&+ pendingTask.creation.projectId === selectedProject.id)) &&+ (v2SearchQuery.length === 0 ||+ pendingTask.title.toLocaleLowerCase().includes(v2SearchQuery)),+ );+ const items: SidebarListItem[] = v2PendingTasks.map((pendingTask, index) => ({+ type: "v2-pending-task" as const,+ key: `v2-pending:${pendingTask.message.messageId}`,+ pendingTask,+ isLast: index === v2PendingTasks.length - 1,+ }));+ for (const item of threadListV2Layout.items) {+ items.push({+ type: "v2-thread" as const,+ key: scopedThreadKey(item.thread.environmentId, item.thread.id),+ item,+ });+ }+ if (threadListV2Layout.hiddenSettledCount > 0) {+ items.push({+ type: "v2-show-more",+ key: "v2-show-more",+ hiddenCount: threadListV2Layout.hiddenSettledCount,+ });+ }+ return items;+ }, [+ listLayout.items,+ options.selectedEnvironmentId,+ pendingTasks,+ props.searchQuery,+ selectedProject,+ threadListV2Enabled,+ threadListV2Layout,+ ]);const showsConnectionStatus = shouldShowWorkspaceConnectionStatus(catalogState);const listMenuActions = useMemo<MenuAction[]>(() => [@@ -260,36 +496,64 @@ function ThreadNavigationSidebarPane(})),],},- {- id: "project-sort",- title: "Sort projects",- subactions: PROJECT_SORT_OPTIONS.map((option) => ({- id: `project-sort:${option.value}`,- title: option.label,- state: options.projectSortOrder === option.value ? "on" : "off",- })),- },- {- id: "thread-sort",- title: "Sort threads",- subactions: THREAD_SORT_OPTIONS.map((option) => ({- id: `thread-sort:${option.value}`,- title: option.label,- state: options.threadSortOrder === option.value ? "on" : "off",- })),- },- {- id: "project-grouping",- title: "Group projects",- subactions: PROJECT_GROUPING_OPTIONS.map((option) => ({- id: `project-grouping:${option.value}`,- title: option.label,- subtitle: option.subtitle,- state: options.projectGroupingMode === option.value ? "on" : "off",- })),- },+ ...(projectFilterOptions.length === 0+ ? []+ : ([+ {+ id: "project",+ title: "Project",+ subactions: [+ {+ id: "project:all",+ title: "All projects",+ subtitle: "Show threads from every project",+ state: selectedProjectKey === null ? "on" : "off",+ },+ ...projectFilterOptions.map((project) => ({+ id: `project:${project.key}`,+ title: project.label,+ state: selectedProjectKey === project.key ? ("on" as const) : ("off" as const),+ })),+ ],+ },+ ] satisfies MenuAction[])),+ // v2 lays the list out in fixed creation order — offering sort/group+ // controls it silently ignores would be a lie. Environment still+ // scopes the v2 partition, so it stays.+ ...(threadListV2Enabled+ ? []+ : ([+ {+ id: "project-sort",+ title: "Sort projects",+ subactions: PROJECT_SORT_OPTIONS.map((option) => ({+ id: `project-sort:${option.value}`,+ title: option.label,+ state: options.projectSortOrder === option.value ? "on" : "off",+ })),+ },+ {+ id: "thread-sort",+ title: "Sort threads",+ subactions: THREAD_SORT_OPTIONS.map((option) => ({+ id: `thread-sort:${option.value}`,+ title: option.label,+ state: options.threadSortOrder === option.value ? "on" : "off",+ })),+ },+ {+ id: "project-grouping",+ title: "Group projects",+ subactions: PROJECT_GROUPING_OPTIONS.map((option) => ({+ id: `project-grouping:${option.value}`,+ title: option.label,+ subtitle: option.subtitle,+ state: options.projectGroupingMode === option.value ? "on" : "off",+ })),+ },+ ] satisfies MenuAction[])),],- [environments, options],+ [environments, options, projectFilterOptions, selectedProjectKey, threadListV2Enabled],);const handleListMenuAction = useCallback(({ nativeEvent }: { readonly nativeEvent: { readonly event: string } }) => {@@ -305,6 +569,17 @@ function ThreadNavigationSidebarPane(if (environment) setSelectedEnvironmentId(environment.environmentId);return;}+ if (event === "project:all") {+ setSelectedProjectKey(null);+ return;+ }+ if (event.startsWith("project:")) {+ const projectKey = event.slice("project:".length);+ if (projectFilterOptions.some((project) => project.key === projectKey)) {+ setSelectedProjectKey(projectKey);+ }+ return;+ }const projectSort = PROJECT_SORT_OPTIONS.find((option) => `project-sort:${option.value}` === event,);@@ -326,6 +601,7 @@ function ThreadNavigationSidebarPane(},[environments,+ projectFilterOptions,setProjectGroupingMode,setProjectSortOrder,setSelectedEnvironmentId,@@ -382,7 +658,44 @@ function ThreadNavigationSidebarPane(onScroll: handleScroll,onScrollBeginDrag: handleScrollBeginDrag,});- const listExtraData = props.selectedThreadKey ?? "";+ const listExtraData = useMemo(+ () => ({+ selectedThreadKey: props.selectedThreadKey ?? "",+ savedConnectionsById,+ serverConfigs,+ }),+ [props.selectedThreadKey, savedConnectionsById, serverConfigs],+ );+ const sidebarItemsAreEqual = useCallback(+ (previous: SidebarListItem, item: SidebarListItem): boolean => {+ if (previous.type === "v2-thread" && item.type === "v2-thread") {+ return (+ previous.key === item.key &&+ previous.item.thread === item.item.thread &&+ previous.item.variant === item.item.variant &&+ previous.item.showSettledDivider === item.item.showSettledDivider+ );+ }+ if (previous.type === "v2-show-more" && item.type === "v2-show-more") {+ return previous.hiddenCount === item.hiddenCount;+ }+ if (previous.type === "v2-pending-task" && item.type === "v2-pending-task") {+ return previous.pendingTask === item.pendingTask && previous.isLast === item.isLast;+ }+ if (+ previous.type === "v2-thread" ||+ previous.type === "v2-show-more" ||+ previous.type === "v2-pending-task" ||+ item.type === "v2-thread" ||+ item.type === "v2-show-more" ||+ item.type === "v2-pending-task"+ ) {+ return false;+ }+ return homeListItemsAreEqual(previous, item);+ },+ [],+ );const focusSearch = useCallback(() => {const focus = () => {if (props.nativeChrome) {@@ -401,8 +714,78 @@ function ThreadNavigationSidebarPane(}, [props.nativeChrome, props.onRequestVisibility, props.visible]);useHardwareKeyboardCommand("focusSearch", focusSearch);const renderListItem = useCallback(- ({ item }: { readonly item: HomeListItem }) => {+ ({ item }: { readonly item: SidebarListItem }) => {switch (item.type) {+ case "v2-pending-task":+ return (+ <PendingTaskListRow+ variant="sidebar"+ pendingTask={item.pendingTask}+ environmentLabel={+ savedConnectionsById[item.pendingTask.message.environmentId]?.environmentLabel ??+ null+ }+ isLast={item.isLast}+ onSelectPendingTask={openPendingTask}+ onDeletePendingTask={confirmDeletePendingTask}+ />+ );+ case "v2-thread": {+ const thread = item.item.thread;+ const scopeKey = scopedProjectKey(thread.environmentId, thread.projectId);+ return (+ <ThreadListV2Row+ thread={thread}+ variant={item.item.variant}+ showSettledDivider={item.item.showSettledDivider}+ project={projectByKey.get(scopeKey) ?? null}+ providerDriver={+ serverConfigs+ .get(thread.environmentId)+ ?.providers.find(+ (provider) =>+ provider.instanceId ===+ (thread.session?.providerInstanceId ?? thread.modelSelection.instanceId),+ )?.driver ?? null+ }+ environmentLabel={+ Object.keys(savedConnectionsById).length > 1+ ? (savedConnectionsById[thread.environmentId]?.environmentLabel ?? null)+ : null+ }+ pane="sidebar"+ selected={+ scopedThreadKey(thread.environmentId, thread.id) === props.selectedThreadKey+ }+ fullSwipeWidth={props.width - 20}+ onSelectThread={handleSelectThread}+ onDeleteThread={confirmDeleteThread}+ onArchiveThread={archiveThread}+ settlementSupported={settlementEnvironmentIds.has(thread.environmentId)}+ onSettleThread={settleThread}+ onUnsettleThread={unsettleThread}+ onChangeRequestState={handleChangeRequestState}+ projectCwd={projectCwdByKey.get(scopeKey) ?? null}+ onSwipeableClose={handleSwipeableClose}+ onSwipeableWillOpen={handleSwipeableWillOpen}+ simultaneousSwipeGesture={sidebarScrollGesture}+ />+ );+ }+ case "v2-show-more":+ return (+ <Pressable+ accessibilityRole="button"+ accessibilityLabel={`Show ${Math.min(item.hiddenCount, THREAD_LIST_V2_SETTLED_PAGE_COUNT)} more settled threads`}+ onPress={showMoreSettled}+ className="mx-4 mt-2 items-center rounded-lg border border-dashed border-border py-2.5"+ style={({ pressed }) => ({ opacity: pressed ? 0.6 : 1 })}+ >+ <Text className="text-xs font-t3-medium text-foreground-muted">+ Show more ({item.hiddenCount} settled hidden)+ </Text>+ </Pressable>+ );case "header":return (<ThreadListGroupHeader@@ -478,42 +861,61 @@ function ThreadNavigationSidebarPane(archiveThread,confirmDeletePendingTask,confirmDeleteThread,+ handleChangeRequestState,handleSelectThread,handleSwipeableClose,handleSwipeableWillOpen,openPendingTask,+ projectByKey,projectCwdByKey,props.onNewThreadInProject,props.selectedThreadKey,props.width,savedConnectionsById,+ serverConfigs,+ settleThread,+ settlementEnvironmentIds,+ showMoreSettled,sidebarScrollGesture,+ unsettleThread,updateGroupDisplay,],);- const filterIcon = hasCustomHomeListOptions(options)+ // v2 ignores the sort/group options, so only the environment filter can+ // light the "customized" state while the beta is on.+ const filterCustomized = threadListV2Enabled+ ? options.selectedEnvironmentId !== null || selectedProjectKey !== null+ : hasCustomHomeListOptions({ ...options, selectedProjectKey });+ const filterIcon = filterCustomized? "line.3.horizontal.decrease.circle.fill": "line.3.horizontal.decrease.circle";const filterMenu = useMemo(() =>buildHomeListFilterMenu({environments,+ projects: projectFilterOptions,selectedEnvironmentId: options.selectedEnvironmentId,+ selectedProjectKey,projectSortOrder: options.projectSortOrder,threadSortOrder: options.threadSortOrder,projectGroupingMode: options.projectGroupingMode,onEnvironmentChange: setSelectedEnvironmentId,+ onProjectChange: setSelectedProjectKey,onProjectSortOrderChange: setProjectSortOrder,onThreadSortOrderChange: setThreadSortOrder,onProjectGroupingModeChange: setProjectGroupingMode,+ listOrganization: !threadListV2Enabled,}),[environments,options,+ projectFilterOptions,+ selectedProjectKey,setProjectGroupingMode,setProjectSortOrder,setSelectedEnvironmentId,setThreadSortOrder,+ threadListV2Enabled,],);const nativeHeaderItems = useMemo(@@ -531,7 +933,9 @@ function ThreadNavigationSidebarPane(? "Loading threads…": props.searchQuery.trim().length > 0? "No matching threads"- : "No threads yet"}+ : selectedProject !== null+ ? `No threads in ${selectedProject.title}`+ : "No threads yet"}</Text>);@@ -539,6 +943,7 @@ function ThreadNavigationSidebarPane(return (<><NativeStackScreenOptions+ optionsVersion={nativeHeaderItems}options={{headerSearchBarOptions: {ref: searchBarRef,@@ -564,12 +969,12 @@ function ThreadNavigationSidebarPane(<SwipeableScrollGateProvider enabled={swipeEnabled}><GestureDetector gesture={sidebarScrollGesture}><LegendList- data={listLayout.items}+ data={listItems}drawDistance={500}estimatedItemSize={64}extraData={listExtraData}getItemType={(item) => item.type}- itemsAreEqual={homeListItemsAreEqual}+ itemsAreEqual={sidebarItemsAreEqual}keyExtractor={(item) => item.key}renderItem={renderListItem}automaticallyAdjustsScrollIndicatorInsets={NATIVE_LIQUID_GLASS_SUPPORTED}@@ -625,12 +1030,12 @@ function ThreadNavigationSidebarPane(<SwipeableScrollGateProvider enabled={swipeEnabled}><GestureDetector gesture={sidebarScrollGesture}><LegendList- data={listLayout.items}+ data={listItems}drawDistance={500}estimatedItemSize={64}extraData={listExtraData}getItemType={(item) => item.type}- itemsAreEqual={homeListItemsAreEqual}+ itemsAreEqual={sidebarItemsAreEqual}keyExtractor={(item) => item.key}renderItem={renderListItem}contentContainerStyle={[diff --git a/apps/mobile/src/features/threads/thread-list-v2-items.tsx b/apps/mobile/src/features/threads/thread-list-v2-items.tsxindex 9dd41f3cd..63eb9a4d9 100644--- a/apps/mobile/src/features/threads/thread-list-v2-items.tsx+++ b/apps/mobile/src/features/threads/thread-list-v2-items.tsx@@ -19,8 +19,10 @@ import { ThreadSwipeable } from "../home/thread-swipe-actions";import { resolveThreadListV2Status, type ThreadListV2Status } from "./threadListV2";/**- * Thread List v2 rows mirror the web sidebar's compact tonal cards and- * receded settled tail while retaining native swipe and long-press actions.+ * Thread List v2 renders one flat native list: rich edge-to-edge rows for+ * active work and a receded settled tail, all with native swipe and+ * long-press actions. State reads through colored status labels and text+ * hierarchy rather than card fills.*/const MONO_FONT = Platform.select({@@ -29,12 +31,15 @@ const MONO_FONT = Platform.select({default: "monospace",});+// Status hues follow the system-wide convention set by sidebar v1 and the+// Live Activity/widgets (amber approval, indigo input, sky working) so a+// thread reads the same color everywhere it surfaces.const STATUS_LABEL_BY_STATUS: Partial<Record<ThreadListV2Status, { label: string; className: string }>> = {approval: { label: "Approval", className: "text-amber-700 dark:text-amber-300" },- input: { label: "Input", className: "text-amber-700 dark:text-amber-300" },- working: { label: "Working", className: "text-blue-600 dark:text-blue-400" },+ input: { label: "Input", className: "text-indigo-600 dark:text-indigo-300" },+ working: { label: "Working", className: "text-sky-600 dark:text-sky-400" },failed: { label: "Failed", className: "text-red-700 dark:text-red-300" },};@@ -60,10 +65,20 @@ const LEGACY_MENU_ACTIONS: MenuAction[] = [{ id: "delete", title: "Delete", image: "trash", attributes: { destructive: true } },];-export const ThreadListV2SettledDivider = memo(function ThreadListV2SettledDivider() {+/** Rounded-row radius shared with the v1 sidebar rows. */+const SIDEBAR_V2_ROW_RADIUS = 12;++export const ThreadListV2SettledDivider = memo(function ThreadListV2SettledDivider(props: {+ readonly pane?: "screen" | "sidebar";+}) {const borderColor = useThemeColor("--color-border");return (- <View className="mb-1.5 mt-4 flex-row items-center gap-2.5 px-5">+ <View+ className={cn(+ "mb-1.5 mt-4 flex-row items-center gap-2.5",+ props.pane === "sidebar" ? "px-3" : "px-5",+ )}+ ><Text className="text-xs font-t3-medium text-foreground-tertiary">Settled</Text><View className="h-px flex-1" style={{ backgroundColor: borderColor }} /></View>@@ -76,6 +91,22 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {readonly showSettledDivider: boolean;readonly project: EnvironmentProject | null;readonly providerDriver: string | null;+ /** Which machine hosts the thread. Null when only one environment is+ connected — repeating the same label on every row is noise. Mirrors+ the web sidebar's remote-environment cloud icon, but as text since+ phones have no hover tooltips. */+ readonly environmentLabel: string | null;+ /** Hosting surface. "screen" (default) renders the compact Home idiom:+ flat edge-to-edge rows on the screen background with inset hairlines.+ "sidebar" renders the iPad split-view idiom: rounded rows blending+ into the drawer surface, selection filled with the accent color —+ matching the v1 sidebar rows. */+ readonly pane?: "screen" | "sidebar";+ /** Highlights the thread open in the detail pane (iPad split view). The+ compact Home list never sets it — phones navigate away on select. */+ readonly selected?: boolean;+ /** Override for narrow panes (iPad sidebar); defaults to window width. */+ readonly fullSwipeWidth?: number;readonly onSelectThread: (thread: EnvironmentThreadShell) => void;readonly onDeleteThread: (thread: EnvironmentThreadShell) => void;readonly onSettleThread: (thread: EnvironmentThreadShell) => void;@@ -117,6 +148,11 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {}, [onChangeRequestState, prState, threadKey]);const screenColor = useThemeColor("--color-screen");+ const drawerColor = useThemeColor("--color-drawer");+ const pressedBackgroundColor = useThemeColor("--color-subtle");+ const selectedBackgroundColor = useThemeColor("--color-user-bubble");+ const sidebarPane = props.pane === "sidebar";+ const selected = props.selected === true;const status = resolveThreadListV2Status(thread);const statusLabel = STATUS_LABEL_BY_STATUS[status];@@ -174,99 +210,184 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {thread.title,]);+ // The sidebar pane fills selected rows with the accent color (matching the+ // v1 sidebar), so every piece of row text needs a white-on-accent variant.+ const cardContent = (+ <>+ <View className="flex-row items-center gap-1.5">+ {props.project ? (+ <ProjectFavicon+ environmentId={thread.environmentId}+ size={15}+ projectTitle={props.project.title}+ workspaceRoot={props.project.workspaceRoot}+ />+ ) : null}+ <Text+ className={cn(+ "flex-1 text-sm font-t3-medium",+ selected ? "text-user-bubble-foreground-muted" : "text-foreground-muted",+ )}+ numberOfLines={1}+ >+ {props.project?.title ?? ""}+ </Text>+ <Text+ className={cn(+ "text-xs tabular-nums",+ selected ? "text-white" : (statusLabel?.className ?? "text-foreground-tertiary"),+ )}+ >+ {statusLabel?.label ?? timeLabel}+ </Text>+ </View>+ <Text+ className={cn(+ "mt-1 text-base font-t3-medium",+ selected ? "text-user-bubble-foreground" : "text-foreground",+ )}+ numberOfLines={2}+ >+ {thread.title}+ </Text>+ <View className="mt-1 flex-row items-center gap-2">+ {status === "failed" && thread.session?.lastError ? (+ <Text+ className={cn(+ "flex-1 text-xs",+ selected+ ? "text-user-bubble-foreground-muted"+ : "text-red-600/80 dark:text-red-400/80",+ )}+ numberOfLines={1}+ >+ {thread.session.lastError}+ </Text>+ ) : thread.branch || props.environmentLabel ? (+ /* "branch · machine" share one truncating line. The machine sits+ last so a tight fit cuts the repetitive label, not the branch —+ and machine-only fills the row for non-git projects. */+ <Text+ className={cn(+ "flex-1 text-xs",+ selected ? "text-user-bubble-foreground-muted" : "text-foreground-muted",+ )}+ numberOfLines={1}+ >+ {thread.branch ? (+ <Text+ className={cn(+ "text-xs",+ selected ? "text-user-bubble-foreground-muted" : "text-foreground-muted",+ )}+ style={{ fontFamily: MONO_FONT }}+ >+ {thread.branch}+ </Text>+ ) : null}+ {thread.branch && props.environmentLabel ? " · " : null}+ {props.environmentLabel ? (+ <Text+ className={cn(+ "text-xs",+ selected ? "text-user-bubble-foreground-muted" : "text-foreground-tertiary",+ )}+ >+ {props.environmentLabel}+ </Text>+ ) : null}+ </Text>+ ) : (+ <View className="flex-1" />+ )}+ {pr ? (+ <Text+ accessibilityLabel={pr.accessibilityLabel}+ className={cn("text-xs", selected ? "text-white" : pr.textClassName)}+ style={{ fontFamily: MONO_FONT }}+ >+ #{pr.label}+ </Text>+ ) : null}+ {props.providerDriver ? (+ <View className="opacity-60">+ <ProviderIcon provider={props.providerDriver} size={14} />+ </View>+ ) : null}+ </View>+ </>+ );+const rowContent = (close: () => void) =>variant === "card" ? (<PressableaccessibilityHint={`Opens the thread. Swipe left to ${primaryAction.label.toLowerCase()}.`}accessibilityLabel={thread.title}accessibilityRole="button"+ accessibilityState={{ selected }}onPress={() => {close();onSelectThread(thread);}}- style={({ pressed }) => ({ opacity: pressed ? 0.7 : 1 })}+ style={+ sidebarPane+ ? ({ pressed }) => ({+ backgroundColor: selected+ ? selectedBackgroundColor+ : pressed+ ? pressedBackgroundColor+ : drawerColor,+ borderRadius: SIDEBAR_V2_ROW_RADIUS,+ paddingHorizontal: 12,+ paddingVertical: 10,+ })+ : ({ pressed }) => ({ opacity: pressed ? 0.7 : 1 })+ }>- <View className="bg-screen px-4 py-1">- <View- className={cn(- "overflow-hidden",- status === "ready"- ? "bg-black/[0.025] dark:bg-white/[0.025]"- : "bg-black/[0.04] dark:bg-white/[0.04]",- )}- style={{ borderRadius: 12, borderCurve: "continuous", minHeight: 84 }}- >- <View className="px-3 py-2.5">- <View className="flex-row items-center gap-1.5">- {props.project ? (- <ProjectFavicon- environmentId={thread.environmentId}- size={15}- projectTitle={props.project.title}- workspaceRoot={props.project.workspaceRoot}- />- ) : null}- <Text- className="flex-1 text-sm font-t3-medium text-foreground-muted"- numberOfLines={1}- >- {props.project?.title ?? ""}- </Text>- <Text- className={cn(- "text-xs tabular-nums",- statusLabel?.className ?? "text-foreground-tertiary",- )}- >- {statusLabel?.label ?? timeLabel}- </Text>- </View>- <Text className="mt-1 text-base font-t3-medium text-foreground" numberOfLines={2}>- {thread.title}- </Text>- <View className="mt-1 flex-row items-center gap-2">- {status === "failed" && thread.session?.lastError ? (- <Text- className="flex-1 text-xs text-red-600/80 dark:text-red-400/80"- numberOfLines={1}- >- {thread.session.lastError}- </Text>- ) : thread.branch ? (- <Text- className="flex-1 text-xs text-foreground-muted"- numberOfLines={1}- style={{ fontFamily: MONO_FONT }}- >- {thread.branch}- </Text>- ) : (- <View className="flex-1" />- )}- {props.providerDriver ? (- <View className="opacity-60">- <ProviderIcon provider={props.providerDriver} size={14} />- </View>- ) : null}- </View>- </View>+ {sidebarPane ? (+ cardContent+ ) : (+ /* Flat native list rows: no tonal containers — colored status+ labels and text hierarchy carry state, an inset hairline+ separates rows. The opaque screen background stays so swipe+ actions reveal behind the row. */+ <View className="bg-screen">+ <View className="px-5 py-2.5">{cardContent}</View>+ <View className="ml-5 h-px bg-border-subtle" /></View>- </View>+ )}</Pressable>) : (<PressableaccessibilityHint={`Opens the thread. Swipe left to ${primaryAction.label.toLowerCase()}.`}accessibilityLabel={thread.title}accessibilityRole="button"- className="bg-screen"+ accessibilityState={{ selected }}+ className={sidebarPane ? undefined : "bg-screen"}onPress={() => {close();onSelectThread(thread);}}- style={({ pressed }) => ({ opacity: pressed ? 0.7 : 1 })}+ style={+ sidebarPane+ ? ({ pressed }) => ({+ backgroundColor: selected+ ? selectedBackgroundColor+ : pressed+ ? pressedBackgroundColor+ : drawerColor,+ borderRadius: SIDEBAR_V2_ROW_RADIUS,+ })+ : ({ pressed }) => ({ opacity: pressed ? 0.7 : 1 })+ }>{/* Settled history recedes: dimmed favicon + muted title. */}- <View className="min-h-[44px] flex-row items-center gap-2.5 px-5 py-2">+ <View+ className={cn(+ "min-h-[44px] flex-row items-center gap-2.5 py-2",+ sidebarPane ? "px-3" : "px-5",+ )}+ >{props.project ? (<View className="opacity-40"><ProjectFavicon@@ -277,11 +398,20 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {/></View>) : null}- <Text className="flex-1 text-base text-foreground-muted" numberOfLines={1}>+ <Text+ className={cn(+ "flex-1 text-base",+ selected ? "text-user-bubble-foreground" : "text-foreground-muted",+ )}+ numberOfLines={1}+ >{thread.title}</Text><Text- className="text-sm tabular-nums text-foreground-tertiary"+ className={cn(+ "text-sm tabular-nums",+ selected ? "text-user-bubble-foreground-muted" : "text-foreground-tertiary",+ )}style={{ fontFamily: MONO_FONT }}>{relativeTime(thread.latestUserMessageAt ?? thread.updatedAt ?? thread.createdAt)}@@ -292,14 +422,18 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {return (<>- {props.showSettledDivider ? <ThreadListV2SettledDivider /> : null}+ {props.showSettledDivider ? <ThreadListV2SettledDivider pane={props.pane} /> : null}<ThreadSwipeable- backgroundColor={screenColor}+ backgroundColor={sidebarPane ? drawerColor : screenColor}+ compactActions={variant === "slim"}+ containerStyle={+ sidebarPane ? { borderRadius: SIDEBAR_V2_ROW_RADIUS, overflow: "hidden" } : undefined+ }enableTrackpadSwipe// Full swipe commits the advertised lifecycle action (Settle /// Un-settle), never the destructive delete.fullSwipeAction="primary"- fullSwipeWidth={windowWidth - 32}+ fullSwipeWidth={props.fullSwipeWidth ?? windowWidth - 32}onDelete={handleDelete}onSwipeableClose={props.onSwipeableClose}onSwipeableWillOpen={props.onSwipeableWillOpen}diff --git a/apps/mobile/src/features/threads/threadListV2.ts b/apps/mobile/src/features/threads/threadListV2.tsindex 2a1df1830..a1604bafa 100644--- a/apps/mobile/src/features/threads/threadListV2.ts+++ b/apps/mobile/src/features/threads/threadListV2.ts@@ -12,6 +12,12 @@ import type { EnvironmentId, ProjectId } from "@t3tools/contracts";*/export type ThreadListV2Status = "approval" | "input" | "working" | "failed" | "ready";+// Settled-tail paging: recent history is the common lookup; the deep tail+// stays behind an explicit Show more. Shared by the compact Home list and+// the iPad sidebar so both page identically.+export const THREAD_LIST_V2_SETTLED_INITIAL_COUNT = 10;+export const THREAD_LIST_V2_SETTLED_PAGE_COUNT = 25;+export function resolveThreadListV2Status(thread: Pick<EnvironmentThreadShell, "hasPendingApprovals" | "hasPendingUserInput" | "session">,): ThreadListV2Status {diff --git a/apps/mobile/src/native/StackHeader.tsx b/apps/mobile/src/native/StackHeader.tsxindex 8a8c355b7..78c871195 100644--- a/apps/mobile/src/native/StackHeader.tsx+++ b/apps/mobile/src/native/StackHeader.tsx@@ -142,6 +142,13 @@ function stabilizeOptionFunctions(export function NativeStackScreenOptions(props: {readonly options?: AppNativeStackNavigationOptions;+ /**+ * Causes dynamic native header factories to be reapplied when their closed-over+ * menu content changes. Factory functions are intentionally stabilized, so+ * their source alone cannot capture a menu that was initially empty while+ * asynchronous data was loading.+ */+ readonly optionsVersion?: unknown;readonly listeners?: Record<string, (event: never) => void>;readonly name?: string;}) {@@ -163,7 +170,7 @@ export function NativeStackScreenOptions(props: {if (!navigation || !stableOptions) {return;}- const signature = optionsSignature(stableOptions);+ const signature = optionsSignature([stableOptions, props.optionsVersion]);// Avoid re-entering navigation state when semantically equal options are// reapplied every layout (common when callers pass unstable object literals).if (lastAppliedOptionsSignatureRef.current === signature) {@@ -171,7 +178,7 @@ export function NativeStackScreenOptions(props: {}lastAppliedOptionsSignatureRef.current = signature;navigation.setOptions(stableOptions);- }, [navigation, stableOptions]);+ }, [navigation, props.optionsVersion, stableOptions]);useEffect(() => {if (!navigation || !props.listeners) {diff --git a/apps/web/src/components/AppSidebarLayout.tsx b/apps/web/src/components/AppSidebarLayout.tsxindex 8a713fd90..ef6b64be9 100644--- a/apps/web/src/components/AppSidebarLayout.tsx+++ b/apps/web/src/components/AppSidebarLayout.tsx@@ -84,7 +84,7 @@ function SidebarControl() {"pointer-events-auto",isSidebarVisible &&stageBackdropVariant &&- "hover:bg-white/15 [&_svg]:text-white/85! [&_svg]:hover:text-white!",+ "[:hover,[data-pressed]]:bg-white/15 focus-visible:ring-white/90 focus-visible:ring-offset-blue-700 [&_svg]:stroke-white/90! [&_svg]:opacity-100! [&_svg]:hover:stroke-white!",)}aria-label="Toggle main sidebar"/>@@ -164,10 +164,9 @@ export function AppSidebarLayout({ children }: { children: ReactNode }) {<Sidebarside="left"collapsible="offcanvas"- className={cn(- "border-r border-border text-foreground",- useSidebarV2 ? "app-sidebar" : "bg-card",- )}+ data-app-sidebar=""+ data-sidebar-version={useSidebarV2 ? "v2" : "v1"}+ className="border-r border-sidebar-border bg-sidebar text-sidebar-foreground"resizable={{maxWidth: sidebarMaximumWidth,minWidth: THREAD_SIDEBAR_MIN_WIDTH,diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsxindex 1e5e1ee2a..8b0fe01bd 100644--- a/apps/web/src/components/ChatView.tsx+++ b/apps/web/src/components/ChatView.tsx@@ -5470,6 +5470,7 @@ function ChatViewContent(props: ChatViewProps) {)}><div+ data-terminal-open={terminalUiState.terminalOpen ? "true" : undefined}className={cn("chat-composer-lower-chrome relative z-10",isGitRepodiff --git a/apps/web/src/components/CommandPalette.logic.test.ts b/apps/web/src/components/CommandPalette.logic.test.tsindex 6609017f9..902b7e877 100644--- a/apps/web/src/components/CommandPalette.logic.test.ts+++ b/apps/web/src/components/CommandPalette.logic.test.ts@@ -3,10 +3,38 @@ import { EnvironmentId, ProjectId, ProviderInstanceId, ThreadId } from "@t3toolsimport type { Thread } from "../types";import {buildThreadActionItems,+ enumerateCommandPaletteItems,filterCommandPaletteGroups,type CommandPaletteGroup,} from "./CommandPalette.logic";+describe("enumerateCommandPaletteItems", () => {+ it("assigns positional jump shortcuts to the first nine displayed items", () => {+ const items = Array.from({ length: 10 }, (_, index) => ({+ kind: "action" as const,+ value: `project-${index + 1}`,+ searchTerms: [],+ title: `Project ${index + 1}`,+ icon: null,+ shortcutCommand: "chat.new" as const,+ run: async () => undefined,+ }));++ expect(enumerateCommandPaletteItems(items).map((item) => item.shortcutCommand)).toEqual([+ "thread.jump.1",+ "thread.jump.2",+ "thread.jump.3",+ "thread.jump.4",+ "thread.jump.5",+ "thread.jump.6",+ "thread.jump.7",+ "thread.jump.8",+ "thread.jump.9",+ undefined,+ ]);+ });+});+const LOCAL_ENVIRONMENT_ID = EnvironmentId.make("environment-local");const PROJECT_ID = ProjectId.make("project-1");diff --git a/apps/web/src/components/CommandPalette.logic.ts b/apps/web/src/components/CommandPalette.logic.tsindex ab53adbef..a217d53b5 100644--- a/apps/web/src/components/CommandPalette.logic.ts+++ b/apps/web/src/components/CommandPalette.logic.ts@@ -1,4 +1,8 @@-import { type KeybindingCommand, type FilesystemBrowseEntry } from "@t3tools/contracts";+import {+ type KeybindingCommand,+ type FilesystemBrowseEntry,+ THREAD_JUMP_KEYBINDING_COMMANDS,+} from "@t3tools/contracts";import type { SidebarThreadSortOrder } from "@t3tools/contracts/settings";import * as Arr from "effect/Array";import * as Result from "effect/Result";@@ -52,6 +56,18 @@ export interface CommandPaletteView {readonly initialQuery?: string;}+export function enumerateCommandPaletteItems(+ items: ReadonlyArray<CommandPaletteActionItem>,+): CommandPaletteActionItem[] {+ return items.map((item, index) => {+ const shortcutCommand = THREAD_JUMP_KEYBINDING_COMMANDS[index];+ if (shortcutCommand) return { ...item, shortcutCommand };++ const { shortcutCommand: _shortcutCommand, ...itemWithoutShortcut } = item;+ return itemWithoutShortcut;+ });+}+export type CommandPaletteMode = "root" | "root-browse" | "submenu" | "submenu-browse";export function filterBrowseEntries(input: {diff --git a/apps/web/src/components/CommandPalette.tsx b/apps/web/src/components/CommandPalette.tsxindex 8c7e6d287..bb83dfa56 100644--- a/apps/web/src/components/CommandPalette.tsx+++ b/apps/web/src/components/CommandPalette.tsx@@ -95,6 +95,7 @@ import {buildProjectActionItems,buildRootGroups,buildThreadActionItems,+ enumerateCommandPaletteItems,type CommandPaletteActionItem,type CommandPaletteSubmenuItem,type CommandPaletteView,@@ -112,7 +113,7 @@ import { ProjectFavicon } from "./ProjectFavicon";import { ThreadRowLeadingStatus, ThreadRowTrailingStatus } from "./ThreadStatusIndicators";import { primaryServerKeybindingsAtom, primaryServerProvidersAtom } from "../state/server";import { resolveDefaultProviderModelSelection } from "../providerInstances";-import { resolveShortcutCommand } from "../keybindings";+import { resolveShortcutCommand, threadJumpIndexFromCommand } from "../keybindings";import {Command,CommandDialog,@@ -686,29 +687,30 @@ function OpenCommandPaletteDialog(props: {const projectThreadItems = useMemo(() =>- buildProjectActionItems({- projects,- valuePrefix: "new-thread-in",- shortcutCommand: "chat.new",- icon: (project) => (- <ProjectFavicon- environmentId={project.environmentId}- cwd={project.workspaceRoot}- className={ITEM_ICON_CLASS}- />- ),- runProject: async (project) => {- await startNewThreadInProjectFromContext(- {- activeDraftThread,- activeThread: activeThread ?? undefined,- defaultProjectRef,- handleNewThread,- },- scopeProjectRef(project.environmentId, project.id),- );- },- }),+ enumerateCommandPaletteItems(+ buildProjectActionItems({+ projects,+ valuePrefix: "new-thread-in",+ icon: (project) => (+ <ProjectFavicon+ environmentId={project.environmentId}+ cwd={project.workspaceRoot}+ className={ITEM_ICON_CLASS}+ />+ ),+ runProject: async (project) => {+ await startNewThreadInProjectFromContext(+ {+ activeDraftThread,+ activeThread: activeThread ?? undefined,+ defaultProjectRef,+ handleNewThread,+ },+ scopeProjectRef(project.environmentId, project.id),+ );+ },+ }),+ ),[activeDraftThread, activeThread, defaultProjectRef, handleNewThread, projects],);@@ -997,7 +999,13 @@ function OpenCommandPaletteDialog(props: {: projectThreadItems;pushPaletteView({addonIcon: <SquarePenIcon className={ADDON_ICON_CLASS} />,- groups: [{ value: "projects", label: "Projects", items: prioritized }],+ groups: [+ {+ value: "projects",+ label: "Projects",+ items: enumerateCommandPaletteItems(prioritized),+ },+ ],});}, [clearOpenIntent,@@ -1545,6 +1553,22 @@ function OpenCommandPaletteDialog(props: {}function handleKeyDown(event: KeyboardEvent<HTMLInputElement>): void {+ const command = resolveShortcutCommand(event, keybindings, {+ platform: navigator.platform,+ context: { modelPickerOpen: false },+ });+ if (threadJumpIndexFromCommand(command ?? "") !== null) {+ const matchingItem = displayedGroups+ .flatMap((group) => group.items)+ .find((item) => item.shortcutCommand === command);+ if (matchingItem) {+ event.preventDefault();+ event.stopPropagation();+ executeItem(matchingItem);+ return;+ }+ }+if (addProjectCloneFlow?.step === "repository" && event.key === "Enter") {event.preventDefault();void submitAddProjectCloneFlow();@@ -1855,7 +1879,7 @@ function OpenCommandPaletteDialog(props: {<span className="truncate text-foreground text-sm">{remoteProjectContext.title}</span>- <span className="truncate text-muted-foreground/70 text-xs">+ <span className="truncate text-muted-foreground/85 text-xs">{remoteProjectContext.description}</span></span>@@ -1896,37 +1920,35 @@ function OpenCommandPaletteDialog(props: {<Kbd><ArrowDownIcon /></Kbd>- <span className={cn("text-muted-foreground/80")}>Navigate</span>+ <span>Navigate</span></KbdGroup>{addProjectCloneFlow?.step === "repository" ? (<KbdGroup className="items-center gap-1.5"><Kbd>Enter</Kbd>- <span className={cn("text-muted-foreground/80")}>- {remoteProjectButtonLabel ?? "Continue"}- </span>+ <span>{remoteProjectButtonLabel ?? "Continue"}</span></KbdGroup>) : !canSubmitBrowsePath || hasHighlightedBrowseItem ? (<KbdGroup className="items-center gap-1.5"><Kbd>Enter</Kbd>- <span className={cn("text-muted-foreground/80")}>Select</span>+ <span>Select</span></KbdGroup>) : null}{isSubmenu ? (<KbdGroup className="items-center gap-1.5"><Kbd>Backspace</Kbd>- <span className={cn("text-muted-foreground/80")}>Back</span>+ <span>Back</span></KbdGroup>) : null}<KbdGroup className="items-center gap-1.5"><Kbd>Esc</Kbd>- <span className={cn("text-muted-foreground/80")}>Close</span>+ <span>Close</span></KbdGroup></div>{canOpenProjectFromFileManager ? (<Buttonvariant="ghost"size="xs"- className="h-auto px-2 text-xs text-muted-foreground/80 hover:bg-transparent hover:text-foreground"+ className="h-auto px-2 text-zinc-700 text-xs hover:bg-transparent hover:text-foreground dark:text-zinc-300"disabled={isPickingProjectFolder}onClick={() => {void handleOpenProjectFromFileManager();diff --git a/apps/web/src/components/CommandPaletteResults.tsx b/apps/web/src/components/CommandPaletteResults.tsxindex 4ad08db08..d4d31af36 100644--- a/apps/web/src/components/CommandPaletteResults.tsx+++ b/apps/web/src/components/CommandPaletteResults.tsx@@ -75,7 +75,7 @@ function DisabledCommandPaletteResultRow(props: {{props.item.titleLeadingContent}<span className="truncate">{props.item.title}</span></span>- <span className="truncate text-muted-foreground/70 text-xs">+ <span className="truncate text-muted-foreground/85 text-xs">{props.item.description}</span></span>@@ -121,7 +121,7 @@ function CommandPaletteResultRow(props: {{props.item.titleLeadingContent}<span className="truncate">{props.item.title}</span></span>- <span className="truncate text-muted-foreground/70 text-xs">+ <span className="truncate text-muted-foreground/85 text-xs">{props.item.description}</span></span>diff --git a/apps/web/src/components/RightPanelTabs.tsx b/apps/web/src/components/RightPanelTabs.tsxindex f5bc9880d..83524009c 100644--- a/apps/web/src/components/RightPanelTabs.tsx+++ b/apps/web/src/components/RightPanelTabs.tsx@@ -157,7 +157,7 @@ function RightPanelEmptyState(props: {key={action.label}type="button"onClick={action.onClick}- className="flex min-h-28 w-full flex-col items-start rounded-lg border border-border/80 bg-card/40 p-4 text-left transition hover:border-border hover:bg-accent/60"+ className="flex min-h-28 w-full flex-col items-start rounded-lg border border-border/80 bg-card p-4 text-left transition hover:border-border hover:bg-accent/60 dark:border-transparent dark:shadow-none dark:inset-ring-1 dark:inset-ring-white/5">{content}</button>@@ -166,7 +166,7 @@ function RightPanelEmptyState(props: {const disabledCard = (<buttontype="button"- className="flex min-h-28 w-full cursor-not-allowed flex-col items-start rounded-lg border border-border/80 bg-card/40 p-4 text-left opacity-40"+ className="flex min-h-28 w-full cursor-not-allowed flex-col items-start rounded-lg border border-border/80 bg-card p-4 text-left opacity-40 dark:border-transparent dark:shadow-none dark:inset-ring-1 dark:inset-ring-white/5"aria-disabled="true">{content}diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsxindex d3e3f836c..fabedfc80 100644--- a/apps/web/src/components/Sidebar.tsx+++ b/apps/web/src/components/Sidebar.tsx@@ -2245,7 +2245,7 @@ const SidebarProjectItem = memo(function SidebarProjectItem(props: SidebarProjec<SidebarMenuButtonref={isManualProjectSorting ? dragHandleProps?.setActivatorNodeRef : undefined}size="sm"- className={`gap-2 px-2 py-1.5 pr-8 text-left hover:bg-accent group-hover/project-header:bg-accent group-hover/project-header:text-sidebar-accent-foreground max-sm:pr-14 ${+ className={`gap-2 px-2 py-1.5 pr-8 text-left hover:bg-sidebar-row-hover group-hover/project-header:bg-sidebar-row-hover group-hover/project-header:text-sidebar-foreground max-sm:pr-14 ${isManualProjectSorting ? "cursor-grab active:cursor-grabbing" : "cursor-pointer"}`}{...(isManualProjectSorting && dragHandleProps ? dragHandleProps.attributes : {})}diff --git a/apps/web/src/components/SidebarV2.tsx b/apps/web/src/components/SidebarV2.tsxindex 32b3ae5e1..9bc87eed6 100644--- a/apps/web/src/components/SidebarV2.tsx+++ b/apps/web/src/components/SidebarV2.tsx@@ -10,13 +10,17 @@ import {import type { ScopedThreadRef } from "@t3tools/contracts";import {CheckIcon,+ ChevronDownIcon,CircleCheckIcon,CircleDashedIcon,- CloudIcon,+ CircleAlertIcon,+ FolderIcon,FolderPlusIcon,+ GitBranchIcon,MessageSquareIcon,PlusIcon,SearchIcon,+ ServerIcon,SquarePenIcon,Undo2Icon,} from "lucide-react";@@ -82,22 +86,22 @@ import {import { prStatusIndicator, resolveThreadPr } from "./ThreadStatusIndicators";import { ProjectFavicon } from "./ProjectFavicon";import { ProviderInstanceIcon } from "./chat/ProviderInstanceIcon";+import { getTriggerDisplayModelLabel } from "./chat/providerIconUtils";import { deriveProviderInstanceEntries, type ProviderInstanceEntry } from "../providerInstances";import { primaryServerProvidersAtom } from "../state/server";import { stackedThreadToast, toastManager } from "./ui/toast";import { CommandDialogTrigger } from "./ui/command";import { Kbd } from "./ui/kbd";+import { Menu, MenuPopup, MenuRadioGroup, MenuRadioItem, MenuTrigger } from "./ui/menu";import {SidebarContent,SidebarGroup,- SidebarMenu,SidebarMenuButton,- SidebarMenuItem,SidebarSeparator,useSidebar,} from "./ui/sidebar";import { SidebarChromeFooter, SidebarChromeHeader } from "./sidebar/SidebarChrome";-import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip";+import { Tooltip, TooltipPopup, TooltipProvider, TooltipTrigger } from "./ui/tooltip";// Settled-tail paging: recent history is the common lookup; the deep tail// stays behind an explicit Show more.@@ -114,6 +118,110 @@ function threadTimeLabel(thread: SidebarThreadSummary): string {return compactSidebarTimeLabel(formatRelativeTimeLabel(timestamp));}+function SidebarV2ThreadTooltip({+ thread,+ projectTitle,+ projectCwd,+ environmentLabel,+ driverKind,+ modelInstanceId,+ modelLabel,+ status,+}: {+ thread: SidebarThreadSummary;+ projectTitle: string | null;+ projectCwd: string | null;+ environmentLabel: string | null;+ driverKind: ProviderInstanceEntry["driverKind"] | null;+ modelInstanceId: string;+ modelLabel: string;+ status: {+ label: string;+ className: string;+ icon: "working" | "done" | null;+ } | null;+}) {+ return (+ <TooltipPopup+ side="right"+ align="start"+ sideOffset={8}+ className="w-80 text-left whitespace-normal shadow-lg/10 dark:border-transparent dark:shadow-none dark:inset-ring-1 dark:inset-ring-white/5"+ >+ <div className="flex w-full flex-col gap-3 p-2">+ <div className="flex min-w-0 items-start gap-3">+ <div className="min-w-0 flex-1 text-sm font-medium text-foreground">{thread.title}</div>+ {status ? (+ <div+ className={cn(+ "inline-flex shrink-0 items-center gap-1 text-xs font-medium",+ status.className,+ )}+ >+ {status.icon === "working" ? (+ <CircleDashedIcon aria-hidden className="size-4 shrink-0" />+ ) : status.icon === "done" ? (+ <CircleCheckIcon aria-hidden className="size-4 shrink-0" />+ ) : null}+ {status.label}+ </div>+ ) : (+ <div className="shrink-0 tabular-nums text-xs text-muted-foreground">+ {threadTimeLabel(thread)}+ </div>+ )}+ </div>+ <div className="grid gap-2 text-xs text-muted-foreground">+ {projectTitle ? (+ <div className="flex min-w-0 items-start gap-2">+ <ProjectFavicon+ environmentId={thread.environmentId}+ cwd={projectCwd ?? ""}+ className="size-4 shrink-0"+ />+ <div className="min-w-0 flex-1 wrap-break-word text-foreground/90">+ {projectTitle}+ </div>+ </div>+ ) : null}+ {environmentLabel ? (+ <div className="flex min-w-0 items-start gap-2">+ <ServerIcon className="size-4 shrink-0 stroke-muted-foreground" />+ <div className="min-w-0 flex-1 wrap-break-word text-foreground/90">+ {environmentLabel}+ </div>+ </div>+ ) : null}+ {thread.branch ? (+ <div className="flex min-w-0 items-start gap-2">+ <GitBranchIcon className="size-4 shrink-0 stroke-muted-foreground" />+ <div className="min-w-0 flex-1 wrap-break-word text-foreground/90">+ {thread.branch}+ </div>+ </div>+ ) : null}+ {driverKind ? (+ <div className="flex min-w-0 items-start gap-2">+ <ProviderInstanceIcon+ driverKind={driverKind}+ displayName={thread.session?.providerName ?? modelInstanceId}+ iconClassName="size-4 shrink-0"+ />+ <div className="min-w-0 flex-1 wrap-break-word text-foreground/90">{modelLabel}</div>+ </div>+ ) : null}+ {thread.session?.lastError ? (+ <div className="flex min-w-0 items-start gap-2 text-red-600 dark:text-red-400">+ <CircleAlertIcon className="size-4 shrink-0 stroke-current" />+ <div className="min-w-0 flex-1 wrap-break-word">{thread.session.lastError}</div>+ </div>+ ) : null}+ </div>+ </div>+ </TooltipPopup>+ );+}+const SidebarV2Row = memo(function SidebarV2Row(props: {thread: SidebarThreadSummary;variant: "card" | "slim";@@ -174,37 +282,40 @@ const SidebarV2Row = memo(function SidebarV2Row(props: {const isUnread = hasUnseenCompletion({ ...thread, lastVisitedAt });const status = resolveSidebarV2Status(thread);const shouldRecede = status === "ready" && !isUnread && !props.isActive && !isSelected;+ // Status hues follow the system-wide convention set by sidebar v1 and the+ // mobile Live Activity/widgets (amber approval, indigo input, sky working)+ // so a thread reads the same color everywhere it surfaces.const topStatus =status === "working"? {label: "Working",icon: "working" as const,className:- "animate-sidebar-working-text font-semibold text-blue-600 motion-reduce:animate-none dark:text-blue-400",+ "animate-sidebar-working-text text-sky-600 motion-reduce:animate-none dark:text-sky-400",}: status === "approval"? {label: "Approval",icon: null,- className: "font-semibold text-amber-700 dark:text-amber-300",+ className: "text-amber-700 dark:text-amber-300",}: status === "input"? {label: "Input",icon: null,- className: "font-semibold text-amber-700 dark:text-amber-300",+ className: "text-indigo-600 dark:text-indigo-300",}: status === "failed"? {label: "Failed",icon: null,- className: "font-semibold text-red-700 dark:text-red-300",+ className: "text-red-700 dark:text-red-300",}: isUnread? {label: "Done",icon: "done" as const,- className: "font-semibold text-emerald-700 dark:text-emerald-300",+ className: "text-emerald-700 dark:text-emerald-300",}: null;@@ -227,11 +338,31 @@ const SidebarV2Row = memo(function SidebarV2Row(props: {}, [onChangeRequestState, prState, threadKey]);const modelInstanceId = thread.session?.providerInstanceId ?? thread.modelSelection.instanceId;- const driverKind = props.providerEntryByInstanceId.get(modelInstanceId)?.driverKind ?? null;+ const providerEntry = props.providerEntryByInstanceId.get(modelInstanceId) ?? null;+ const driverKind = providerEntry?.driverKind ?? null;+ const selectedModel = providerEntry?.models.find(+ (model) => model.slug === thread.modelSelection.model,+ );+ const modelLabel = selectedModel+ ? getTriggerDisplayModelLabel(selectedModel)+ : thread.modelSelection.model;const isRemote =props.currentEnvironmentId !== null && thread.environmentId !== props.currentEnvironmentId;+ const detailsTooltip = (+ <SidebarV2ThreadTooltip+ thread={thread}+ projectTitle={props.projectTitle}+ projectCwd={props.projectCwd}+ environmentLabel={props.environmentLabel}+ driverKind={driverKind}+ modelInstanceId={modelInstanceId}+ modelLabel={modelLabel}+ status={topStatus}+ />+ );+const handleClick = useCallback((event: ReactMouseEvent) => {onThreadClick(event, threadRef);@@ -312,13 +443,19 @@ const SidebarV2Row = memo(function SidebarV2Row(props: {[openPrLink, pr],);- const rowClassName = cn(- "group/v2-row relative w-full cursor-pointer select-none rounded-md text-left",+ // All Sidebar V2 rows share one surface model. Live threads used to look+ // like elevated cards while settled threads were plain rows, leaving neither+ // a useful hierarchy nor a reliable hover cue. Status now lives in the row+ // content; surface is reserved for interaction (hover, multi-select, route).+ const rowSurfaceClassName = cn(+ "group/v2-row relative w-full cursor-pointer overflow-hidden rounded-md text-left outline-none select-none",props.isActive- ? "bg-foreground/[0.11] text-foreground dark:bg-white/[0.11]"+ ? "bg-sidebar-row-active text-sidebar-foreground dark:inset-ring-1 dark:inset-ring-white/5": isSelected- ? "bg-foreground/[0.07] text-foreground dark:bg-white/[0.07]"- : "hover:bg-accent/65",+ ? "bg-sidebar-row-selected text-sidebar-foreground dark:inset-ring-1 dark:inset-ring-white/5"+ : shouldRecede+ ? "text-sidebar-muted-foreground/75 hover:bg-sidebar-row-hover hover:text-sidebar-foreground"+ : "bg-transparent text-sidebar-foreground hover:bg-sidebar-row-hover",);const title = isRenaming ? (@@ -332,30 +469,31 @@ const SidebarV2Row = memo(function SidebarV2Row(props: {onBlur={handleRenameBlur}onClick={(event) => event.stopPropagation()}onDoubleClick={(event) => event.stopPropagation()}- className="min-w-0 flex-1 rounded-sm border border-border bg-background px-1 text-[13px] text-foreground outline-none focus:border-foreground"+ className="min-w-0 flex-1 rounded-sm border border-input bg-card px-1 text-sm font-medium text-card-foreground outline-none focus:border-foreground"/>) : (<spanclassName={cn(- "min-w-0 flex-1 text-[13px] leading-5",+ "min-w-0 flex-1 text-sm",+ shouldRecede ? "font-normal" : "font-medium",variant === "card"? cn(- "line-clamp-2 break-words",+ "truncate",isUnread- ? "font-semibold text-foreground"+ ? "text-foreground": status !== "ready"- ? "font-semibold text-foreground/95"+ ? "text-foreground/95": shouldRecede- ? "font-normal text-muted-foreground/75"- : "font-medium text-foreground/90",+ ? "text-muted-foreground/80"+ : "text-foreground/90",): cn(- "truncate transition-colors group-hover/v2-row:text-foreground",+ "truncate group-hover/v2-row:text-foreground",props.isActive? "text-foreground": isUnread- ? "font-medium text-muted-foreground"- : "text-muted-foreground/60",+ ? "text-muted-foreground"+ : "text-muted-foreground/70",),)}>@@ -369,7 +507,7 @@ const SidebarV2Row = memo(function SidebarV2Row(props: {type="button"onClick={handlePrClick}className={cn(- "shrink-0 font-mono text-[10px] hover:underline",+ "shrink-0 font-mono text-xs hover:underline",variant === "slim" && variantAction === "unsettle"? props.isActive? "text-muted-foreground/70"@@ -388,67 +526,74 @@ const SidebarV2Row = memo(function SidebarV2Row(props: {data-thread-itemclassName="list-none [content-visibility:auto] [contain-intrinsic-size:auto_34px]">- <div- role="button"- tabIndex={0}- data-testid="sidebar-v2-row-slim"- className={cn(rowClassName, "flex h-[34px] items-center gap-2.5 px-2.5")}- onClick={handleClick}- onDoubleClick={handleDoubleClick}- onKeyDown={handleKeyDown}- onContextMenu={handleContextMenu}- >- {/* Settled history recedes: dimmed favicon at rest, restored on- hover so the tail stays scannable when you're hunting. */}- <span- className={cn(- "shrink-0 transition-opacity",- !props.isActive &&- "opacity-40 grayscale group-hover/v2-row:opacity-100 group-hover/v2-row:grayscale-0",- )}+ <Tooltip>+ <TooltipTrigger+ render={+ <div+ role="button"+ tabIndex={0}+ data-testid="sidebar-v2-row-slim"+ className={cn(rowSurfaceClassName, "flex h-9 items-center gap-2.5 px-2.5")}+ onClick={handleClick}+ onDoubleClick={handleDoubleClick}+ onKeyDown={handleKeyDown}+ onContextMenu={handleContextMenu}+ />+ }>- <ProjectFavicon- environmentId={thread.environmentId}- cwd={props.projectCwd ?? ""}- className="size-3.5"- fallbackIcon={MessageSquareIcon}- />- </span>- {title}- {/* The PR badge stays outside the hover-fading slot: it must+ {/* Settled history recedes: dimmed favicon at rest, restored on+ hover so the tail stays scannable when you're hunting. */}+ <span+ className={cn(+ "shrink-0 transition-opacity",+ !props.isActive &&+ "opacity-40 grayscale group-hover/v2-row:opacity-100 group-hover/v2-row:grayscale-0",+ )}+ >+ <ProjectFavicon+ environmentId={thread.environmentId}+ cwd={props.projectCwd ?? ""}+ className="size-4"+ fallbackIcon={MessageSquareIcon}+ />+ </span>+ {title}+ {/* The PR badge stays outside the hover-fading slot: it mustremain visible AND clickable while the row is hovered. Onlythe time/jump label yields to the settle affordance. */}- {prBadge}- <span className="relative ml-auto flex h-6 min-w-8 shrink-0 items-center justify-end">- <span className="inline-flex justify-end tabular-nums text-muted-foreground/40 transition-opacity group-hover/v2-row:opacity-0">- <span className="text-[13px]">- {props.jumpLabel ??- compactSidebarTimeLabel(- formatRelativeTimeLabel(thread.latestUserMessageAt ?? thread.updatedAt),- )}+ {prBadge}+ <span className="relative ml-auto flex h-6 min-w-8 shrink-0 items-center justify-end">+ <span className="inline-flex justify-end tabular-nums text-muted-foreground/55 transition-opacity group-hover/v2-row:opacity-0">+ <span className="text-xs">+ {props.jumpLabel ??+ compactSidebarTimeLabel(+ formatRelativeTimeLabel(thread.latestUserMessageAt ?? thread.updatedAt),+ )}+ </span></span>+ {!props.settlementSupported ? null : variantAction === "unsettle" ? (+ <button+ type="button"+ aria-label="Un-settle thread"+ onClick={handleUnsettleClick}+ className="absolute inset-y-0 right-0 inline-flex cursor-pointer items-center gap-1 rounded-md border border-sidebar-border bg-sidebar-row-hover px-2 text-xs text-muted-foreground opacity-0 transition-opacity hover:text-foreground focus-visible:opacity-100 group-hover/v2-row:opacity-100 dark:border-transparent dark:inset-ring-1 dark:inset-ring-white/5"+ >+ <Undo2Icon className="size-3" />+ </button>+ ) : (+ <button+ type="button"+ aria-label="Settle thread"+ onClick={handleSettleClick}+ className="absolute inset-y-0 right-0 inline-flex cursor-pointer items-center gap-1 rounded-md border border-sidebar-border bg-sidebar-row-hover px-2 text-xs text-muted-foreground opacity-0 transition-opacity hover:text-foreground focus-visible:opacity-100 group-hover/v2-row:opacity-100 dark:border-transparent dark:inset-ring-1 dark:inset-ring-white/5"+ >+ <CheckIcon className="size-3" />+ </button>+ )}</span>- {!props.settlementSupported ? null : variantAction === "unsettle" ? (- <button- type="button"- aria-label="Un-settle thread"- onClick={handleUnsettleClick}- className="absolute inset-y-0 right-0 inline-flex items-center gap-1 rounded-md border border-border bg-background px-2 text-[11px] text-muted-foreground opacity-0 transition-opacity hover:text-foreground focus-visible:opacity-100 group-hover/v2-row:opacity-100"- >- <Undo2Icon className="size-3" />- </button>- ) : (- <button- type="button"- aria-label="Settle thread"- onClick={handleSettleClick}- className="absolute inset-y-0 right-0 inline-flex items-center gap-1 rounded-md border border-border bg-background px-2 text-[11px] text-muted-foreground opacity-0 transition-opacity hover:text-foreground focus-visible:opacity-100 group-hover/v2-row:opacity-100"- >- <CheckIcon className="size-3" />- </button>- )}- </span>- </div>+ </TooltipTrigger>+ {detailsTooltip}+ </Tooltip></li>);}@@ -460,144 +605,109 @@ const SidebarV2Row = memo(function SidebarV2Row(props: {data-thread-itemclassName="list-none py-0.5 [content-visibility:auto] [contain-intrinsic-size:auto_96px]">- <div- role="button"- tabIndex={0}- data-testid="sidebar-v2-row-card"- className={cn(- // Every card carries a faint tonal fill so threads read as- // discrete objects; active/selected/hover are brighter tones of- // the same treatment rather than a different shape.- "group/v2-row relative w-full cursor-pointer select-none overflow-hidden rounded-lg text-left transition-colors",- props.isActive- ? "bg-foreground/[0.11] text-foreground dark:bg-white/[0.11]"- : isSelected- ? "bg-foreground/[0.07] text-foreground dark:bg-white/[0.07]"- : shouldRecede- ? "bg-foreground/[0.025] hover:bg-accent/45 dark:bg-white/[0.025]"- : "bg-foreground/[0.035] hover:bg-accent/65 dark:bg-white/[0.035]",- )}- onClick={handleClick}- onDoubleClick={handleDoubleClick}- onKeyDown={handleKeyDown}- onContextMenu={handleContextMenu}- >- <div className="relative z-10 px-2.5 py-2">- <div className="flex h-5 min-w-0 items-center gap-1.5">- <ProjectFavicon- environmentId={thread.environmentId}- cwd={props.projectCwd ?? ""}- className="size-3.5 shrink-0"+ <Tooltip>+ <TooltipTrigger+ render={+ <div+ role="button"+ tabIndex={0}+ data-testid="sidebar-v2-row-card"+ className={rowSurfaceClassName}+ onClick={handleClick}+ onDoubleClick={handleDoubleClick}+ onKeyDown={handleKeyDown}+ onContextMenu={handleContextMenu}/>- {props.projectTitle ? (- <span- className={cn(- "min-w-0 flex-1 truncate text-[13px] leading-5 text-muted-foreground/70",- isUnread || status !== "ready"- ? "font-semibold"- : shouldRecede- ? "font-normal"- : "font-medium",- )}- >- {props.projectTitle}- </span>- ) : (- <span className="flex-1" />- )}- <span className="relative ml-auto flex h-5 min-w-8 shrink-0 items-center justify-end pl-1 text-[13px]">- <span className="tabular-nums text-muted-foreground/55 transition-opacity group-hover/v2-row:opacity-0">- {props.jumpLabel ? (- props.jumpLabel- ) : topStatus ? (- <span- role="status"- className={cn(- "inline-flex items-center gap-1 text-[11px]",- topStatus.className,- )}+ }+ >+ <div className="relative z-10 h-[4.875rem] px-2.5 py-2">+ <div className="flex h-5 min-w-0 items-center gap-1.5">+ <ProjectFavicon+ environmentId={thread.environmentId}+ cwd={props.projectCwd ?? ""}+ className="size-4 shrink-0"+ />+ {props.projectTitle ? (+ <span className="min-w-0 flex-1 truncate text-xs font-medium text-muted-foreground/85">+ {props.projectTitle}+ </span>+ ) : (+ <span className="flex-1" />+ )}+ <span className="relative ml-auto flex h-5 min-w-8 shrink-0 items-center justify-end pl-1 text-xs">+ <span className="tabular-nums text-muted-foreground/65 transition-opacity group-hover/v2-row:opacity-0">+ {props.jumpLabel ? (+ props.jumpLabel+ ) : topStatus ? (+ <span+ role="status"+ className={cn(+ "inline-flex items-center gap-1 font-medium",+ topStatus.className,+ )}+ >+ {topStatus.icon === "working" ? (+ <CircleDashedIcon aria-hidden className="size-4 shrink-0" />+ ) : topStatus.icon === "done" ? (+ <CircleCheckIcon aria-hidden className="size-4 shrink-0" />+ ) : null}+ {topStatus.label}+ </span>+ ) : (+ threadTimeLabel(thread)+ )}+ </span>+ {props.settlementSupported ? (+ <button+ type="button"+ aria-label="Settle thread"+ onClick={handleSettleClick}+ className="absolute inset-y-0 right-0 inline-flex cursor-pointer items-center gap-1 rounded-md border border-sidebar-border bg-sidebar-row-hover px-2 text-xs text-muted-foreground opacity-0 transition-opacity hover:text-foreground focus-visible:opacity-100 group-hover/v2-row:opacity-100 dark:border-transparent dark:inset-ring-1 dark:inset-ring-white/5">- {topStatus.icon === "working" ? (- <CircleDashedIcon aria-hidden className="size-3" />- ) : topStatus.icon === "done" ? (- <CircleCheckIcon aria-hidden className="size-3" />- ) : null}- {topStatus.label}- </span>- ) : (- threadTimeLabel(thread)- )}+ <CheckIcon className="size-3" />+ Settle+ </button>+ ) : null}</span>- {props.settlementSupported ? (- <button- type="button"- aria-label="Settle thread"- onClick={handleSettleClick}- className="absolute inset-y-0 right-0 inline-flex items-center gap-1 rounded-md border border-border bg-background px-2 text-[10px] text-muted-foreground opacity-0 transition-opacity hover:text-foreground focus-visible:opacity-100 group-hover/v2-row:opacity-100"- >- <CheckIcon className="size-3" />- Settle- </button>+ </div>+ <div className="mt-1 flex min-w-0">{title}</div>+ <div className="mt-0.5 flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground/75">+ {thread.branch ? (+ <span className="min-w-0 flex-1 truncate whitespace-nowrap">{thread.branch}</span>+ ) : (+ <span className="flex-1" />+ )}+ {prBadge}+ {diff ? (+ <span className="shrink-0 font-mono">+ <span className="text-emerald-600 dark:text-emerald-400">+{diff.insertions}</span>{" "}+ <span className="text-red-600 dark:text-red-400">−{diff.deletions}</span>+ </span>) : null}- </span>- </div>- <div className="mt-1 flex min-w-0">{title}</div>- <div className="mt-0.5 flex min-w-0 items-center gap-1.5 text-[10px] text-muted-foreground/65">- {thread.branch ? (- <span className="min-w-0 flex-1 overflow-hidden whitespace-nowrap font-mono [mask-image:linear-gradient(to_right,#000_0,#000_calc(100%-1rem),transparent_100%)] [-webkit-mask-image:linear-gradient(to_right,#000_0,#000_calc(100%-1rem),transparent_100%)]">- {thread.branch}- </span>- ) : (- <span className="flex-1" />- )}- {prBadge}- {diff ? (- <span className="shrink-0 font-mono">- <span className="text-emerald-600 dark:text-emerald-400">+{diff.insertions}</span>{" "}- <span className="text-red-600 dark:text-red-400">−{diff.deletions}</span>- </span>- ) : null}- <span className="ml-auto inline-flex shrink-0 items-center gap-1">- {driverKind ? (- <Tooltip>- <TooltipTrigger- render={<span className="inline-flex shrink-0 items-center opacity-60" />}+ <span className="ml-auto inline-flex shrink-0 items-center gap-1">+ {isRemote ? (+ <span+ aria-label={props.environmentLabel ?? "Remote environment"}+ className="inline-flex shrink-0 items-center text-sidebar-muted-foreground/70">+ <ServerIcon aria-hidden className="size-4" />+ </span>+ ) : null}+ {driverKind ? (+ <span className="inline-flex shrink-0 items-center opacity-60"><ProviderInstanceIcondriverKind={driverKind}displayName={thread.session?.providerName ?? modelInstanceId}- iconClassName="size-3"+ iconClassName="size-4"/>- </TooltipTrigger>- <TooltipPopup side="top">{thread.modelSelection.model}</TooltipPopup>- </Tooltip>- ) : null}- {isRemote ? (- <Tooltip>- <TooltipTrigger- render={- <span className="inline-flex shrink-0 items-center text-muted-foreground/50" />- }- >- <CloudIcon className="size-3" />- </TooltipTrigger>- <TooltipPopup side="top">- Running on {props.environmentLabel ?? "a remote environment"}- </TooltipPopup>- </Tooltip>- ) : null}- </span>- </div>- {status === "failed" && thread.session?.lastError ? (- <div- className="mt-0.5 min-w-0 truncate text-[10px] text-red-600/75 dark:text-red-400/70"- title={thread.session.lastError}- >- {thread.session.lastError}+ </span>+ ) : null}+ </span></div>- ) : null}- </div>- </div>+ </div>+ </TooltipTrigger>+ {detailsTooltip}+ </Tooltip></li>);});@@ -711,9 +821,8 @@ export default function SidebarV2() {[],);- // Project scope: chips above the list. Scoping filters the list AND- // becomes the new-thread target — one visible control doing both jobs the- // old per-project headers did.+ // Project scope: one menu above the list. Scoping filters the list without+ // making the header width depend on the number or length of project names.const [projectScopeKey, setProjectScopeKey] = useState<string | null>(null);const scopedProject = useMemo(() =>@@ -794,7 +903,7 @@ export default function SidebarV2() {// filter context changes so a scope/search flip never inherits a deep// page state.const [settledVisibleCount, setSettledVisibleCount] = useState(SETTLED_TAIL_INITIAL_COUNT);- const settledResetKey = `${projectScopeKey ?? "all"}`;+ const settledResetKey = projectScopeKey ?? "all";const lastSettledResetKeyRef = useRef(settledResetKey);if (lastSettledResetKeyRef.current !== settledResetKey) {lastSettledResetKeyRef.current = settledResetKey;@@ -1322,243 +1431,245 @@ export default function SidebarV2() {const newThreadShortcutLabel =shortcutLabelForCommand(keybindings, "chat.newLocal") ??shortcutLabelForCommand(keybindings, "chat.new");- const projectScrollerRef = useRef<HTMLDivElement>(null);- const [canScrollProjectsRight, setCanScrollProjectsRight] = useState(false);- const updateProjectScrollFade = useCallback(() => {- const scroller = projectScrollerRef.current;- if (!scroller) return;- setCanScrollProjectsRight(- scroller.scrollLeft + scroller.clientWidth < scroller.scrollWidth - 1,- );- }, []);- useEffect(() => {- const scroller = projectScrollerRef.current;- if (!scroller) return;-- updateProjectScrollFade();- const resizeObserver = new ResizeObserver(updateProjectScrollFade);- resizeObserver.observe(scroller);- return () => resizeObserver.disconnect();- }, [projects, updateProjectScrollFade]);-return (<><SidebarChromeHeader isElectron={isElectron} /><SidebarContent className="gap-0"><SidebarGroup className="px-2 pb-2 pt-3">- <SidebarMenu className="flex-row gap-1">- <SidebarMenuItem className="min-w-0 flex-1">+ <div className="flex items-center gap-1">+ <div className="min-w-0 flex-1"><CommandDialogTriggerrender={<SidebarMenuButtonsize="sm"- className="gap-2 border border-border bg-background/60 px-2 py-1.5 text-muted-foreground/70 hover:bg-accent hover:text-foreground focus-visible:ring-0"+ type="button"+ aria-label="Search threads and commands"+ className="h-8 gap-2 rounded-md border-0 bg-transparent px-2 py-1.5 text-sm font-medium text-sidebar-muted-foreground hover:bg-sidebar-row-hover hover:text-sidebar-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-sidebar"data-testid="command-palette-trigger"/>}>- <SearchIcon className="size-3.5 text-muted-foreground/70" />- <span className="flex-1 truncate text-left text-xs">Search</span>+ <SearchIcon className="size-4 shrink-0 text-sidebar-muted-foreground/80" />+ <div className="flex-1 truncate text-left">Search</div>{commandPaletteShortcutLabel ? (- <Kbd className="h-4 min-w-0 rounded-sm px-1.5 text-[10px]">+ <Kbd className="h-4 min-w-0 rounded-sm bg-sidebar-control-surface px-1.5 text-[10px] text-sidebar-muted-foreground ring-1 ring-sidebar-border">{commandPaletteShortcutLabel}</Kbd>) : null}</CommandDialogTrigger>- </SidebarMenuItem>- <SidebarMenuItem className="shrink-0">- <SidebarMenuButton- size="sm"- className="size-7 justify-center border border-border bg-background/60 p-0 text-muted-foreground/70 hover:bg-accent hover:text-foreground"- onClick={handleNewThreadClick}- disabled={projects.length === 0}- aria-label="New thread"- tooltip={{- children: newThreadShortcutLabel- ? `New thread (${newThreadShortcutLabel})`- : "New thread",- side: "right",- }}- >- <SquarePenIcon className="size-3.5 text-muted-foreground/70" />- </SidebarMenuButton>- </SidebarMenuItem>- </SidebarMenu>+ </div>+ <div className="shrink-0">+ <Tooltip>+ <TooltipTrigger+ render={+ <SidebarMenuButton+ size="sm"+ type="button"+ className="relative size-8 justify-center rounded-md border-0 bg-transparent p-0 text-sidebar-muted-foreground hover:bg-sidebar-row-hover hover:text-sidebar-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-sidebar"+ onClick={handleNewThreadClick}+ disabled={projects.length === 0}+ aria-label="New thread"+ />+ }+ >+ <SquarePenIcon className="size-4 shrink-0 text-sidebar-muted-foreground/80" />+ <span+ className="pointer-events-none absolute left-1/2 top-1/2 size-[max(100%,3rem)] -translate-1/2 pointer-fine:hidden"+ aria-hidden="true"+ />+ </TooltipTrigger>+ <TooltipPopup side="right">+ {newThreadShortcutLabel ? `New thread (${newThreadShortcutLabel})` : "New thread"}+ </TooltipPopup>+ </Tooltip>+ </div>+ </div></SidebarGroup>{projects.length > 0 ? (- <SidebarGroup className="px-2 pb-1 pt-1">- <div className="relative">- <div- ref={projectScrollerRef}- onScroll={updateProjectScrollFade}- className={cn(- "flex items-center gap-1 overflow-x-auto pr-10 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",- canScrollProjectsRight &&- "[mask-image:linear-gradient(to_right,#000_0,#000_calc(100%-4.5rem),transparent_calc(100%-2rem))] [-webkit-mask-image:linear-gradient(to_right,#000_0,#000_calc(100%-4.5rem),transparent_calc(100%-2rem))]",- )}- role="tablist"- aria-label="Filter threads by project"- >- {projects.length > 1 ? (- <button- type="button"- role="tab"- aria-selected={projectScopeKey === null}- onClick={() => setProjectScopeKey(null)}- className={cn(- "shrink-0 rounded-md border px-2.5 py-1 text-[11px] font-medium transition-colors",- projectScopeKey === null- ? "border-foreground/15 bg-accent text-foreground"- : "border-black/15 text-muted-foreground hover:border-black/40 hover:text-foreground dark:border-white/15 dark:hover:border-white/40",- )}- >- All- </button>- ) : null}- {projects.map((project) => {- const scopeKey = `${project.environmentId}:${project.id}`;- const isScoped = projectScopeKey === scopeKey;- return (- <button- key={scopeKey}- type="button"- role="tab"- aria-selected={isScoped}- onClick={() => setProjectScopeKey(isScoped ? null : scopeKey)}- className={cn(- "flex shrink-0 items-center gap-1.5 rounded-md border py-1 pl-1.5 pr-2.5 text-[11px] font-medium transition-colors",- isScoped- ? "border-foreground/15 bg-accent text-foreground"- : "border-black/15 text-muted-foreground hover:border-black/40 hover:text-foreground dark:border-white/15 dark:hover:border-white/40",- )}- >- <ProjectFavicon- environmentId={project.environmentId}- cwd={project.workspaceRoot}- className="size-3.5"- />- <span className="max-w-28 truncate">{project.title}</span>- </button>- );- })}- </div>- <div className="pointer-events-none absolute inset-y-0 right-0 flex w-12 items-center justify-end bg-gradient-to-r from-transparent via-card/90 to-card">- <Tooltip>- <TooltipTrigger- render={- <button- type="button"- aria-label="Add project"- onClick={openAddProjectCommandPalette}- className="pointer-events-auto flex size-7 shrink-0 items-center justify-center rounded-md border border-border bg-card text-muted-foreground/70 shadow-sm transition-colors hover:bg-accent hover:text-foreground"- />+ <SidebarGroup className="px-2 pb-2 pt-0">+ <div className="flex items-center gap-1">+ <Menu>+ <MenuTrigger+ aria-label="Filter threads by project"+ className="flex h-8 min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-md px-2 text-left text-sm font-medium text-sidebar-muted-foreground outline-none hover:bg-sidebar-row-hover hover:text-sidebar-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-sidebar"+ >+ {scopedProject ? (+ <ProjectFavicon+ environmentId={scopedProject.environmentId}+ cwd={scopedProject.workspaceRoot}+ className="size-4 shrink-0"+ />+ ) : (+ <FolderIcon className="size-4 shrink-0 text-sidebar-muted-foreground/80" />+ )}+ <span className="min-w-0 flex-1 truncate">+ {scopedProject?.title ?? "All projects"}+ </span>+ <ChevronDownIcon className="size-4 shrink-0 text-sidebar-muted-foreground/70" />+ </MenuTrigger>+ <MenuPopup align="start" className="w-(--anchor-width)">+ <MenuRadioGroup+ value={projectScopeKey ?? "all"}+ onValueChange={(value) =>+ setProjectScopeKey(value === "all" ? null : (value as string))}>- <FolderPlusIcon className="size-3.5" />- </TooltipTrigger>- <TooltipPopup side="bottom">Add project</TooltipPopup>- </Tooltip>- </div>+ <MenuRadioItem+ value="all"+ closeOnClick+ className="[&>span:last-child]:flex [&>span:last-child]:min-w-0 [&>span:last-child]:items-center [&>span:last-child]:gap-2"+ >+ <FolderIcon className="size-3.5" />+ <span className="min-w-0 truncate">All projects</span>+ </MenuRadioItem>+ {projects.map((project) => {+ const scopeKey = `${project.environmentId}:${project.id}`;+ return (+ <MenuRadioItem+ key={scopeKey}+ value={scopeKey}+ closeOnClick+ className="[&>span:last-child]:flex [&>span:last-child]:min-w-0 [&>span:last-child]:items-center [&>span:last-child]:gap-2"+ >+ <ProjectFavicon+ environmentId={project.environmentId}+ cwd={project.workspaceRoot}+ className="size-3.5"+ />+ <span className="min-w-0 truncate">{project.title}</span>+ </MenuRadioItem>+ );+ })}+ </MenuRadioGroup>+ </MenuPopup>+ </Menu>+ <Tooltip>+ <TooltipTrigger+ render={+ <SidebarMenuButton+ size="sm"+ className="relative size-8 shrink-0 justify-center rounded-md bg-transparent p-0 text-sidebar-muted-foreground hover:bg-sidebar-row-hover hover:text-sidebar-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-sidebar"+ onClick={openAddProjectCommandPalette}+ type="button"+ aria-label="New project"+ />+ }+ >+ <FolderPlusIcon className="size-4 shrink-0 text-sidebar-muted-foreground/80" />+ <span+ className="pointer-events-none absolute left-1/2 top-1/2 size-[max(100%,3rem)] -translate-1/2 pointer-fine:hidden"+ aria-hidden="true"+ />+ </TooltipTrigger>+ <TooltipPopup side="right">New project</TooltipPopup>+ </Tooltip></div></SidebarGroup>) : null}<SidebarGroup className="min-h-0 flex-1 overflow-y-auto px-2 py-1">- <ul ref={attachListAutoAnimateRef} className="flex flex-col gap-px">- {orderedThreads.flatMap((thread, threadIndex) => {- const threadKey = scopedThreadKey(scopeThreadRef(thread.environmentId, thread.id));- const isSettledRow = settledThreadKeys.has(threadKey);- // Settled is the ONLY thing that collapses a row: every- // not-settled thread is a full card. Density comes from users- // (or the auto rules) actually settling work, not from the- // sidebar second-guessing what still matters.- const isCard = !isSettledRow;- const previousThread = threadIndex > 0 ? orderedThreads[threadIndex - 1] : null;- const previousWasCard =- previousThread != null &&- !settledThreadKeys.has(- scopedThreadKey(scopeThreadRef(previousThread.environmentId, previousThread.id)),+ <TooltipProvider+ key="sidebar-thread-tooltips-150"+ delay={150}+ closeDelay={0}+ timeout={400}+ >+ <ul ref={attachListAutoAnimateRef} role="list" className="flex flex-col gap-px">+ {orderedThreads.flatMap((thread, threadIndex) => {+ const threadKey = scopedThreadKey(scopeThreadRef(thread.environmentId, thread.id));+ const isSettledRow = settledThreadKeys.has(threadKey);+ // Settled is the ONLY thing that collapses a row: every+ // not-settled thread is a full card. Density comes from users+ // (or the auto rules) actually settling work, not from the+ // sidebar second-guessing what still matters.+ const isCard = !isSettledRow;+ const previousThread = threadIndex > 0 ? orderedThreads[threadIndex - 1] : null;+ const previousWasCard =+ previousThread != null &&+ !settledThreadKeys.has(+ scopedThreadKey(+ scopeThreadRef(previousThread.environmentId, previousThread.id),+ ),+ );+ const showSettledGap = !isCard && previousWasCard;+ const row = (+ <SidebarV2Row+ // Keyed per variant on purpose: when a thread settles, the+ // card fades out in place and the slim row fades in at its+ // settled position instead of one element FLIP-sliding+ // through every row in between (rows here are translucent,+ // so a crossing row reads as text painted over text).+ key={`${threadKey}:${isCard ? "card" : "slim"}`}+ thread={thread}+ variant={isCard ? "card" : "slim"}+ // Every settled row can un-settle: explicit settles clear+ // the override, auto-settled rows get pinned active.+ variantAction={isSettledRow ? "unsettle" : "settle"}+ settlementSupported={+ serverConfigs.get(thread.environmentId)?.environment.capabilities+ .threadSettlement === true+ }+ isActive={routeThreadKey === threadKey}+ jumpLabel={showJumpHints ? (jumpLabelByKey.get(threadKey) ?? null) : null}+ currentEnvironmentId={primaryEnvironmentId}+ environmentLabel={environmentLabelById.get(thread.environmentId) ?? null}+ projectCwd={+ projectCwdByKey.get(`${thread.environmentId}:${thread.projectId}`) ?? null+ }+ projectTitle={+ projectTitleByKey.get(`${thread.environmentId}:${thread.projectId}`) ?? null+ }+ providerEntryByInstanceId={providerEntryByInstanceId}+ onThreadClick={handleThreadClick}+ onThreadActivate={navigateToThread}+ onStartRename={startThreadRename}+ onRenameTitleChange={setRenamingTitle}+ onCommitRename={commitThreadRename}+ onCancelRename={cancelThreadRename}+ isRenaming={renamingThreadKey === threadKey}+ renamingTitle={renamingThreadKey === threadKey ? renamingTitle : ""}+ onContextMenu={handleThreadContextMenu}+ onSettle={attemptSettle}+ onUnsettle={attemptUnsettle}+ onChangeRequestState={handleChangeRequestState}+ />);- const showSettledGap = !isCard && previousWasCard;- const row = (- <SidebarV2Row- // Keyed per variant on purpose: when a thread settles, the- // card fades out in place and the slim row fades in at its- // settled position instead of one element FLIP-sliding- // through every row in between (rows here are translucent,- // so a crossing row reads as text painted over text).- key={`${threadKey}:${isCard ? "card" : "slim"}`}- thread={thread}- variant={isCard ? "card" : "slim"}- // Every settled row can un-settle: explicit settles clear- // the override, auto-settled rows get pinned active.- variantAction={isSettledRow ? "unsettle" : "settle"}- settlementSupported={- serverConfigs.get(thread.environmentId)?.environment.capabilities- .threadSettlement === true- }- isActive={routeThreadKey === threadKey}- jumpLabel={showJumpHints ? (jumpLabelByKey.get(threadKey) ?? null) : null}- currentEnvironmentId={primaryEnvironmentId}- environmentLabel={environmentLabelById.get(thread.environmentId) ?? null}- projectCwd={- projectCwdByKey.get(`${thread.environmentId}:${thread.projectId}`) ?? null- }- projectTitle={- projectTitleByKey.get(`${thread.environmentId}:${thread.projectId}`) ?? null- }- providerEntryByInstanceId={providerEntryByInstanceId}- onThreadClick={handleThreadClick}- onThreadActivate={navigateToThread}- onStartRename={startThreadRename}- onRenameTitleChange={setRenamingTitle}- onCommitRename={commitThreadRename}- onCancelRename={cancelThreadRename}- isRenaming={renamingThreadKey === threadKey}- renamingTitle={renamingThreadKey === threadKey ? renamingTitle : ""}- onContextMenu={handleThreadContextMenu}- onSettle={attemptSettle}- onUnsettle={attemptUnsettle}- onChangeRequestState={handleChangeRequestState}- />- );- if (!showSettledGap) return [row];- // The divider is its own keyed list item (not part of the first- // settled row): it keeps one stable DOM node at the boundary,- // so settling a thread slides it instead of teleporting it- // along with whichever row happens to be first in the tail —- // and row heights stay independent of neighbor classification.- return [- <li- key="settled-divider"- aria-hidden- data-thread-selection-safe- className="list-none"- >- <div className="mb-1 mt-3 flex items-center gap-2 px-2.5">- <span className="text-[10px] font-medium text-muted-foreground/50">- Settled+ if (!showSettledGap) return [row];+ // The divider is its own keyed list item (not part of the first+ // settled row): it keeps one stable DOM node at the boundary,+ // so settling a thread slides it instead of teleporting it+ // along with whichever row happens to be first in the tail —+ // and row heights stay independent of neighbor classification.+ return [+ <li+ key="settled-divider"+ aria-hidden+ data-thread-selection-safe+ className="list-none"+ >+ <div className="mb-1 mt-3 flex items-center gap-2 px-2.5">+ <span className="text-xs font-medium text-muted-foreground/50">Settled</span>+ <span className="h-px flex-1 bg-sidebar-border/60" />+ </div>+ </li>,+ row,+ ];+ })}+ {hiddenSettledCount > 0 ? (+ <li className="list-none">+ <button+ type="button"+ onClick={showMoreSettled}+ className="mt-1 flex h-[30px] w-full items-center justify-center gap-1.5 rounded-md border border-dashed border-border font-mono text-[11px] text-muted-foreground transition-colors hover:border-solid hover:border-input hover:bg-background/45 hover:text-foreground dark:border-white/15 dark:hover:border-white/30 dark:hover:bg-transparent"+ >+ Show {Math.min(hiddenSettledCount, SETTLED_TAIL_PAGE_COUNT)} more+ <span className="text-muted-foreground/50">+ ({hiddenSettledCount} settled hidden)</span>- <span className="h-px flex-1 bg-border/60" />- </div>- </li>,- row,- ];- })}- {hiddenSettledCount > 0 ? (- <li className="list-none">- <button- type="button"- onClick={showMoreSettled}- className="mt-1 flex h-[30px] w-full items-center justify-center gap-1.5 rounded-md border border-dashed border-black/15 font-mono text-[11px] text-muted-foreground transition-colors hover:border-solid hover:border-black/30 hover:text-foreground dark:border-white/15 dark:hover:border-white/30"- >- Show {Math.min(hiddenSettledCount, SETTLED_TAIL_PAGE_COUNT)} more- <span className="text-muted-foreground/50">- ({hiddenSettledCount} settled hidden)- </span>- </button>- </li>- ) : null}- </ul>+ </button>+ </li>+ ) : null}+ </ul>+ </TooltipProvider>{orderedThreads.length === 0 ? (<div className="flex flex-col items-center gap-2 px-2 py-6 text-center text-xs text-muted-foreground/60">{projects.length === 0 ? (@@ -1567,7 +1678,7 @@ export default function SidebarV2() {<buttontype="button"onClick={openAddProjectCommandPalette}- className="inline-flex items-center gap-1.5 rounded-md border border-border px-2.5 py-1 text-[11px] font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"+ className="inline-flex items-center gap-1.5 rounded-md border border-sidebar-border px-2.5 py-1 text-[11px] font-medium text-sidebar-muted-foreground transition-colors hover:bg-sidebar-row-hover hover:text-sidebar-foreground"><PlusIcon className="size-3" />Add project@@ -1582,7 +1693,9 @@ export default function SidebarV2() {) : null}</SidebarGroup></SidebarContent>- <SidebarSeparator />+ <div className="shrink-0 px-2">+ <SidebarSeparator className="mx-0 w-full bg-sidebar-border/80" />+ </div><SidebarChromeFooter /></>);diff --git a/apps/web/src/components/chat/ChatComposer.tsx b/apps/web/src/components/chat/ChatComposer.tsxindex 591a07ac4..ebc4c48f0 100644--- a/apps/web/src/components/chat/ChatComposer.tsx+++ b/apps/web/src/components/chat/ChatComposer.tsx@@ -2165,7 +2165,7 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)"chat-composer-glass rounded-[20px] border transition-[background-color] duration-200 has-focus-visible:border-foreground/40",isDragOverComposer? "border-primary/70 bg-accent/45"- : "border-black/12 dark:border-white/12",+ : "border-black/12 dark:border-transparent dark:inset-ring-1 dark:inset-ring-white/5",projectSelectionRequired ? "opacity-75" : null,composerProviderState.composerSurfaceClassName,)}diff --git a/apps/web/src/components/chat/ModelPickerContent.tsx b/apps/web/src/components/chat/ModelPickerContent.tsxindex e0d6b9afc..9c72f15f9 100644--- a/apps/web/src/components/chat/ModelPickerContent.tsx+++ b/apps/web/src/components/chat/ModelPickerContent.tsx@@ -521,7 +521,7 @@ export const ModelPickerContent = memo(function ModelPickerContent(props: {return (<TooltipProvider delay={0}><div- className="relative flex h-screen max-h-96 w-screen max-w-100 flex-row overflow-hidden rounded-lg border bg-popover not-dark:bg-clip-padding text-popover-foreground shadow-lg/5 before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)]"+ className="relative flex h-screen max-h-96 w-screen max-w-100 flex-row overflow-hidden rounded-lg border bg-popover not-dark:bg-clip-padding text-popover-foreground shadow-lg/5 before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:border-transparent dark:shadow-none dark:inset-ring-1 dark:inset-ring-white/5 dark:before:shadow-none"data-model-picker-content="true">{/* Sidebar */}@@ -580,11 +580,11 @@ export const ModelPickerContent = memo(function ModelPickerContent(props: {<ComboboxInputref={searchInputRef}className="[&_input]:h-6.5 [&_input]:font-sans [&_input]:leading-6.5"- inputClassName="rounded-none bg-transparent text-sm"+ inputClassName="rounded-none bg-transparent text-sm placeholder:text-muted-foreground/80"placeholder="Search models..."showTrigger={false}startAddon={- <SearchIcon className="-translate-x-0.5 size-4 shrink-0 text-muted-foreground/55" />+ <SearchIcon className="-translate-x-0.5 size-4 shrink-0 text-muted-foreground/80" />}value={searchQuery}onChange={(e) => setSearchQuery(e.target.value)}diff --git a/apps/web/src/components/clerk/T3ConnectSidebarSignIn.tsx b/apps/web/src/components/clerk/T3ConnectSidebarSignIn.tsxindex 45477ee1b..7ed437115 100644--- a/apps/web/src/components/clerk/T3ConnectSidebarSignIn.tsx+++ b/apps/web/src/components/clerk/T3ConnectSidebarSignIn.tsx@@ -28,7 +28,7 @@ function ConfiguredT3ConnectSidebarAvatar() {appearance={{elements: {avatarBox: "size-7",- userButtonTrigger: "rounded-lg p-1 hover:bg-sidebar-accent",+ userButtonTrigger: "rounded-lg p-1 hover:bg-sidebar-row-hover",},}}>diff --git a/apps/web/src/components/settings/SettingsSidebarNav.tsx b/apps/web/src/components/settings/SettingsSidebarNav.tsxindex 9d690f2a4..c6b45e7c3 100644--- a/apps/web/src/components/settings/SettingsSidebarNav.tsx+++ b/apps/web/src/components/settings/SettingsSidebarNav.tsx@@ -85,16 +85,16 @@ export function SettingsSidebarNav({ pathname }: { pathname: string }) {isActive={isActive}className={isActive- ? "gap-2.5 px-2.5 py-2 text-left text-[13px] font-medium text-foreground"- : "gap-2.5 px-2.5 py-2 text-left text-[13px] text-muted-foreground/70 hover:text-foreground/80"+ ? "gap-2.5 px-2.5 py-2 text-left text-[13px] font-medium text-sidebar-foreground"+ : "gap-2.5 px-2.5 py-2 text-left text-[13px] text-sidebar-muted-foreground hover:text-sidebar-foreground"}onClick={() => handleSectionClick(item.to)}><IconclassName={isActive- ? "size-4 shrink-0 text-foreground"- : "size-4 shrink-0 text-muted-foreground/60"+ ? "size-4 shrink-0 text-sidebar-foreground"+ : "size-4 shrink-0 text-sidebar-muted-foreground"}/><span className="truncate">{item.label}</span>@@ -114,7 +114,7 @@ export function SettingsSidebarNav({ pathname }: { pathname: string }) {<SidebarMenuItem><SidebarMenuButtonsize="sm"- className="gap-2 px-2 py-2 text-xs text-muted-foreground hover:bg-accent hover:text-foreground"+ className="gap-2 px-2 py-2 text-xs text-sidebar-muted-foreground hover:bg-sidebar-row-hover hover:text-sidebar-foreground"onClick={handleBackClick}><ArrowLeftIcon className="size-4" />diff --git a/apps/web/src/components/settings/settingsLayout.tsx b/apps/web/src/components/settings/settingsLayout.tsxindex add6954fd..04c1816f6 100644--- a/apps/web/src/components/settings/settingsLayout.tsx+++ b/apps/web/src/components/settings/settingsLayout.tsx@@ -38,7 +38,7 @@ export function SettingsSection({</h2><div className="flex h-5 min-w-5 items-center justify-end">{headerAction}</div></div>- <div className="relative overflow-visible rounded-2xl border bg-card text-card-foreground shadow-sm/4 not-dark:bg-clip-padding before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:shadow-none dark:before:shadow-[0_-1px_--theme(--color-white/6%)]">+ <div className="relative overflow-visible rounded-2xl border bg-surface-raised text-card-foreground shadow-sm/4 not-dark:bg-clip-padding before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:shadow-none dark:before:shadow-[0_-1px_--theme(--color-white/6%)]">{children}</div></section>diff --git a/apps/web/src/components/sidebar/SidebarChrome.tsx b/apps/web/src/components/sidebar/SidebarChrome.tsxindex c665f7741..c338aee2f 100644--- a/apps/web/src/components/sidebar/SidebarChrome.tsx+++ b/apps/web/src/components/sidebar/SidebarChrome.tsx@@ -39,7 +39,8 @@ export const SidebarChromeHeader = memo(function SidebarChromeHeader({<SidebarTriggerclassName={cn("relative z-10 md:hidden",- backdropVariant && "hover:bg-white/15 [&_svg]:text-white/85! [&_svg]:hover:text-white!",+ backdropVariant &&+ "[:hover,[data-pressed]]:bg-white/15 focus-visible:ring-white/90 focus-visible:ring-offset-blue-700 [&_svg]:stroke-white/90! [&_svg]:opacity-100! [&_svg]:hover:stroke-white!",)}/><SidebarBrand onBackdrop={backdropVariant !== null} />@@ -114,11 +115,11 @@ export const SidebarChromeFooter = memo(function SidebarChromeFooter() {<SidebarMenuItem><SidebarMenuButtonsize="sm"- className="gap-2 px-2 py-1.5 text-muted-foreground/70 hover:bg-accent hover:text-foreground"+ className="gap-2 px-2 py-1.5 text-sm font-medium text-sidebar-muted-foreground hover:bg-sidebar-row-hover hover:text-sidebar-foreground"onClick={handleSettingsClick}>- <SettingsIcon className="size-3.5" />- <span className="text-xs">Settings</span>+ <SettingsIcon className="size-4 shrink-0" />+ <span>Settings</span></SidebarMenuButton></SidebarMenuItem></SidebarMenu>diff --git a/apps/web/src/components/ui/command.tsx b/apps/web/src/components/ui/command.tsxindex ad05bc2a6..7864fe445 100644--- a/apps/web/src/components/ui/command.tsx+++ b/apps/web/src/components/ui/command.tsx@@ -66,7 +66,7 @@ function CommandDialogPopup({<CommandDialogViewport><CommandDialogPrimitive.PopupclassName={cn(- "pointer-events-auto -translate-y-[calc(1.25rem*var(--nested-dialogs))] relative row-start-2 flex max-h-105 min-h-0 w-full min-w-0 max-w-xl scale-[calc(1-0.1*var(--nested-dialogs))] flex-col rounded-2xl border bg-popover not-dark:bg-clip-padding text-popover-foreground opacity-[calc(1-0.1*var(--nested-dialogs))] shadow-lg/5 outline-none transition-[scale,opacity,translate] duration-200 ease-in-out will-change-transform before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:bg-muted/72 before:shadow-[0_1px_--theme(--color-black/4%)] data-nested:data-ending-style:translate-y-8 data-nested:data-starting-style:translate-y-8 data-nested-dialog-open:origin-top data-ending-style:scale-98 data-starting-style:scale-98 data-ending-style:opacity-0 data-starting-style:opacity-0 **:data-[slot=scroll-area-viewport]:data-has-overflow-y:pe-1 dark:before:shadow-[0_-1px_--theme(--color-white/6%)]",+ "pointer-events-auto -translate-y-[calc(1.25rem*var(--nested-dialogs))] relative row-start-2 flex max-h-105 min-h-0 w-full min-w-0 max-w-xl scale-[calc(1-0.1*var(--nested-dialogs))] flex-col rounded-2xl border bg-popover not-dark:bg-clip-padding text-popover-foreground opacity-[calc(1-0.1*var(--nested-dialogs))] shadow-lg/5 outline-none transition-[scale,opacity,translate] duration-200 ease-in-out will-change-transform before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:bg-muted/72 before:shadow-[0_1px_--theme(--color-black/4%)] data-nested:data-ending-style:translate-y-8 data-nested:data-starting-style:translate-y-8 data-nested-dialog-open:origin-top data-ending-style:scale-98 data-starting-style:scale-98 data-ending-style:opacity-0 data-starting-style:opacity-0 **:data-[slot=scroll-area-viewport]:data-has-overflow-y:pe-1 dark:border-transparent dark:shadow-none dark:inset-ring-1 dark:inset-ring-white/5 dark:before:shadow-none",className,)}data-slot="command-dialog-popup"@@ -108,7 +108,7 @@ function CommandInput({<AutocompleteInputautoFocusclassName={cn(- "border-transparent! bg-transparent! shadow-none before:hidden has-focus-visible:ring-0",+ "border-transparent! bg-transparent! shadow-none before:hidden has-focus-visible:ring-0 placeholder:text-muted-foreground/80",className,)}placeholder={placeholder}@@ -144,7 +144,7 @@ function CommandPanel({ className, ...props }: React.ComponentProps<"div">) {return (<divclassName={cn(- "-mx-px not-has-[+[data-slot=command-footer]]:-mb-px relative min-h-0 overflow-hidden rounded-t-xl not-has-[+[data-slot=command-footer]]:rounded-b-2xl border border-b-0 bg-popover bg-clip-padding shadow-xs/5 [clip-path:inset(0_1px)] not-has-[+[data-slot=command-footer]]:[clip-path:inset(0_1px_1px_1px_round_0_0_calc(var(--radius-2xl)-1px)_calc(var(--radius-2xl)-1px))] before:pointer-events-none before:absolute before:inset-0 before:rounded-t-[calc(var(--radius-xl)-1px)] **:data-[slot=scroll-area-scrollbar]:mt-2 [touch-action:pan-y]",+ "-mx-px not-has-[+[data-slot=command-footer]]:-mb-px relative min-h-0 overflow-hidden rounded-t-xl not-has-[+[data-slot=command-footer]]:rounded-b-2xl border border-b-0 bg-popover bg-clip-padding shadow-xs/5 [clip-path:inset(0_1px)] not-has-[+[data-slot=command-footer]]:[clip-path:inset(0_1px_1px_1px_round_0_0_calc(var(--radius-2xl)-1px)_calc(var(--radius-2xl)-1px))] before:pointer-events-none before:absolute before:inset-0 before:rounded-t-[calc(var(--radius-xl)-1px)] **:data-[slot=scroll-area-scrollbar]:mt-2 [touch-action:pan-y] dark:border-white/5 dark:shadow-none",className,)}{...props}@@ -192,7 +192,7 @@ function CommandShortcut({ className, ...props }: React.ComponentProps<"kbd">) {return (<kbdclassName={cn(- "ms-auto font-medium font-sans text-muted-foreground/72 text-xs tracking-widest",+ "ms-auto font-medium font-sans text-muted-foreground text-xs tracking-widest",className,)}data-slot="command-shortcut"@@ -205,7 +205,7 @@ function CommandFooter({ className, ...props }: React.ComponentProps<"div">) {return (<divclassName={cn(- "flex items-center justify-between gap-2 rounded-b-[calc(var(--radius-2xl)-1px)] border-t px-5 py-3 text-muted-foreground text-xs",+ "relative flex items-center justify-between gap-2 rounded-b-[calc(var(--radius-2xl)-1px)] border-t border-zinc-200/80 px-5 py-3 font-medium text-sm text-zinc-700 dark:border-white/8 dark:text-zinc-300 [&_[data-slot=kbd-group]]:font-sans [&_[data-slot=kbd]]:bg-zinc-100 [&_[data-slot=kbd]]:text-zinc-900 [&_[data-slot=kbd]]:ring-1 [&_[data-slot=kbd]]:ring-zinc-200/80 [&_[data-slot=kbd]]:dark:bg-zinc-800 [&_[data-slot=kbd]]:dark:text-zinc-100 [&_[data-slot=kbd]]:dark:ring-zinc-700",className,)}data-slot="command-footer"diff --git a/apps/web/src/components/ui/sidebar.tsx b/apps/web/src/components/ui/sidebar.tsxindex 51335d1a6..af90a7cc6 100644--- a/apps/web/src/components/ui/sidebar.tsx+++ b/apps/web/src/components/ui/sidebar.tsx@@ -676,7 +676,7 @@ function SidebarFooter({ className, ...props }: React.ComponentProps<"div">) {function SidebarSeparator({ className, ...props }: React.ComponentProps<typeof Separator>) {return (<Separator- className={cn("mx-2 w-auto bg-sidebar-border", className)}+ className={cn("mx-2 w-auto! bg-sidebar-border", className)}data-sidebar="separator"data-slot="sidebar-separator"{...props}@@ -732,7 +732,7 @@ function SidebarGroupLabel({ className, render, ...props }: useRender.ComponentPfunction SidebarGroupAction({ className, render, ...props }: useRender.ComponentProps<"button">) {const defaultProps = {className: cn(- "absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-lg p-0 text-sidebar-foreground outline-hidden ring-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg:not([class*='size-'])]:size-4 [&>svg]:shrink-0",+ "absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-lg p-0 text-sidebar-foreground outline-hidden ring-ring transition-transform hover:bg-sidebar-row-hover hover:text-sidebar-foreground focus-visible:ring-2 [&>svg:not([class*='size-'])]:size-4 [&>svg]:shrink-0",// Increases the hit area of the button on mobile."after:-inset-2 after:absolute md:after:hidden","group-data-[collapsible=icon]:hidden",@@ -783,7 +783,7 @@ function SidebarMenuItem({ className, ...props }: React.ComponentProps<"li">) {}const sidebarMenuButtonVariants = cva(- "peer/menu-button flex w-full cursor-pointer items-center gap-2 overflow-hidden rounded-lg p-2 text-left text-sm outline-hidden ring-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pe-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg:not([class*='size-'])]:size-4 [&>svg]:shrink-0",+ "peer/menu-button flex w-full cursor-pointer items-center gap-2 overflow-hidden rounded-lg p-2 text-left text-sm outline-hidden ring-ring transition-[width,height,padding] hover:bg-sidebar-row-hover hover:text-sidebar-foreground focus-visible:ring-2 active:bg-sidebar-row-active active:text-sidebar-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pe-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-row-selected data-[active=true]:font-medium data-[active=true]:text-sidebar-foreground data-[state=open]:hover:bg-sidebar-row-hover data-[state=open]:hover:text-sidebar-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg:not([class*='size-'])]:size-4 [&>svg]:shrink-0",{defaultVariants: {size: "default",@@ -796,9 +796,9 @@ const sidebarMenuButtonVariants = cva(sm: "h-7 text-xs",},variant: {- default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",+ default: "hover:bg-sidebar-row-hover hover:text-sidebar-foreground",outline:- "bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]",+ "bg-sidebar-control-surface ring-1 ring-sidebar-border hover:bg-sidebar-row-hover hover:text-sidebar-foreground",},},},@@ -867,7 +867,7 @@ function SidebarMenuAction({}) {const defaultProps = {className: cn(- "absolute top-1.5 right-1 flex aspect-square w-5 cursor-pointer items-center justify-center rounded-lg p-0 text-sidebar-foreground outline-hidden ring-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg:not([class*='size-'])]:size-4 [&>svg]:shrink-0",+ "absolute top-1.5 right-1 flex aspect-square w-5 cursor-pointer items-center justify-center rounded-lg p-0 text-sidebar-foreground outline-hidden ring-ring transition-transform hover:bg-sidebar-row-hover hover:text-sidebar-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-foreground [&>svg:not([class*='size-'])]:size-4 [&>svg]:shrink-0",// Increases the hit area of the button on mobile."after:-inset-2 after:absolute md:after:hidden","peer-data-[size=sm]/menu-button:top-1",@@ -875,7 +875,7 @@ function SidebarMenuAction({"peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",showOnHover &&- "group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",+ "group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-foreground md:opacity-0",className,),"data-sidebar": "menu-action",@@ -894,7 +894,7 @@ function SidebarMenuBadge({ className, ...props }: React.ComponentProps<"div">)<divclassName={cn("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-lg px-1 font-medium text-sidebar-foreground text-xs tabular-nums",- "peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground",+ "peer-hover/menu-button:text-sidebar-foreground peer-data-[active=true]/menu-button:text-sidebar-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5",@@ -979,8 +979,8 @@ function SidebarMenuSubButton({}) {const defaultProps = {className: cn(- "-translate-x-px flex h-7 min-w-0 cursor-pointer items-center gap-2 overflow-hidden rounded-lg px-2 text-sidebar-foreground outline-hidden ring-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg:not([class*='size-'])]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground",- "data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",+ "-translate-x-px flex h-7 min-w-0 cursor-pointer items-center gap-2 overflow-hidden rounded-lg px-2 text-sidebar-foreground outline-hidden ring-ring hover:bg-sidebar-row-hover hover:text-sidebar-foreground focus-visible:ring-2 active:bg-sidebar-row-active active:text-sidebar-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg:not([class*='size-'])]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-muted-foreground",+ "data-[active=true]:bg-sidebar-row-selected data-[active=true]:text-sidebar-foreground",size === "sm" && "text-xs",size === "md" && "text-sm","group-data-[collapsible=icon]:hidden",diff --git a/apps/web/src/index.css b/apps/web/src/index.cssindex 72caf539e..8649e07e4 100644--- a/apps/web/src/index.css+++ b/apps/web/src/index.css@@ -107,6 +107,7 @@ html[data-mobile-composer-route-transition="true"]::view-transition-old(t3-mobil}@theme inline {+ --color-zinc-25: oklch(99.2% 0 0);--animate-skeleton: skeleton 2s -1s infinite linear;/* Duty-cycled indicator animations: long holds with stepped ramps, so thecompositor updates discrete frames instead of every vsync. */@@ -143,6 +144,15 @@ html[data-mobile-composer-route-transition="true"]::view-transition-old(t3-mobil--color-card: var(--card);--color-foreground: var(--foreground);--color-background: var(--background);+ --color-surface-raised: var(--surface-raised);+ --color-sidebar: var(--sidebar);+ --color-sidebar-foreground: var(--sidebar-foreground);+ --color-sidebar-muted-foreground: var(--sidebar-muted-foreground);+ --color-sidebar-control-surface: var(--sidebar-control-surface);+ --color-sidebar-row-hover: var(--sidebar-row-hover);+ --color-sidebar-row-active: var(--sidebar-row-active);+ --color-sidebar-row-selected: var(--sidebar-row-selected);+ --color-sidebar-border: var(--sidebar-border);--radius-sm: calc(var(--radius) - 4px);--radius-md: calc(var(--radius) - 2px);--radius-lg: var(--radius);@@ -313,7 +323,7 @@ html[data-mobile-composer-route-transition="true"]::view-transition-old(t3-mobil}.chat-composer-glass {- background: color-mix(in srgb, var(--card) 20%, transparent);+ background: var(--surface-raised);}/* Mix from --background (not --card): the lower chrome is a full-width@@ -324,6 +334,14 @@ html[data-mobile-composer-route-transition="true"]::view-transition-old(t3-mobilbackground: color-mix(in srgb, var(--background) 20%, transparent);}+ /* The translucent lower chrome lets the composer's shadow taper naturally+ into the message canvas. Above the terminal drawer that same shadow reads+ as a dirty light-to-black gradient, so end the workspace on an opaque+ surface and let the drawer's border define the boundary instead. */+ .chat-composer-lower-chrome[data-terminal-open="true"] {+ background: var(--background);+ }+.chat-composer-glass {box-shadow:0 18px 48px -20px rgb(0 0 0 / 28%),@@ -336,17 +354,19 @@ html[data-mobile-composer-route-transition="true"]::view-transition-old(t3-mobil}.dark .chat-composer-glass {- background: color-mix(in srgb, var(--card) 45%, transparent);+ background: var(--surface-raised);}.dark .chat-composer-lower-chrome {background: color-mix(in srgb, var(--background) 45%, transparent);}+ .dark .chat-composer-lower-chrome[data-terminal-open="true"] {+ background: var(--background);+ }+.dark .chat-composer-glass {- box-shadow:- 0 18px 48px -20px rgb(0 0 0 / 60%),- 0 4px 14px -7px rgb(0 0 0 / 40%);+ box-shadow: none;}.chat-composer-lower-chrome {@@ -410,24 +430,25 @@ html[data-mobile-composer-route-transition="true"]::view-transition-old(t3-mobil:root {color-scheme: light;--radius: 0.625rem;- --background: var(--color-white);+ --background: var(--color-zinc-25);--app-chrome-background: var(--background);- --foreground: var(--color-neutral-800);+ --surface-raised: color-mix(in srgb, var(--card) 20%, transparent);+ --foreground: var(--color-zinc-800);--card: var(--color-white);- --card-foreground: var(--color-neutral-800);+ --card-foreground: var(--color-zinc-800);--popover: var(--color-white);- --popover-foreground: var(--color-neutral-800);+ --popover-foreground: var(--color-zinc-800);--primary: oklch(0.488 0.217 264);--primary-foreground: var(--color-white);- --secondary: --alpha(var(--color-black) / 4%);- --secondary-foreground: var(--color-neutral-800);- --muted: --alpha(var(--color-black) / 4%);- --muted-foreground: color-mix(in srgb, var(--color-neutral-500) 90%, var(--color-black));- --accent: --alpha(var(--color-black) / 4%);- --accent-foreground: var(--color-neutral-800);+ --secondary: var(--color-zinc-50);+ --secondary-foreground: var(--color-zinc-800);+ --muted: var(--color-zinc-50);+ --muted-foreground: var(--color-zinc-500);+ --accent: var(--color-zinc-100);+ --accent-foreground: var(--color-zinc-900);--destructive: var(--color-red-500);- --border: --alpha(var(--color-black) / 8%);- --input: --alpha(var(--color-black) / 10%);+ --border: var(--color-zinc-200);+ --input: var(--color-zinc-300);--ring: oklch(0.488 0.217 264);--destructive-foreground: var(--color-red-700);--info: var(--color-blue-500);@@ -436,24 +457,35 @@ html[data-mobile-composer-route-transition="true"]::view-transition-old(t3-mobil--success-foreground: var(--color-emerald-700);--warning: var(--color-amber-500);--warning-foreground: var(--color-amber-700);+ /* Fallbacks for standalone sidebar primitives. App sidebars override these+ roles on their own root so the surface hierarchy stays out of page content. */+ --sidebar: var(--card);+ --sidebar-foreground: var(--foreground);+ --sidebar-muted-foreground: var(--muted-foreground);+ --sidebar-control-surface: var(--accent);+ --sidebar-row-hover: var(--accent);+ --sidebar-row-active: var(--accent);+ --sidebar-row-selected: var(--muted);+ --sidebar-border: var(--border);@variant dark {color-scheme: dark;- --background: color-mix(in srgb, var(--color-neutral-950) 95%, var(--color-white));+ --background: var(--color-zinc-950);--app-chrome-background: var(--background);- --foreground: var(--color-neutral-100);- --card: color-mix(in srgb, var(--background) 98%, var(--color-white));- --card-foreground: var(--color-neutral-100);- --popover: color-mix(in srgb, var(--background) 98%, var(--color-white));- --popover-foreground: var(--color-neutral-100);+ --surface-raised: color-mix(in srgb, var(--card) 45%, transparent);+ --foreground: var(--color-zinc-100);+ --card: var(--color-zinc-900);+ --card-foreground: var(--color-zinc-100);+ --popover: var(--color-zinc-900);+ --popover-foreground: var(--color-zinc-100);--primary: oklch(0.588 0.217 264);--primary-foreground: var(--color-white);- --secondary: --alpha(var(--color-white) / 4%);- --secondary-foreground: var(--color-neutral-100);- --muted: --alpha(var(--color-white) / 4%);- --muted-foreground: color-mix(in srgb, var(--color-neutral-500) 90%, var(--color-white));- --accent: --alpha(var(--color-white) / 4%);- --accent-foreground: var(--color-neutral-100);+ --secondary: var(--color-zinc-900);+ --secondary-foreground: var(--color-zinc-100);+ --muted: var(--color-zinc-900);+ --muted-foreground: var(--color-zinc-400);+ --accent: var(--color-zinc-900);+ --accent-foreground: var(--color-zinc-100);--destructive: color-mix(in srgb, var(--color-red-500) 90%, var(--color-white));--border: --alpha(var(--color-white) / 6%);--input: --alpha(var(--color-white) / 8%);@@ -468,39 +500,27 @@ html[data-mobile-composer-route-transition="true"]::view-transition-old(t3-mobil}}-/* Give the navigation rail its own cool graphite surface instead of borrowing- the workspace card color. The scoped semantic tokens keep sidebar v2's- controls in the same palette without changing v1 or the settings nav. */-.app-sidebar {- --background: oklch(0.965 0.009 265);- --foreground: oklch(0.27 0.025 265);- --card: oklch(0.945 0.014 265);- --card-foreground: var(--foreground);- --accent: oklch(0.875 0.008 265);- --accent-foreground: oklch(0.24 0.012 265);- --muted: oklch(0.9 0.018 265);- --muted-foreground: oklch(0.49 0.03 265);- --border: oklch(0.72 0.025 265 / 28%);- --input: oklch(0.62 0.03 265 / 28%);- --sidebar-stage-fade: var(--card);- background-color: var(--card);-}--.dark .app-sidebar {- --background: #000;- --foreground: #f1f3f7;- --card: #000;- --card-foreground: var(--foreground);- --accent: #191a1d;- --accent-foreground: #f7f9ff;- --muted: #0a0a0a;- --muted-foreground: #a3a3a3;- --border: rgb(255 255 255 / 14%);- --input: rgb(255 255 255 / 18%);- /* The stage-channel header art must ramp to THIS panel's surface, not the- global chrome background, or the fade shows a seam (same rule as the- light palette above). */- --sidebar-stage-fade: var(--card);+[data-app-sidebar] {+ --sidebar: var(--color-zinc-50);+ --sidebar-foreground: var(--color-zinc-800);+ --sidebar-muted-foreground: var(--color-zinc-500);+ --sidebar-control-surface: var(--color-zinc-100);+ --sidebar-row-hover: var(--color-zinc-25);+ --sidebar-row-active: var(--color-white);+ --sidebar-row-selected: var(--color-white);+ --sidebar-border: var(--color-zinc-200);+ --sidebar-stage-fade: var(--sidebar);+}++.dark [data-app-sidebar] {+ --sidebar: var(--color-zinc-950);+ --sidebar-foreground: var(--color-zinc-100);+ --sidebar-muted-foreground: var(--color-zinc-400);+ --sidebar-control-surface: var(--color-zinc-800);+ --sidebar-row-hover: var(--color-zinc-900);+ --sidebar-row-active: var(--color-zinc-900);+ --sidebar-row-selected: var(--color-zinc-900);+ --sidebar-border: var(--color-zinc-800);}body {