Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions apps/web/src/components/ChatView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,6 @@ import {
makeThreadErrorSetter,
} from "./ChatView.logic";

const activityCollapsedThreadsSchema = Schema.NullOr(Schema.Record(Schema.String, Schema.Boolean));

const EMPTY_SEEN_MESSAGES: ReadonlyArray<SeenMessage> = [];
const EMPTY_PROVIDERS: ServerProvider[] = [];
const ACTIVE_RUN_STATUSES: ReadonlySet<string> = new Set([
Expand Down Expand Up @@ -2006,22 +2004,6 @@ export default function ChatView(props: ChatViewProps) {
selectThreadPanelOpen(state.threadPanelVisibilityByThreadKey, activeThreadRef, "inline"),
);
const isStandingBot = activeStanding !== null;
const [activityCollapsedThreads, setActivityCollapsedThreads] = useLocalStorage(
"t3code:activity-collapsed-threads",
null,
activityCollapsedThreadsSchema,
);
const activityCollapsed =
activeThreadKey === null ||
activityCollapsedThreads === null ||
activityCollapsedThreads[activeThreadKey] !== false;
const toggleActivityCollapsed = () => {
if (activeThreadKey === null) return;
setActivityCollapsedThreads((stored) => ({
...stored,
[activeThreadKey]: !activityCollapsed,
}));
};
// oxlint-disable-next-line t3code/no-unreasoned-state-sync -- folds a bot's details card (branch, worktree, PR) the first time this client shows that bot; the panel toggle reopens it and that choice persists
useEffect(() => {
if (!isStandingBot || !activeThreadRef || !activeThreadKey) return;
Expand Down Expand Up @@ -3769,11 +3751,6 @@ export default function ChatView(props: ChatViewProps) {
{...(threadFindEnabled ? { onFindInThread: openThreadFindStable } : {})}
standing={activeStanding}
botAvatarState={activeBotAvatarState}
activityCollapsed={
isServerThread && activeThreadKey !== null
? { on: activityCollapsed, onToggle: toggleActivityCollapsed }
: null
}
/>
</header>
)}
Expand Down Expand Up @@ -3831,7 +3808,6 @@ export default function ChatView(props: ChatViewProps) {
entriesInput={timelineEntriesInput}
draftEntries={isServerThread ? null : draftTimelineEntries}
activeThreadKey={activeThreadKey}
collapseActivity={activityCollapsed}
unseenDivider={unseenDivider}
includeOtherActivity={isStandingBot}
decisionRequestedAt={
Expand Down
48 changes: 0 additions & 48 deletions apps/web/src/components/chat/ChatHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,6 @@ interface ChatHeaderProps {
standing?: ThreadStanding | null | undefined;
/** Drives the bot avatar's motion in the header; idle when absent. */
botAvatarState?: BotAvatarState | undefined;
/**
* Collapse agent, automation and system activity, or null when the thread has
* no toggle. A standing thread passes it.
*/
activityCollapsed?: { readonly on: boolean; readonly onToggle: () => void } | null | undefined;
}

function resolveRenameCommit(input: {
Expand Down Expand Up @@ -97,7 +92,6 @@ export const ChatHeader = memo(function ChatHeader({
onFindInThread,
standing,
botAvatarState,
activityCollapsed = null,
}: ChatHeaderProps) {
const gt = useGT();
const activeProjectName = activeProject?.isScratch ? gt("No project") : activeProject?.title;
Expand Down Expand Up @@ -300,7 +294,6 @@ export const ChatHeader = memo(function ChatHeader({
</span>
) : null}
<span className="flex-1" />
<ActivityViewToggle collapsed={activityCollapsed} />
{isServerThread ? <GuestShareIndicator threadRef={activeThreadRef} /> : null}
</div>
);
Expand Down Expand Up @@ -469,47 +462,6 @@ export const ChatHeader = memo(function ChatHeader({
</WorkspaceBreadcrumbItem>
</WorkspaceBreadcrumb>
{isServerThread ? <GuestShareIndicator threadRef={activeThreadRef} /> : null}
<ActivityViewToggle collapsed={activityCollapsed} />
</div>
);
});

/**
* Switches the timeline between the founder's conversation and everything that
* happened in the thread. Absent when the thread has nothing to collapse.
*/
function ActivityViewToggle({
collapsed,
}: {
collapsed: { readonly on: boolean; readonly onToggle: () => void } | null;
}) {
const gt = useGT();
if (collapsed === null) return null;
const label = collapsed.on ? gt("Human conversation") : gt("All activity");
return (
<Tooltip>
<TooltipTrigger
render={
<button
type="button"
aria-pressed={collapsed.on}
onClick={collapsed.onToggle}
className={cn(
"shrink-0 cursor-pointer rounded-full border px-2 py-0.5 text-xs transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",
collapsed.on
? "border-border bg-muted/60 text-foreground hover:bg-muted"
: "border-transparent text-muted-foreground hover:text-foreground",
)}
/>
}
>
{label}
</TooltipTrigger>
<TooltipPopup side="bottom">
{collapsed.on
? gt("Agent, automation and system updates are collapsed. Click to show everything.")
: gt("Showing everything. Click to keep only your messages and the replies to them.")}
</TooltipPopup>
</Tooltip>
);
}
23 changes: 18 additions & 5 deletions apps/web/src/components/chat/MessagesTimeline.browser.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -657,15 +657,23 @@ describe("MessagesTimeline messages", () => {

it("keeps the first and last message headings reachable from either end", async () => {
setup();
const props = { ...baseProps(), collapseActivity: false };
const props = baseProps();
// Folded messages at both ends: their headings must not live inside the fold.
const entries = Array.from({ length: 120 }, (_, index) =>
index === 0
? message("First turn", { scheduledTaskId: TASK_ID }, "turn-0")
? message(
"First turn",
{ scheduledTaskId: TASK_ID, timelineVisibility: "user_timeline" },
"turn-0",
)
: index === 119
? message(
"Last turn",
{ createdBy: "agent", senderThreadId: ThreadId.make("thread-sender") },
{
createdBy: "agent",
senderThreadId: ThreadId.make("thread-sender"),
timelineVisibility: "user_timeline",
},
"turn-119",
)
: message(
Expand Down Expand Up @@ -1706,12 +1714,17 @@ describe("MessagesTimeline agent messages", () => {
const onOpenThread = vi.fn();
await using screen = await renderTimeline(
[
message(AGENT_MESSAGE, { createdBy: "agent", senderThreadId: SENDER_THREAD_ID }),
message(AGENT_MESSAGE, {
createdBy: "agent",
senderThreadId: SENDER_THREAD_ID,
timelineVisibility: "user_timeline",
}),
// Sent from a linked environment this client does not reach.
message(
"Linked review finished",
{
createdBy: "agent",
timelineVisibility: "user_timeline",
linkedSender: {
environmentId: EnvironmentId.make("environment-linked"),
threadId: SENDER_THREAD_ID,
Expand All @@ -1721,7 +1734,7 @@ describe("MessagesTimeline agent messages", () => {
"message-linked",
),
],
{ onOpenThread, collapseActivity: false },
{ onOpenThread },
);
const row = screen.button(/^Agent/);
expect(row.textContent).toContain("Review finished");
Expand Down
9 changes: 1 addition & 8 deletions apps/web/src/components/chat/MessagesTimeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -368,12 +368,6 @@ interface MessagesTimelineProps {
activeFindMatch?: ThreadFindMatch | null;
findNavigationId?: number;
findSender?: OrchestrationMessageSenderFilter | null;
/**
* Collapse runs of agent, automation and system activity into expandable
* pills, leaving the founder's messages and the model's replies to them.
* Off by default; a standing thread turns it on.
*/
collapseActivity?: boolean;
/** Messages that arrived after the place the viewer had been shown; draws a divider and a jump pill. */
unseenDivider?: { readonly afterMessageId: MessageId; readonly count: number } | null;
includeOtherActivity?: boolean;
Expand Down Expand Up @@ -431,7 +425,6 @@ const ConversationTimeline = memo(function ConversationTimeline({
activeFindMatch = null,
findNavigationId = 0,
findSender = null,
collapseActivity = true,
unseenDivider = null,
includeOtherActivity = false,
decisionRequestedAt,
Expand Down Expand Up @@ -868,7 +861,7 @@ const ConversationTimeline = memo(function ConversationTimeline({
const senderRows = useSenderFilteredRows(stableRows, findSender);
// A sender filter already removed every other message, so collapsing what it
// kept would hide the very rows it was asked to show.
const collapseRows = collapseActivity && findSender === null;
const collapseRows = findSender === null;
const chatter = collapseRows
? timelineActivityContext(
timelineEntries,
Expand Down
4 changes: 0 additions & 4 deletions apps/web/src/i18n/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -3485,10 +3485,6 @@
"890c34762a621a66": "Übergeordneten Thread öffnen: {title}",
"7514746d2bd43a1c": "Thread-Titel",
"ab42a6d2ab6073d9": "Thread-Aktionen für {title}",
"15996382e99119d3": "Human conversation",
"339ee12600085fde": "All activity",
"1af5644d639848d5": "Agent, automation and system updates are collapsed. Click to show everything.",
"a6643567147e574a": "Showing everything. Click to keep only your messages and the replies to them.",
"cd8fd5a47060164b": [
"Neuer Thread in ",
{
Expand Down
4 changes: 0 additions & 4 deletions apps/web/src/i18n/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3484,10 +3484,6 @@
"890c34762a621a66": "Open parent thread: {title}",
"7514746d2bd43a1c": "Thread title",
"ab42a6d2ab6073d9": "Thread actions for {title}",
"15996382e99119d3": "Human conversation",
"339ee12600085fde": "All activity",
"1af5644d639848d5": "Agent, automation and system updates are collapsed. Click to show everything.",
"a6643567147e574a": "Showing everything. Click to keep only your messages and the replies to them.",
"cd8fd5a47060164b": [
"New thread in ",
{
Expand Down
4 changes: 0 additions & 4 deletions apps/web/src/i18n/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -3484,10 +3484,6 @@
"890c34762a621a66": "Abrir el hilo principal: {title}",
"7514746d2bd43a1c": "Título del hilo",
"ab42a6d2ab6073d9": "Acciones del hilo {title}",
"15996382e99119d3": "Human conversation",
"339ee12600085fde": "All activity",
"1af5644d639848d5": "Agent, automation and system updates are collapsed. Click to show everything.",
"a6643567147e574a": "Showing everything. Click to keep only your messages and the replies to them.",
"cd8fd5a47060164b": [
"Nuevo hilo en ",
{
Expand Down
4 changes: 0 additions & 4 deletions apps/web/src/i18n/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -3484,10 +3484,6 @@
"890c34762a621a66": "Ouvrir le fil parent : {title}",
"7514746d2bd43a1c": "Titre du fil",
"ab42a6d2ab6073d9": "Actions du fil {title}",
"15996382e99119d3": "Human conversation",
"339ee12600085fde": "All activity",
"1af5644d639848d5": "Agent, automation and system updates are collapsed. Click to show everything.",
"a6643567147e574a": "Showing everything. Click to keep only your messages and the replies to them.",
"cd8fd5a47060164b": [
"Nouveau fil dans ",
{
Expand Down
4 changes: 0 additions & 4 deletions apps/web/src/i18n/translations/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -3482,10 +3482,6 @@
"890c34762a621a66": "親スレッドを開く: {title}",
"7514746d2bd43a1c": "スレッドのタイトル",
"ab42a6d2ab6073d9": "{title} のスレッド操作",
"15996382e99119d3": "Human conversation",
"339ee12600085fde": "All activity",
"1af5644d639848d5": "Agent, automation and system updates are collapsed. Click to show everything.",
"a6643567147e574a": "Showing everything. Click to keep only your messages and the replies to them.",
"cd8fd5a47060164b": [
{
"i": 1,
Expand Down
4 changes: 0 additions & 4 deletions apps/web/src/i18n/translations/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -3482,10 +3482,6 @@
"890c34762a621a66": "상위 스레드 열기: {title}",
"7514746d2bd43a1c": "스레드 제목",
"ab42a6d2ab6073d9": "{title} 스레드 작업",
"15996382e99119d3": "Human conversation",
"339ee12600085fde": "All activity",
"1af5644d639848d5": "Agent, automation and system updates are collapsed. Click to show everything.",
"a6643567147e574a": "Showing everything. Click to keep only your messages and the replies to them.",
"cd8fd5a47060164b": [
{
"i": 1,
Expand Down
4 changes: 0 additions & 4 deletions apps/web/src/i18n/translations/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -3484,10 +3484,6 @@
"890c34762a621a66": "Abrir a thread principal: {title}",
"7514746d2bd43a1c": "Título da thread",
"ab42a6d2ab6073d9": "Ações da thread {title}",
"15996382e99119d3": "Human conversation",
"339ee12600085fde": "All activity",
"1af5644d639848d5": "Agent, automation and system updates are collapsed. Click to show everything.",
"a6643567147e574a": "Showing everything. Click to keep only your messages and the replies to them.",
"cd8fd5a47060164b": [
"Nova thread em ",
{
Expand Down
4 changes: 0 additions & 4 deletions apps/web/src/i18n/translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -3484,10 +3484,6 @@
"890c34762a621a66": "Открыть родительский тред: {title}",
"7514746d2bd43a1c": "Название треда",
"ab42a6d2ab6073d9": "Действия с тредом «{title}»",
"15996382e99119d3": "Human conversation",
"339ee12600085fde": "All activity",
"1af5644d639848d5": "Agent, automation and system updates are collapsed. Click to show everything.",
"a6643567147e574a": "Showing everything. Click to keep only your messages and the replies to them.",
"cd8fd5a47060164b": [
"Новый тред в ",
{
Expand Down
4 changes: 0 additions & 4 deletions apps/web/src/i18n/translations/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -3484,10 +3484,6 @@
"890c34762a621a66": "Öppna överordnad tråd: {title}",
"7514746d2bd43a1c": "Trådtitel",
"ab42a6d2ab6073d9": "Trådåtgärder för {title}",
"15996382e99119d3": "Human conversation",
"339ee12600085fde": "All activity",
"1af5644d639848d5": "Agent, automation and system updates are collapsed. Click to show everything.",
"a6643567147e574a": "Showing everything. Click to keep only your messages and the replies to them.",
"cd8fd5a47060164b": [
"Ny tråd i ",
{
Expand Down
4 changes: 0 additions & 4 deletions apps/web/src/i18n/translations/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -3488,10 +3488,6 @@
"890c34762a621a66": "打开父会话:{title}",
"7514746d2bd43a1c": "会话标题",
"ab42a6d2ab6073d9": "{title} 的会话操作",
"15996382e99119d3": "Human conversation",
"339ee12600085fde": "All activity",
"1af5644d639848d5": "Agent, automation and system updates are collapsed. Click to show everything.",
"a6643567147e574a": "Showing everything. Click to keep only your messages and the replies to them.",
"cd8fd5a47060164b": [
"在 ",
{
Expand Down
9 changes: 7 additions & 2 deletions qa/features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,11 @@ export const FEATURES: ReadonlyArray<Feature> = [
drive: [
"open a seeded thread",
"expect the breadcrumb with project and title",
"expect no Human conversation or All activity mode control",
"open Thread actions",
],
success: "Breadcrumb names the project and thread; the actions menu opens.",
success:
"Breadcrumb names the project and thread; the actions menu opens; no separate timeline mode is offered.",
code: [`${C}chat/ChatHeader.tsx`],
}),
f({
Expand Down Expand Up @@ -183,10 +185,13 @@ export const FEATURES: ReadonlyArray<Feature> = [
path: "A thread whose turn ran a command.",
drive: [
"open the command-output thread",
"reload with each legacy conversation-mode override",
"open the agent updates strip",
"expect the command text and its output",
"close the strip and expect the legacy override unchanged",
],
success: "Command and output text are readable in the timeline.",
success:
"Command and output text are readable through inline disclosures regardless of legacy mode overrides.",
code: [
`${C}chat/CommandOutputPanel.tsx`,
`${C}chat/MessagesTimeline.tsx`,
Expand Down
Loading
Loading