feat(chat): refine V2 conversation UI (#5307)

This commit is contained in:
maria authored and Julius Marminge committed 2026-08-15 16:51:13 +02:00
1 parent 2a6f05fb43
commit 22d79b30ff
30 files changed
+596 -150

No files matched your search

+1
View File
@@ -79,6 +79,7 @@ Full docs live in [docs/](./docs). There's no docs site yet.
- [Permission modes](./docs/user/permission-modes.md)
- [Keyboard shortcuts](./docs/user/keybindings.md)
- [Customize a project icon](./docs/user/project-settings.md)
- [Appearance preferences](./docs/user/appearance.md)
- [Remote access from a phone or another machine](./docs/user/remote-access.md)
- [Keeping app and server in sync](./docs/user/updating.md)
- [Source control integrations](./docs/user/source-control.md)
@@ -31,6 +31,7 @@ const clientSettings: ClientSettings = {
fontSmoothing: true,
glassOpacity: 80,
planModeEnabled: false,
persistComposerContextStrip: true,
providerModelPreferences: {},
sidebarAutoSettleAfterDays: 3,
sidebarAutoSettleOnMerge: true,
@@ -89,6 +89,20 @@ function assistantMessage(updatedAt = "2026-06-20T00:00:03.000Z") {
}
describe("buildThreadFeed", () => {
it("hides synthetic workspace preparation activity", () => {
const workspacePreparation = projected(
{
...command(),
title: "Workspace ready",
input: "Preparing workspace",
output: "Workspace preparation completed.",
},
0,
);
expect(buildThreadFeed([workspacePreparation])).toEqual([]);
});
it("does not treat a queued-only run as live feed activity", () => {
expect(
threadFeedRunIsUnsettled({
@@ -131,6 +145,33 @@ describe("buildThreadFeed", () => {
).toBe("turn_start");
});
it("hides the interruption request and keeps the terminal result", () => {
const request = projected(
{
...base("item-interrupt-request", "2026-06-20T00:00:02.000Z", 1),
type: "run_interrupt_request",
message: "Interrupt requested",
},
0,
);
const result = projected(
{
...base("item-interrupt-result", "2026-06-20T00:00:03.000Z", 2),
type: "run_interrupt_result",
message: "Run interrupted before provider start",
},
1,
);
const activities = buildThreadFeed([request, result]).flatMap((entry) =>
entry.type === "activity-group" ? entry.activities : [],
);
expect(activities).toHaveLength(1);
expect(activities[0]?.summary).toBe("Run interrupted");
expect(activities[0]?.detail).toBe("Run interrupted before provider start");
});
it("preserves authoritative V2 order instead of sorting reconstructed collections", () => {
const rows = [
projected(userMessage("2026-06-20T00:00:03.000Z"), 0),
+7
View File
@@ -3,6 +3,7 @@ import type {
ThreadPendingUserInput,
ThreadUserInputQuestion,
} from "@t3tools/client-runtime/state/thread-requests";
import { turnItemIsWorkspacePreparation } from "@t3tools/client-runtime/state/turn-item-presentation";
import {
resolveT3McpToolPresentation,
type T3McpToolLogo,
@@ -1048,6 +1049,12 @@ export function buildThreadFeed(
const entries: RawThreadFeedEntry[] = [];
for (const row of visibleTurnItems) {
const item = row.item;
if (turnItemIsWorkspacePreparation(item)) continue;
// Match the web timeline: only the terminal interrupt result is useful to
// users; the preceding request is transient bookkeeping.
if (item.type === "run_interrupt_request") {
continue;
}
const createdAt = DateTime.formatIso(item.startedAt ?? item.updatedAt);
if (item.type === "user_message" || item.type === "assistant_message") {
const updatedAt = DateTime.formatIso(item.updatedAt);
@@ -37,6 +37,7 @@ import {
THREAD_DETAILS_PANEL_ICON_CLASS,
THREAD_DETAILS_PANEL_ROW_POPUP_CLASS,
THREAD_DETAILS_PANEL_ROW_CLASS,
THREAD_DETAILS_PANEL_SELECT_ROW_CLASS,
} from "./chat/threadDetailsPanelStyles";
import { parsePullRequestReference } from "../pullRequestReference";
import { getSourceControlPresentation } from "../sourceControlPresentation";
@@ -772,7 +773,7 @@ export function BranchToolbarBranchSelector({
render={<Button variant="ghost" size={displayMode === "panel" ? "sm" : "xs"} />}
className={cn(
"min-w-0 max-w-full text-muted-foreground/70 hover:text-foreground/80",
displayMode === "panel" && THREAD_DETAILS_PANEL_ROW_CLASS,
displayMode === "panel" && THREAD_DETAILS_PANEL_SELECT_ROW_CLASS,
)}
disabled={isInitialBranchesLoadPending || isBranchActionPending}
>
@@ -793,12 +794,13 @@ export function BranchToolbarBranchSelector({
>
{triggerLabel}
</span>
<ChevronDownIcon
className={cn(
"size-3 shrink-0 opacity-50",
displayMode === "panel" && THREAD_DETAILS_PANEL_CHEVRON_CLASS,
)}
/>
{displayMode === "panel" ? (
<span data-slot="select-icon">
<ChevronDownIcon className={THREAD_DETAILS_PANEL_CHEVRON_CLASS} />
</span>
) : (
<ChevronDownIcon className="size-3 shrink-0 opacity-50" />
)}
</ComboboxTrigger>
</span>
{displayMode === "panel" && branchPr && branchPrStatus ? (
+18 -6
View File
@@ -115,22 +115,32 @@ describe("resolveThreadMetadataUpdateForNextTurn", () => {
});
describe("shouldShowComposerContextStrip", () => {
it("shows git context on a draft with an active project", () => {
it("shows git context while composing a new thread", () => {
expect(
shouldShowComposerContextStrip({
routeKind: "draft",
isDraftHeroState: true,
isGitRepo: true,
hasActiveProject: true,
persistInActiveThreads: false,
}),
).toBe(true);
});
it("hides git context after the draft becomes a thread", () => {
it("keeps git context in an active thread only when requested", () => {
expect(
shouldShowComposerContextStrip({
routeKind: "server",
isDraftHeroState: false,
isGitRepo: true,
hasActiveProject: true,
persistInActiveThreads: true,
}),
).toBe(true);
expect(
shouldShowComposerContextStrip({
isDraftHeroState: false,
isGitRepo: true,
hasActiveProject: true,
persistInActiveThreads: false,
}),
).toBe(false);
});
@@ -138,16 +148,18 @@ describe("shouldShowComposerContextStrip", () => {
it("hides git context without a git-backed project", () => {
expect(
shouldShowComposerContextStrip({
routeKind: "draft",
isDraftHeroState: true,
isGitRepo: false,
hasActiveProject: true,
persistInActiveThreads: true,
}),
).toBe(false);
expect(
shouldShowComposerContextStrip({
routeKind: "draft",
isDraftHeroState: true,
isGitRepo: true,
hasActiveProject: false,
persistInActiveThreads: true,
}),
).toBe(false);
});
+7 -2
View File
@@ -249,11 +249,16 @@ export function resolveSendEnvMode(input: {
}
export function shouldShowComposerContextStrip(input: {
routeKind: "draft" | "server";
isDraftHeroState: boolean;
isGitRepo: boolean;
hasActiveProject: boolean;
persistInActiveThreads: boolean;
}): boolean {
return input.routeKind === "draft" && input.isGitRepo && input.hasActiveProject;
return (
input.isGitRepo &&
input.hasActiveProject &&
(input.isDraftHeroState || input.persistInActiveThreads)
);
}
export function cloneComposerImageForRetry(
+61 -38
View File
@@ -2687,10 +2687,15 @@ function ChatViewContent(props: ChatViewProps) {
// Default true while loading to avoid toolbar flicker.
const isGitRepo = gitStatusQuery.data?.isRepo ?? true;
const showComposerContextStrip = shouldShowComposerContextStrip({
routeKind,
isDraftHeroState,
isGitRepo,
hasActiveProject: activeProject !== null,
persistInActiveThreads: settings.persistComposerContextStrip,
});
const renderComposerContextStrip =
isGitRepo &&
activeProject !== null &&
(routeKind === "draft" || settings.persistComposerContextStrip);
const initialDiffPanelGitScope =
gitStatusQuery.data?.hasWorkingTreeChanges === true ? "unstaged" : "branch";
const diffPanelGitStatusResolutionKey = gitStatusQuery.data ? "resolved" : "pending";
@@ -6248,7 +6253,6 @@ function ChatViewContent(props: ChatViewProps) {
ref={workspaceLayoutRef}
className="relative flex min-h-0 min-w-0 flex-1 overflow-hidden bg-background"
>
{rightPanelOpen && !shouldUsePlanSidebarSheet ? panelLayoutControls : null}
<div
className={cn(
"flex min-h-0 min-w-0 flex-col overflow-x-hidden",
@@ -6261,10 +6265,10 @@ function ChatViewContent(props: ChatViewProps) {
ref={threadPanelPopoverAnchorRef}
data-chat-header
className={cn(
"bg-background transition-[padding-left] duration-200 ease-linear motion-reduce:transition-none",
"relative bg-background transition-[padding-left] duration-200 ease-linear motion-reduce:transition-none",
isElectron
? cn(
"workspace-topbar drag-region relative px-3 sm:px-5",
"workspace-topbar drag-region px-3 sm:px-5",
reserveTitleBarControlInset &&
!inlineRightPanelOwnsTitleBar &&
"wco:pr-[var(--workspace-native-controls-inset)]",
@@ -6511,40 +6515,58 @@ function ChatViewContent(props: ChatViewProps) {
/>
</div>
</div>
<div className="min-h-0">
<div
data-terminal-open={terminalUiState.terminalOpen ? "true" : undefined}
className="relative z-0"
>
{showComposerContextStrip && (
<div className="pointer-events-auto">
<BranchToolbar
environmentId={activeThread.environmentId}
threadId={activeThread.id}
{...(routeKind === "draft" && draftId ? { draftId } : {})}
onEnvModeChange={onEnvModeChange}
startFromOrigin={startFromOrigin}
onStartFromOriginChange={onStartFromOriginChange}
{...(canOverrideServerThreadEnvMode
? { effectiveEnvModeOverride: envMode }
: {})}
{...(canOverrideServerThreadEnvMode
? {
activeThreadBranchOverride: activeThreadBranch,
onActiveThreadBranchOverrideChange:
setPendingServerThreadBranch,
}
: {})}
envLocked={envLocked}
onComposerFocusRequest={scheduleComposerFocus}
{...(canCheckoutPullRequestIntoThread
? { onCheckoutPullRequestRequest: openPullRequestDialog }
: {})}
{...(hasMultipleEnvironments ? { onEnvironmentChange } : {})}
availableEnvironments={logicalProjectEnvironments}
/>
</div>
)}
<div
aria-hidden={!showComposerContextStrip}
className={cn(
"grid transition-[grid-template-rows,opacity,transform] motion-reduce:transition-none",
showComposerContextStrip
? "grid-rows-[1fr] translate-y-0 opacity-100"
: "pointer-events-none grid-rows-[0fr] -translate-y-1 opacity-0",
)}
data-composer-context-strip={
showComposerContextStrip ? "expanded" : "collapsed"
}
inert={showComposerContextStrip ? undefined : true}
style={{
transitionDuration: `${DRAFT_HERO_TRANSITION_DURATION_MS}ms`,
transitionTimingFunction: DRAFT_HERO_TRANSITION_EASING,
}}
>
<div className="min-h-0 overflow-hidden">
<div
data-terminal-open={terminalUiState.terminalOpen ? "true" : undefined}
className="relative z-0"
>
{renderComposerContextStrip && (
<div className="pointer-events-auto">
<BranchToolbar
environmentId={activeThread.environmentId}
threadId={activeThread.id}
{...(routeKind === "draft" && draftId ? { draftId } : {})}
onEnvModeChange={onEnvModeChange}
startFromOrigin={startFromOrigin}
onStartFromOriginChange={onStartFromOriginChange}
{...(canOverrideServerThreadEnvMode
? { effectiveEnvModeOverride: envMode }
: {})}
{...(canOverrideServerThreadEnvMode
? {
activeThreadBranchOverride: activeThreadBranch,
onActiveThreadBranchOverrideChange:
setPendingServerThreadBranch,
}
: {})}
envLocked={envLocked}
onComposerFocusRequest={scheduleComposerFocus}
{...(canCheckoutPullRequestIntoThread
? { onCheckoutPullRequestRequest: openPullRequestDialog }
: {})}
{...(hasMultipleEnvironments ? { onEnvironmentChange } : {})}
availableEnvironments={logicalProjectEnvironments}
/>
</div>
)}
</div>
</div>
</div>
</div>
@@ -6645,6 +6667,7 @@ function ChatViewContent(props: ChatViewProps) {
mode="inline"
maximized={rightPanelMaximized}
inlineSize={previewPanelInlineSize}
layoutControls={panelLayoutControls}
surfaces={rightPanelState.surfaces}
activeSurfaceId={activeRightPanelSurface?.id ?? null}
pendingSurfaceIds={pendingFileSurfaceIds}
@@ -26,6 +26,28 @@ function renderControl(scripts: ReadonlyArray<ProjectScript>) {
);
}
function renderPanelControlWithImportedAction() {
return renderToStaticMarkup(
<ProjectScriptsControl
displayMode="panel"
scripts={[]}
fileScripts={[
{
name: "Setup Worktree",
command: "vp i",
icon: "configure",
runOnWorktreeCreate: true,
},
]}
keybindings={EMPTY_KEYBINDINGS}
onRunScript={() => {}}
onAddScript={async () => undefined as never}
onUpdateScript={async () => undefined as never}
onDeleteScript={async () => undefined as never}
/>,
);
}
function buttonTag(html: string, ariaLabel: string) {
return html.match(new RegExp(`<button[^>]*aria-label="${ariaLabel}"[^>]*>`))?.[0];
}
@@ -62,4 +84,16 @@ describe("ProjectScriptsControl compact controls", () => {
'class="sr-only @3xl/header-actions:not-sr-only @3xl/header-actions:ml-0.5"',
);
});
it("renders available project actions as a full panel row", () => {
const html = renderPanelControlWithImportedAction();
const primary = buttonTag(html, "Project actions");
const menuTrigger = buttonTag(html, "Choose project action");
expect(primary).toContain("flex-1");
expect(primary).toContain("justify-start");
expect(menuTrigger).toContain("w-8");
expect(html).toContain("h-4 w-px");
expect(html).toContain(">Actions</span>");
});
});
@@ -294,26 +294,78 @@ export default function ProjectScriptsControl({
</Menu>
</ActionGroup>
) : importableScripts.length > 0 ? (
<Menu
highlightItemOnHover={false}
open={actionsMenuOpen.imports}
onOpenChange={(open) => setActionsMenuOpen({ scripts: false, imports: open })}
>
<MenuTrigger render={<Button size="xs" variant="outline" aria-label="Project actions" />}>
<PlusIcon className="size-3.5" />
<span className="sr-only @3xl/header-actions:not-sr-only @3xl/header-actions:ml-0.5">
Add action
</span>
<ChevronDownIcon className="size-3.5" />
</MenuTrigger>
<MenuPopup align="end">
{importMenuItems}
<MenuItem className={dropdownItemClassName} onClick={openAddDialog}>
<PlusIcon className="size-4" />
Add action
</MenuItem>
</MenuPopup>
</Menu>
isPanel ? (
<div
role="group"
aria-label="Project actions"
className={THREAD_DETAILS_PANEL_SPLIT_GROUP_CLASS}
ref={panelAnchorRef}
>
<Button
size="sm"
variant="ghost"
className={THREAD_DETAILS_PANEL_SPLIT_PRIMARY_CLASS}
aria-label="Project actions"
onClick={() => setActionsMenuOpen({ scripts: false, imports: true })}
>
<WrenchIcon className={THREAD_DETAILS_PANEL_ICON_CLASS} />
<span className="ml-0.5 min-w-0 truncate">Actions</span>
</Button>
<span aria-hidden="true" className={THREAD_DETAILS_PANEL_SPLIT_SEPARATOR_CLASS} />
<Menu
highlightItemOnHover={false}
open={actionsMenuOpen.imports}
onOpenChange={(open) => setActionsMenuOpen({ scripts: false, imports: open })}
>
<MenuTrigger
render={
<Button
size="sm"
variant="ghost"
className={THREAD_DETAILS_PANEL_SPLIT_SECONDARY_CLASS}
aria-label="Choose project action"
/>
}
>
<ChevronDownIcon className={THREAD_DETAILS_PANEL_CHEVRON_CLASS} />
</MenuTrigger>
<MenuPopup
align="end"
anchor={panelAnchorRef}
className={THREAD_DETAILS_PANEL_ROW_POPUP_CLASS}
>
{importMenuItems}
<MenuItem className={dropdownItemClassName} onClick={openAddDialog}>
<PlusIcon className="size-4" />
Add action
</MenuItem>
</MenuPopup>
</Menu>
</div>
) : (
<Menu
highlightItemOnHover={false}
open={actionsMenuOpen.imports}
onOpenChange={(open) => setActionsMenuOpen({ scripts: false, imports: open })}
>
<MenuTrigger
render={<Button size="xs" variant="outline" aria-label="Project actions" />}
>
<WrenchIcon className="size-3.5" />
<span className="sr-only @3xl/header-actions:not-sr-only @3xl/header-actions:ml-0.5">
Actions
</span>
<ChevronDownIcon className="size-3.5" />
</MenuTrigger>
<MenuPopup align="end">
{importMenuItems}
<MenuItem className={dropdownItemClassName} onClick={openAddDialog}>
<PlusIcon className="size-4" />
Add action
</MenuItem>
</MenuPopup>
</Menu>
)
) : (
<Tooltip>
<TooltipTrigger
@@ -939,7 +939,7 @@ describe("deriveMessagesTimelineRows", () => {
]);
});
it("keeps interruption request, intervening work, and result visible in order", () => {
it("hides the interruption request while keeping intervening work and the result", () => {
const runId = "turn-1" as never;
const interruptEvent = (type: "run_interrupt_request" | "run_interrupt_result") => ({
position: type === "run_interrupt_request" ? 0 : 2,
@@ -1004,11 +1004,7 @@ describe("deriveMessagesTimelineRows", () => {
revertTurnCountByUserMessageId: new Map(),
});
expect(rows.map((row) => row.id)).toEqual([
"interrupt-request",
"work-entry",
"interrupt-result",
]);
expect(rows.map((row) => row.id)).toEqual(["work-entry", "interrupt-result"]);
expect(rows.some((row) => row.kind === "turn-fold")).toBe(false);
});
@@ -572,6 +572,15 @@ export function deriveMessagesTimelineRows(input: {
continue;
}
// The terminal interrupt result is the useful timeline marker. The
// preceding request is transient bookkeeping and duplicates that marker.
if (
timelineEntry.kind === "event" &&
timelineEntry.projectedItem.item.type === "run_interrupt_request"
) {
continue;
}
const turnFold = foldsByAnchorEntryId.get(timelineEntry.id);
if (turnFold) {
nextRows.push({
@@ -520,7 +520,55 @@ describe("MessagesTimeline", () => {
);
expect(markup).toContain("Steered the active turn");
expect(markup).toContain(">steer<");
expect(markup).toContain("lucide-redo-2");
expect(markup).toContain('data-user-message-intent="steer"');
expect(markup).toContain("items-center justify-end gap-1");
expect(markup).toContain("gap-1 text-xs leading-none text-muted-foreground");
expect(markup.indexOf("Steer")).toBeLessThan(markup.indexOf("Adjust the current turn"));
});
it("does not add redundant space below a collapsed turn divider", () => {
const runId = RunId.make("run-collapsed-spacing");
const markup = renderToStaticMarkup(
<MessagesTimeline
{...buildProps()}
timelineEntries={[
buildUserTimelineEntry("Investigate spacing"),
{
id: "assistant-commentary-spacing",
kind: "message",
createdAt: "2026-03-17T19:12:30.000Z",
message: {
id: MessageId.make("assistant-commentary-spacing"),
role: "assistant",
text: "Checking the layout.",
runId,
createdAt: "2026-03-17T19:12:30.000Z",
updatedAt: "2026-03-17T19:12:31.000Z",
streaming: false,
},
},
{
id: "assistant-final-spacing",
kind: "message",
createdAt: "2026-03-17T19:12:32.000Z",
message: {
id: MessageId.make("assistant-final-spacing"),
role: "assistant",
text: "Spacing fixed.",
runId,
createdAt: "2026-03-17T19:12:32.000Z",
updatedAt: "2026-03-17T19:12:33.000Z",
streaming: false,
},
},
]}
/>,
);
expect(markup).toContain('class="pb-0" data-timeline-row-id="turn-fold:');
expect(markup).toContain('data-timeline-row-kind="turn-fold"');
expect(markup).not.toContain("border-b border-border/60");
});
it("shows a collapsed disclosure for superseded attempt output", async () => {
@@ -737,7 +785,7 @@ describe("MessagesTimeline", () => {
expect(markup).toContain("Work Log");
});
it("renders V2 interruption lifecycle entries as standalone rows", async () => {
it("does not render the transient V2 interruption request", async () => {
const { MessagesTimeline } = await import("./MessagesTimeline");
const markup = renderToStaticMarkup(
<MessagesTimeline
@@ -776,9 +824,9 @@ describe("MessagesTimeline", () => {
/>,
);
expect(markup).toContain('data-v2-item-type="run_interrupt_request"');
expect(markup).toContain("Interrupt requested");
expect(markup).toContain("Waiting for the provider to stop.");
expect(markup).not.toContain('data-v2-item-type="run_interrupt_request"');
expect(markup).not.toContain("Interrupt requested");
expect(markup).not.toContain("Waiting for the provider to stop.");
expect(markup).not.toContain("Structured details");
});
@@ -868,6 +916,7 @@ describe("MessagesTimeline", () => {
expect(markup).toContain("GPT 5.6 Sol");
expect(markup).toContain("Claude Fable 5");
expect(markup).not.toContain("Full conversation context");
expect(markup).not.toContain("·");
// Items persisted before models were stamped recover them from the
// projection runs: the handoff's run is the target, the newest earlier
@@ -1334,6 +1383,8 @@ describe("MessagesTimeline", () => {
);
expect(markup).toContain('data-v2-item-type="error"');
expect(markup).toContain('data-v2-event-disclosure="true"');
expect(markup).toContain("<summary");
expect(markup).toContain("Provider error");
expect(markup).toContain("Invalid reasoning effort.");
});
+118 -34
View File
@@ -59,6 +59,7 @@ import {
MousePointerClickIcon,
PaintbrushIcon,
MinusIcon,
Redo2Icon,
SquarePenIcon,
TerminalIcon,
Undo2Icon,
@@ -916,12 +917,16 @@ const TimelineRowContent = memo(function TimelineRowContent({ row }: { row: Time
className={cn(
// Commentary (non-terminal assistant) rows carry no metadata row, so
// they sit closer to the work that follows them.
(row.kind === "message" && row.message.role === "assistant" && !row.showAssistantMeta) ||
row.kind === "work" ||
row.kind === "event" ||
row.kind === "attempt-fold"
? "pb-2"
: "pb-4",
row.kind === "turn-fold"
? "pb-0"
: (row.kind === "message" &&
row.message.role === "assistant" &&
!row.showAssistantMeta) ||
row.kind === "work" ||
row.kind === "event" ||
row.kind === "attempt-fold"
? "pb-2"
: "pb-4",
row.kind === "message" && row.message.role === "assistant" ? "group/assistant" : null,
)}
data-timeline-row-id={row.id}
@@ -975,6 +980,9 @@ function UserTimelineRow({ row }: { row: Extract<TimelineRow, { kind: "message"
Sent by another agent
</p>
) : null}
{row.message.inputIntent && row.message.inputIntent !== "turn_start" ? (
<UserMessageIntentMarker intent={row.message.inputIntent} />
) : null}
<div className="relative max-w-[80%] rounded-2xl bg-accent p-3">
{regularImages.length > 0 && (
<div className="mb-2 grid max-w-[420px] grid-cols-2 gap-2">
@@ -1033,23 +1041,14 @@ function UserTimelineRow({ row }: { row: Extract<TimelineRow, { kind: "message"
markdownCwd={ctx.markdownCwd}
/>
</div>
{(row.message.inputIntent && row.message.inputIntent !== "turn_start") ||
(row.projectedItem &&
row.projectedItem.item.status !== "completed" &&
row.projectedItem.item.status !== "pending" &&
row.projectedItem.item.status !== "waiting") ? (
{row.projectedItem &&
row.projectedItem.item.status !== "completed" &&
row.projectedItem.item.status !== "pending" &&
row.projectedItem.item.status !== "waiting" ? (
<div className="me-1 flex items-center gap-1.5">
{row.message.inputIntent && row.message.inputIntent !== "turn_start" ? (
<UserMessageIntentBadge intent={row.message.inputIntent} />
) : null}
{row.projectedItem &&
row.projectedItem.item.status !== "completed" &&
row.projectedItem.item.status !== "pending" &&
row.projectedItem.item.status !== "waiting" ? (
<span className="rounded-full border border-destructive/25 bg-destructive/8 px-1.5 py-0.5 text-[10px] font-medium text-destructive">
{row.projectedItem.item.status}
</span>
) : null}
<span className="rounded-full border border-destructive/25 bg-destructive/8 px-1.5 py-0.5 text-[10px] font-medium text-destructive">
{row.projectedItem.item.status}
</span>
</div>
) : null}
<div className="flex w-full max-w-[80%] items-center justify-end pe-1 text-xs tabular-nums opacity-0 transition-opacity duration-200 focus-within:opacity-100 group-hover:opacity-100">
@@ -1074,26 +1073,31 @@ function UserTimelineRow({ row }: { row: Extract<TimelineRow, { kind: "message"
);
}
function UserMessageIntentBadge({
function UserMessageIntentMarker({
intent,
}: {
readonly intent: NonNullable<TimelineMessage["inputIntent"]>;
}) {
const presentation =
intent === "queued_turn"
? { label: "queued", className: "border-amber-500/25 bg-amber-500/8 text-amber-700" }
? {
label: "Queued",
icon: null,
}
: intent === "promoted_queued_to_steer"
? {
label: "queued → steer",
className: "border-sky-500/25 bg-sky-500/8 text-sky-700",
label: "Steer",
icon: Redo2Icon,
}
: { label: "steer", className: "border-sky-500/25 bg-sky-500/8 text-sky-700" };
: {
label: "Steer",
icon: Redo2Icon,
};
const IntentIcon = presentation.icon;
return (
<span
className={cn(
"me-1 rounded-full border px-1.5 py-0.5 text-[10px] font-medium tracking-wide",
presentation.className,
)}
<div
className="me-1 flex items-center justify-end gap-1 text-xs leading-none text-muted-foreground"
data-user-message-intent={intent}
title={
intent === "queued_turn"
? "Queued behind the active turn"
@@ -1102,8 +1106,9 @@ function UserMessageIntentBadge({
: "Steered the active turn"
}
>
{IntentIcon ? <IntentIcon aria-hidden="true" className="size-3" /> : null}
{presentation.label}
</span>
</div>
);
}
@@ -1137,7 +1142,7 @@ function TurnFoldTimelineRow({ row }: { row: Extract<TimelineRow, { kind: "turn-
const Icon = row.expanded ? ChevronDownIcon : ChevronRightIcon;
return (
<div className="border-b border-border/60 pb-2 pt-1">
<div className="pb-2 pt-1">
<button
type="button"
aria-expanded={row.expanded}
@@ -1416,6 +1421,85 @@ function V2EventTimelineRow({ row }: { row: Extract<TimelineRow, { kind: "event"
}
const presentation = v2EventPresentation(item);
const Icon = presentation.icon;
if (item.type === "error") {
return (
<details
className={cn(
"group rounded-md border",
presentation.tone === "warning" && "border-amber-500/25 bg-amber-500/5",
presentation.tone === "danger" && "border-destructive/25 bg-destructive/5",
presentation.tone === "success" && "border-emerald-500/20 bg-emerald-500/5",
)}
data-v2-item-type={item.type}
data-v2-item-visibility={visibility}
data-v2-event-disclosure="true"
>
<summary className="flex min-w-0 cursor-pointer list-none items-center gap-2 px-2.5 py-1.5 text-xs [&::-webkit-details-marker]:hidden">
<Icon
className={cn(
"size-3.5 shrink-0",
presentation.tone === "warning" && "text-amber-600 dark:text-amber-400",
presentation.tone === "danger" && "text-destructive",
presentation.tone === "success" && "text-emerald-600 dark:text-emerald-400",
)}
/>
<span className="shrink-0 font-medium text-foreground/90">{presentation.label}</span>
{item.status !== "completed" ? (
<span
className={cn(
"shrink-0 rounded-full border px-1.5 py-0.5 font-mono text-[10px]",
item.status === "failed"
? "border-destructive/40 text-destructive"
: "border-border/70 text-muted-foreground",
)}
>
{item.status}
</span>
) : null}
{presentation.detail ? (
<span className="min-w-0 flex-1 truncate text-muted-foreground/65">
{presentation.detail}
</span>
) : null}
{visibility !== "local" ? (
<span className="shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground">
{visibility === "inherited" ? "Inherited" : "Synthetic"}
</span>
) : null}
<ChevronDownIcon className="size-3 shrink-0 text-muted-foreground/60 transition-transform group-open:rotate-180" />
</summary>
<div className="border-t border-border/45 px-3 py-2 ps-8">
{presentation.detail ? (
<div className="text-xs leading-relaxed text-muted-foreground">
<ChatMarkdown
text={presentation.detail}
cwd={ctx.markdownCwd}
threadRef={ctx.threadRef ?? undefined}
skills={ctx.skills}
lineBreaks
/>
</div>
) : null}
{visibility === "inherited" ? (
<p className="mt-1 font-mono text-[10px] text-muted-foreground/65">
From {sourceThreadId}
</p>
) : null}
<div className={presentation.detail ? "mt-2" : undefined}>
<V2ItemInspector
projectedItem={row.projectedItem}
environmentId={ctx.activeThreadEnvironmentId}
cwd={ctx.markdownCwd}
workspaceRoot={ctx.workspaceRoot}
onOpenThread={ctx.onOpenThread}
onOpenTurnDiff={ctx.onOpenTurnDiff}
onRollbackCheckpoint={ctx.onRollbackCheckpoint}
/>
</div>
</div>
</details>
);
}
return (
<section
className={cn(
@@ -108,7 +108,7 @@ export function ThreadDetailsPanel(props: ThreadDetailsPanelProps) {
const card = (
<div
className={cn(
"panel-glass overflow-hidden rounded-[20px]",
"dropdown-glass isolate contain-paint overflow-hidden rounded-[20px]",
props.mode === "inline" ? "max-h-full" : "max-h-[calc(100dvh-6.5rem)]",
)}
data-thread-details-card
@@ -8,6 +8,7 @@ export function TimelineSystemDivider(props: {
readonly detail?: ReactNode | null;
readonly tone?: "neutral" | "danger";
readonly icon?: LucideIcon;
readonly showDetailSeparator?: boolean;
readonly actionLabel?: string;
readonly onAction?: () => void;
}) {
@@ -16,7 +17,12 @@ export function TimelineSystemDivider(props: {
<>
{Icon ? <Icon className="size-3 shrink-0" /> : null}
<span className="font-medium">{props.label}</span>
{props.detail ? <span className="max-w-80 truncate opacity-70">· {props.detail}</span> : null}
{props.detail ? (
<span className="inline-flex min-w-0 max-w-80 items-center truncate opacity-70">
{props.showDetailSeparator === false ? null : "·\u00a0"}
{props.detail}
</span>
) : null}
</>
);
@@ -8,6 +8,7 @@ import type {
} from "@t3tools/contracts";
import type { TimestampFormat } from "@t3tools/contracts/settings";
import {
ArrowRightLeftIcon,
ArrowRightIcon,
BotIcon,
ChevronDownIcon,
@@ -17,7 +18,6 @@ import {
MinusIcon,
type LucideIcon,
XIcon,
ZapIcon,
} from "lucide-react";
import { getProviderInstanceEntry } from "../../providerInstances";
@@ -142,7 +142,8 @@ export function V2LifecycleRow(props: {
return (
<TimelineSystemDivider
label="Context handoff"
icon={ZapIcon}
icon={ArrowRightLeftIcon}
showDetailSeparator={false}
tone={item.status === "failed" ? "danger" : "neutral"}
detail={
<span className="inline-flex min-w-0 items-center gap-1.5">
@@ -11,11 +11,8 @@ import {
type SidebarProjectGroupingMode,
} from "@t3tools/contracts";
import { scopeThreadRef } from "@t3tools/client-runtime/environment";
<<<<<<< HEAD
=======
import { presentThreadShell } from "@t3tools/client-runtime/state/shell";
import { safeErrorLogAttributes } from "@t3tools/client-runtime/errors";
>>>>>>> 79c36e6204 (Complete orchestration V2 frontend cutover)
import {
isAtomCommandInterrupted,
settlePromise,
@@ -657,6 +654,8 @@ export function useSettingsRestore(onRestored?: () => void) {
settings.fontSizeTerminal,
settings.glassOpacity,
settings.enableLegacyTokenStreaming,
settings.persistComposerContextStrip,
settings.enableAssistantStreaming,
settings.enableProviderUpdateChecks,
settings.sidebarAutoSettleAfterDays,
settings.sidebarAutoSettleOnMerge,
@@ -735,6 +734,7 @@ export function useSettingsRestore(onRestored?: () => void) {
updateSettings({
timestampFormat: DEFAULT_UNIFIED_SETTINGS.timestampFormat,
wordWrap: DEFAULT_UNIFIED_SETTINGS.wordWrap,
persistComposerContextStrip: DEFAULT_UNIFIED_SETTINGS.persistComposerContextStrip,
diffIgnoreWhitespace: DEFAULT_UNIFIED_SETTINGS.diffIgnoreWhitespace,
environmentIdentificationMode: DEFAULT_UNIFIED_SETTINGS.environmentIdentificationMode,
glassOpacity: DEFAULT_UNIFIED_SETTINGS.glassOpacity,
@@ -1180,6 +1180,58 @@ export function AppearanceSettingsPanel() {
}
/>
) : null}
<SettingsRow
{...searchableSetting("word-wrap")}
description="Wrap long lines in code blocks, tables, diffs, and file previews by default."
resetAction={
settings.wordWrap !== DEFAULT_UNIFIED_SETTINGS.wordWrap ? (
<SettingResetButton
label="word wrapping"
onClick={() =>
updateSettings({
wordWrap: DEFAULT_UNIFIED_SETTINGS.wordWrap,
})
}
/>
) : null
}
control={
<Switch
checked={settings.wordWrap}
onCheckedChange={(checked) => updateSettings({ wordWrap: Boolean(checked) })}
aria-label="Wrap code, tables, diffs, and file previews by default"
/>
}
/>
<SettingsRow
{...searchableSetting("composer-context")}
description="Keep branch and worktree controls below the composer after a thread starts."
resetAction={
settings.persistComposerContextStrip !==
DEFAULT_UNIFIED_SETTINGS.persistComposerContextStrip ? (
<SettingResetButton
label="composer context"
onClick={() =>
updateSettings({
persistComposerContextStrip:
DEFAULT_UNIFIED_SETTINGS.persistComposerContextStrip,
})
}
/>
) : null
}
control={
<Switch
checked={settings.persistComposerContextStrip}
onCheckedChange={(checked) =>
updateSettings({ persistComposerContextStrip: Boolean(checked) })
}
aria-label="Keep composer context visible in active threads"
/>
}
/>
</SettingsSection>
<TypographySection />
@@ -84,6 +84,10 @@ describe("searchSettings", () => {
id: "word-wrap",
to: "/settings/appearance",
});
expect(searchSettings("composer context")[0]).toMatchObject({
id: "composer-context",
to: "/settings/appearance",
});
expect(searchSettings("environment identification")[0]).toMatchObject({
id: "environment-identification",
to: "/settings/appearance",
@@ -100,6 +100,11 @@ export const SETTINGS_SEARCH_ITEMS = [
title: "Word wrap",
to: "/settings/appearance",
},
{
id: "composer-context",
title: "Composer context",
to: "/settings/appearance",
},
{
id: "project-grouping",
title: "Project grouping",
+1 -25
View File
@@ -933,25 +933,6 @@ html[data-mobile-composer-route-transition="true"]::view-transition-old(t3-mobil
box-shadow: 0 16px 40px -18px rgb(0 0 0 / 55%);
}
.panel-glass {
position: relative;
isolation: isolate;
contain: paint;
clip-path: inset(0 round 20px);
border: 1px solid color-mix(in srgb, var(--foreground) 10%, transparent);
box-shadow: inset 0 1px rgb(255 255 255 / 8%);
}
.panel-glass::before {
position: absolute;
z-index: -1;
inset: 0;
background: color-mix(in srgb, var(--background) var(--glass-opacity), transparent);
content: "";
-webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
}
.dialog-glass {
border-color: color-mix(in srgb, var(--foreground) 10%, transparent);
box-shadow: 0 24px 64px -24px rgb(0 0 0 / 65%);
@@ -961,10 +942,6 @@ html[data-mobile-composer-route-transition="true"]::view-transition-old(t3-mobil
box-shadow: 0 18px 44px -18px rgb(0 0 0 / 80%);
}
.dark .panel-glass {
box-shadow: inset 0 1px rgb(255 255 255 / 4%);
}
.dark .model-picker-surface.model-picker-surface {
background: color-mix(
in srgb,
@@ -1447,8 +1424,7 @@ html[data-mobile-composer-route-transition="true"]::view-transition-old(t3-mobil
}
.dialog-glass,
.dropdown-glass,
.panel-glass::before {
.dropdown-glass {
background: var(--popover) !important;
}
}
+9
View File
@@ -297,6 +297,14 @@ describe("V2 session presentation", () => {
targetProviderInstanceId: ProviderInstanceId.make("claude-default"),
targetModel: "claude-sonnet-4-6",
} satisfies OrchestrationV2TurnItem;
const workspacePreparationItem = {
...base("item-workspace-preparation", 7),
type: "command_execution" as const,
title: "Workspace ready",
input: "Preparing workspace",
output: "Workspace preparation completed.",
exitCode: 0,
} satisfies OrchestrationV2TurnItem;
const visibleTurnItems: ReadonlyArray<OrchestrationV2ProjectedTurnItem> = [
userItem,
requestItem,
@@ -305,6 +313,7 @@ describe("V2 session presentation", () => {
todoItem,
errorItem,
threadCreatedItem,
workspacePreparationItem,
].map((item, position) => ({
position,
visibility: "local" as const,
+2
View File
@@ -16,6 +16,7 @@ import type {
ThreadPendingUserInput,
} from "@t3tools/client-runtime/state/thread-requests";
import type { ThreadRunSummary, ThreadRuntimeSummary } from "@t3tools/client-runtime/state/shell";
import { turnItemIsWorkspacePreparation } from "@t3tools/client-runtime/state/turn-item-presentation";
import type { ChatMessage, ProposedPlan, SessionPhase, TurnDiffSummary } from "./types";
import * as DateTime from "effect/DateTime";
@@ -619,6 +620,7 @@ export function deriveTimelineEntriesFromVisibleTurnItems(input: {
for (const row of input.visibleTurnItems) {
const { item } = row;
if (turnItemIsWorkspacePreparation(item)) continue;
const createdAt = projectedItemCreatedAt(row);
const attempt = resolveAttempt(item);
const attemptMetadata = attempt === undefined ? {} : { attempt };
+1
View File
@@ -12,6 +12,7 @@
=======
>>>>>>> 290392fac9 (fix: reconcile rebase with latest main)
- [Remote access](./user/remote-access.md)
- [Appearance](./user/appearance.md)
- [Keeping app and server in sync](./user/updating.md)
- [Source control integrations](./user/source-control.md)
- [Background service (Linux)](./user/background-service.md)
+11
View File
@@ -0,0 +1,11 @@
# Appearance
Open **Settings → Appearance** to change how T3 Code presents the interface.
## Composer context
Git-backed projects show branch and worktree controls below the composer while you create a thread.
The controls retreat as the composer docks after you send the first message.
Turn on **Composer context** to keep those controls visible after the thread starts. This preference
applies to the web and desktop clients.
+4
View File
@@ -171,6 +171,10 @@
"types": "./src/state/threadSearch.ts",
"default": "./src/state/threadSearch.ts"
},
"./state/turn-item-presentation": {
"types": "./src/state/turnItemPresentation.ts",
"default": "./src/state/turnItemPresentation.ts"
},
"./state/vcs": {
"types": "./src/state/vcs.ts",
"default": "./src/state/vcs.ts"
@@ -0,0 +1,36 @@
import { RunId, ThreadId, TurnItemId, type OrchestrationV2TurnItem } from "@t3tools/contracts";
import * as DateTime from "effect/DateTime";
import { describe, expect, it } from "vite-plus/test";
import { turnItemIsWorkspacePreparation } from "./turnItemPresentation.ts";
function command(input: string): OrchestrationV2TurnItem {
const now = DateTime.makeUnsafe("2026-08-03T00:00:00.000Z");
return {
id: TurnItemId.make("item-command"),
threadId: ThreadId.make("thread-1"),
runId: RunId.make("run-1"),
nodeId: null,
providerThreadId: null,
providerTurnId: null,
nativeItemRef: null,
parentItemId: null,
ordinal: 1,
status: "completed",
title: "Workspace ready",
startedAt: now,
completedAt: now,
updatedAt: now,
type: "command_execution",
input,
output: "Workspace preparation completed.",
exitCode: 0,
};
}
describe("turnItemIsWorkspacePreparation", () => {
it("identifies the synthetic workspace preparation command", () => {
expect(turnItemIsWorkspacePreparation(command("Preparing workspace"))).toBe(true);
expect(turnItemIsWorkspacePreparation(command("prepare workspace"))).toBe(false);
});
});
@@ -0,0 +1,8 @@
import type { OrchestrationV2TurnItem } from "@t3tools/contracts";
const WORKSPACE_PREPARATION_INPUT = "Preparing workspace";
/** Workspace setup is client bookkeeping; preparation failures have their own error item. */
export function turnItemIsWorkspacePreparation(item: OrchestrationV2TurnItem): boolean {
return item.type === "command_execution" && item.input === WORKSPACE_PREPARATION_INPUT;
}
+9
View File
@@ -16,6 +16,15 @@ const decodeServerSettings = Schema.decodeUnknownSync(ServerSettings);
const decodeServerSettingsPatch = Schema.decodeUnknownSync(ServerSettingsPatch);
const encodeServerSettings = Schema.encodeSync(ServerSettings);
describe("ClientSettings composer context strip", () => {
it("defaults to draft-only and accepts a persistent strip preference", () => {
expect(decodeClientSettings({}).persistComposerContextStrip).toBe(false);
expect(
decodeClientSettingsPatch({ persistComposerContextStrip: true }).persistComposerContextStrip,
).toBe(true);
});
});
describe("ClientSettings word wrap", () => {
it("defaults word wrap on", () => {
expect(decodeClientSettings({}).wordWrap).toBe(true);
+4
View File
@@ -146,6 +146,9 @@ export const ClientSettingsSchema = Schema.Struct({
// Grayscale `-webkit-font-smoothing: antialiased` (thinner strokes);
// disabling restores the platform's heavier default. No effect off macOS.
fontSmoothing: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(true))),
persistComposerContextStrip: Schema.Boolean.pipe(
Schema.withDecodingDefault(Effect.succeed(false)),
),
// Model favorites. Historically keyed by provider kind, now
// widened to `ProviderInstanceId` so users can favorite a specific model
// on a custom provider instance (e.g. "Codex Personal · gpt-5") without
@@ -804,6 +807,7 @@ export const ClientSettingsPatch = Schema.Struct({
fontFamilySans: Schema.optionalKey(FontFamilyPreference),
fontFamilyTerminal: Schema.optionalKey(FontFamilyPreference),
fontSmoothing: Schema.optionalKey(Schema.Boolean),
persistComposerContextStrip: Schema.optionalKey(Schema.Boolean),
favorites: Schema.optionalKey(
Schema.Array(
Schema.Struct({