)}
@@ -1174,7 +1172,7 @@ export function createNextTimelineRowRenderer(input: {
-
+
diff --git a/packages/session-ui/src/timeline-next/rules.test.ts b/packages/session-ui/src/timeline-next/rules.test.ts
index a69a11a4454..5d33ffd7304 100644
--- a/packages/session-ui/src/timeline-next/rules.test.ts
+++ b/packages/session-ui/src/timeline-next/rules.test.ts
@@ -11,7 +11,6 @@ import {
thoughtOpens,
toolFailed,
toolStopped,
- userShellOpens,
} from "./rules"
import { timelineStatus } from "./status"
@@ -110,12 +109,10 @@ describe("echoesUserShell", () => {
})
describe("details", () => {
- test("shell details decide whether a command's whole output shows, for the agent's commands and the user's", () => {
+ test("shell details decide whether an agent's command opens to its whole output", () => {
expect(contentOpens(preset("everything"), tool("shell"))).toBe(true)
expect(contentOpens(preset("compact"), tool("shell"))).toBe(false)
expect(contentOpens(preset("compact"), tool("execute"))).toBe(false)
- expect(userShellOpens(preset("everything"))).toBe(true)
- expect(userShellOpens(preset("compact"))).toBe(false)
})
test("thinking details stream the live thought in view, and every finished thought starts closed", () => {
diff --git a/packages/session-ui/src/timeline-next/rules.ts b/packages/session-ui/src/timeline-next/rules.ts
index 6b55eb4a493..e18b1ed5fac 100644
--- a/packages/session-ui/src/timeline-next/rules.ts
+++ b/packages/session-ui/src/timeline-next/rules.ts
@@ -189,11 +189,6 @@ export function liveThinkingShows(detail: TimelineDetail) {
return detail.thinking.placement !== "hidden"
}
-/** A command the user ran always shows, whole where shell details expand and its last lines otherwise. */
-export function userShellOpens(detail: TimelineDetail) {
- return detail.shell.details === "expanded"
-}
-
/** The notice the agent gets about a command the user ran repeats that command's own card, so it never shows. */
export function echoesUserShell(message: SessionMessageInfo, userShellIDs: ReadonlySet) {
const shellID = message.type === "synthetic" ? message.metadata?.shellID : undefined
@@ -236,6 +231,11 @@ export function sessionEvent(message: SessionMessageInfo) {
return goal(message)
}
+/** A move to where the session already is changes nothing, so it shows nothing. */
+export function movedInPlace(message: SessionMessageInfo) {
+ return message.type === "location-switched" && message.previous?.location.directory === message.location.directory
+}
+
/** A goal the user set, which reads as their own message. */
export function goal(
message: SessionMessageInfo | undefined,
diff --git a/packages/session-ui/src/timeline-next/timeline-next.css b/packages/session-ui/src/timeline-next/timeline-next.css
index 62f2b6146dd..bfae00e1812 100644
--- a/packages/session-ui/src/timeline-next/timeline-next.css
+++ b/packages/session-ui/src/timeline-next/timeline-next.css
@@ -76,106 +76,12 @@
}
}
-/* Cut output shows its last lines, fading out at the top where it is cut. */
-[data-timeline="next"] [data-component="clamped-content"] {
- &[data-clamped] {
- max-height: var(--clamped-content-height, 96px);
- overflow: hidden;
- }
-
- /* The fade is the code's own background, so the cut lines fade into the block rather than through it. */
- &[data-overflow] {
- position: relative;
-
- &::after {
- content: "";
- position: absolute;
- inset-inline: 0;
- top: 0;
- height: 20px;
- background: linear-gradient(var(--clamped-content-fade), transparent);
- pointer-events: none;
- }
- }
-}
-
-/* A command the user ran is its command and output, always showing, with the output cut to four lines. */
-[data-timeline="next"] [data-component="shell-tool"] {
- [data-slot="shell-tool-writing"] {
- display: block;
- font-size: 13px;
- line-height: var(--line-height-compact);
- color: var(--v2-text-text-muted);
- }
-
- [data-component="bash-output"][data-clamp] {
- [data-slot="bash-scroll"] {
- max-height: none;
- }
-
- [data-component="clamped-content"] {
- grid-area: 1 / 1;
- /* The 12px top padding and four 20px lines of output, as a plain length the clamp can read back. */
- --clamped-content-height: 92px;
- --clamped-content-fade: var(--bash-section-background);
- }
- }
-}
-
-/* The output's toggle sits at the end of the command line, so neither block's text is a click target. */
-[data-timeline="next"] [data-component="shell-tool"] [data-slot="bash-command"] {
- /* How the command ended and the output's toggle, above the command, which shares their grid cell and comes later,
- so paints over it. The inset matches the file header's toggle. */
- [data-slot="bash-actions"] {
- position: relative;
- z-index: 1;
- grid-area: 1 / 1;
- justify-self: end;
- align-self: center;
- display: flex;
- align-items: center;
- gap: 8px;
- margin-inline-end: 8px;
- }
-
- [data-slot="bash-outcome"] {
- font-family: var(--v2-font-family-sans);
- font-size: 13px;
- font-weight: 440;
- line-height: var(--line-height-compact);
- letter-spacing: -0.04px;
- white-space: nowrap;
- color: var(--v2-text-text-muted);
-
- &[data-tone="danger"] {
- color: var(--v2-state-fg-danger);
- }
- }
-
- [data-slot="bash-toggle-button"] {
- display: flex;
- align-items: center;
- justify-content: center;
- padding: 0;
- border: 0;
- background: none;
- color: inherit;
- cursor: default;
-
- &:focus-visible {
- outline: 1px solid var(--v2-text-text-accent);
- outline-offset: 2px;
- border-radius: 2px;
- }
- }
-
- &:has([data-slot="bash-toggle"]) [data-slot="bash-pre"] {
- padding-inline-end: 40px;
- }
-
- &:has([data-slot="bash-outcome"]) [data-slot="bash-pre"] {
- padding-inline-end: 120px;
- }
+/* A command the user ran is its command and output, always showing, as an agent's command shows once opened. */
+[data-timeline="next"] [data-component="shell-tool"] [data-slot="shell-tool-writing"] {
+ display: block;
+ font-size: 13px;
+ line-height: var(--line-height-compact);
+ color: var(--v2-text-text-muted);
}
/* A file's change counts follow its name, showing only the side that changed; its change bars are quieter; and its
@@ -509,6 +415,43 @@
height: calc(var(--line-height-compact) + 6px + var(--timeline-gap-s));
}
}
+
+ /* Answers are spaced by the row gaps and trimmed to their text, as the agent's text is. */
+ [data-component="question-answers"] {
+ gap: var(--timeline-gap-s);
+ padding: 0;
+ line-height: var(--line-height-base);
+
+ [data-slot="question-answer-item"] {
+ gap: 4px;
+ }
+
+ [data-slot="question-text"],
+ [data-slot="answer-text"] {
+ text-box: trim-both text;
+ }
+ }
+
+ /* A row's action is as tall as its line, so its button never makes the row taller. */
+ [data-slot="basic-tool-action"] {
+ height: var(--line-height-compact);
+
+ [data-component="icon-button-v2"] {
+ width: 20px;
+ height: 20px;
+ }
+ }
+
+ /* The quiet compaction draws the same line as the other dividers. */
+ [data-component="session-compaction-message"][data-quiet] {
+ [data-slot="session-compaction-line"]::before {
+ background: var(--v2-border-border-base);
+ }
+
+ [data-slot="session-compaction-summary"] {
+ padding-bottom: 0;
+ }
+ }
}
/* The live thought sits where the row it settles into will, which its frame spaces like any other row. */
diff --git a/packages/session-ui/src/timeline-next/tools/clamped-content.tsx b/packages/session-ui/src/timeline-next/tools/clamped-content.tsx
deleted file mode 100644
index f37941dd695..00000000000
--- a/packages/session-ui/src/timeline-next/tools/clamped-content.tsx
+++ /dev/null
@@ -1,51 +0,0 @@
-import { createEffect, createSignal, on, onCleanup, onMount, type JSX } from "solid-js"
-
-/**
- * Output cut to its last few lines, as a command the user ran shows it, so the newest stay in view as running output
- * grows. Its owner offers the control that shows the rest, so the text stays selectable.
- */
-export function ClampedContent(props: {
- expanded: boolean
- /** Whether the content is longer than the cut, so the owner knows to offer its toggle. */
- onOverflowChange?: (overflow: boolean) => void
- children: JSX.Element
-}) {
- const [overflow, setOverflow] = createSignal(false)
- let frame: HTMLDivElement | undefined
- let content: HTMLDivElement | undefined
-
- const measure = () => {
- if (!frame || !content) return
- // Measured against the cut height, so an expanded frame still knows whether it has more than the cut shows.
- const limit = Number.parseFloat(getComputedStyle(frame).getPropertyValue("--clamped-content-height")) || 96
- setOverflow(content.offsetHeight > limit + 1)
-
- // Shifting the content rather than scrolling it keeps the fade over the frame's edge.
- const shift = props.expanded ? 0 : Math.min(0, frame.clientHeight - content.offsetHeight)
-
- content.style.translate = shift ? `0 ${shift}px` : ""
- }
-
- onMount(() => {
- const observer = new ResizeObserver(measure)
-
- if (frame) observer.observe(frame)
-
- if (content) observer.observe(content)
- onCleanup(() => observer.disconnect())
- })
-
- createEffect(on(() => props.expanded, measure, { defer: true }))
- createEffect(on(overflow, (value) => props.onOverflowChange?.(value)))
-
- return (
-
-
{props.children}
-
- )
-}
diff --git a/packages/session-ui/src/timeline-next/tools/shell.tsx b/packages/session-ui/src/timeline-next/tools/shell.tsx
index 17971b7fc15..c5fd9caad3c 100644
--- a/packages/session-ui/src/timeline-next/tools/shell.tsx
+++ b/packages/session-ui/src/timeline-next/tools/shell.tsx
@@ -2,11 +2,8 @@ import type { SessionMessageShell } from "@opencode/client/promise"
import { Predicate } from "effect"
import { type UiI18n, useI18n } from "@opencode/ui/context/i18n"
import { Badge } from "@opencode/ui/badge"
-import { Icon } from "@opencode/ui/icon"
import { TextShimmer } from "@opencode/ui/text-shimmer"
-import { Tooltip } from "@opencode/ui/tooltip"
import { createComputed, createEffect, createMemo, createSignal, on, onCleanup, Show, untrack } from "solid-js"
-import { LinkedText } from "../../components/linked-text"
import { useData } from "../../context"
import {
createShellRunState,
@@ -17,15 +14,7 @@ import {
} from "../../tools/run-machine"
import { createShellFollower } from "../../tools/shell-output"
import { BasicTool } from "../../components/basic-tool"
-import {
- ConsoleCopy,
- ConsoleOutput,
- ShellSubmessage,
- toolInput,
- toolMetadata,
- type ToolProps,
-} from "../../tools/tool-renderer"
-import { ClampedContent } from "./clamped-content"
+import { ConsoleOutput, ShellSubmessage, toolInput, toolMetadata, type ToolProps } from "../../tools/tool-renderer"
/**
* An agent's shell call is a row of activity, as in the current timeline: Shell, then its command, cut to the row while
@@ -83,15 +72,12 @@ export function ShellTool(props: ToolProps) {
}
/**
- * A command the user ran shows as a card: its command and output, the output cut to its last lines, where a command says
- * how it went, until expanded. How it ended sits on the card when it did not succeed.
+ * A command the user ran shows as an agent's shell call does once opened, its command and output, without the row above
+ * them to open it.
*/
function ShellCard(props: ToolProps) {
const i18n = useI18n()
const run = shellRun(props)
- const [expanded, setExpanded] = createSignal(false)
- const open = () => props.open ?? expanded()
- const outcome = createMemo(() => shellOutcome(props.metadata, i18n))
run.follow()
@@ -107,18 +93,7 @@ function ShellCard(props: ToolProps) {
}
>
- {
- const next = !open()
-
- setExpanded(next)
- props.onOpenChange?.(next)
- }}
- />
+
)
@@ -191,11 +166,7 @@ function shellOutcome(metadata: ToolProps["metadata"], i18n: UiI18n) {
}
/** A command the user ran. */
-export function ShellMessage(props: {
- message: SessionMessageShell
- open?: boolean
- onOpenChange?: (open: boolean) => void
-}) {
+export function ShellMessage(props: { message: SessionMessageShell }) {
return (
)
}
-
-// Copy sits on the output only. The command's corner holds how the command ended, and the output's toggle once there is
-// more than the cut shows.
-function ShellOutput(props: {
- command?: string
- output: string
- expanded: boolean
- outcome?: { tone: "neutral" | "danger"; label: string }
- onToggle: () => void
-}) {
- const i18n = useI18n()
- const [overflow, setOverflow] = createSignal(false)
- const toggleLabel = () => i18n.t(props.expanded ? "ui.common.showLess" : "ui.common.showMore")
-
- return (
-