Skip to content

session: Read the rest on prompts and answers, controlled tool runs, SessionTimeline forwards TurnRow's props; AppFrame h-dvh - #21

Merged
uzayer merged 1 commit into
mainfrom
ds-876-session-gaps
Nov 4, 2026
Merged

uzayer merged 1 commit into
mainfrom
ds-876-session-gaps

Conversation

@uzayer

@uzayer uzayer commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

ATL-876, Part A step 2: the package gaps that block web's sessions on SessionTimeline. Everything is opt-in, so leaving the new props unset changes nothing, with one exception: AppFrame's height (see Merge Danger).

  • "Read the rest" on prompts and answers. TurnRow (and SessionTimeline) take onLoadBody?: (id) => void. A truncated prompt or text item then shows web's reader button, "Read the rest · 47.2 KB", in place of "Truncated". The fetch's state lives on the view model. SessionView gains BodyLoad = "loading" | "failed", plus bytes? and load? on TurnView.user and on the text item. While loading, the button shows a spinner and is aria-disabled/aria-busy. It uses aria-disabled rather than disabled so keyboard focus stays on it. On failure it reads "Couldn't load the rest, retry", and clicking it calls onLoadBody again. Once the adapter sets truncated: false, the button goes away. The copy is web's, with the em dash turned into a comma. The type is the quiet text-2xs muted tone that the prompt's "Show more" already uses.
    • Why a separate callback instead of widening onLoadPayload to part: "body", which the issue suggested: widening a callback's parameter breaks every consumer's existing handler under strictFunctionTypes. A new prop is purely additive. Web maps onLoadBody(id) to payload(id, "body").
  • Opening a folded tool-call run from outside. TurnRow takes openToolRunIds?: ReadonlySet<string> and onOpenToolRunIdsChange?, built the same way as ATL-900: CommsView team-chat blocks, and ToolCallCard / TurnRow opt-in props #19's openToolCallIds. A run of more than three calls is open while the set holds any of its call ids. Unfolding a run reports the set plus its first call's id. Folding reports the set minus all of its call ids. When the set is passed, only the host decides. When it is not, behaviour is as before, including ATL-900: CommsView team-chat blocks, and ToolCallCard / TurnRow opt-in props #19's "a run unfolds when openToolCallIds starts to hold one of its calls". A comment deep link can therefore hold only the run, or the run and the card.
  • SessionTimeline forwards ATL-900: CommsView team-chat blocks, and ToolCallCard / TurnRow opt-in props #19's TurnRow props: renderItemFooter, openToolCallIds/onOpenToolCallIdsChange, thinkingLabel, thinkingBody, onOpenAttachment and onCopyPayload, plus the two new props above. It also draws a turn that holds a call in either set even when that turn is past the render window, so a deep link into turn 300 of a long session finds its card. This matches what ToolCalls already does for a held call past its own window. The reach only widens, so closing the held card never unmounts the turn the reader is looking at. The window is one contiguous range, so the turns between are drawn too.
  • AppFrame is h-dvh, replacing h-svh. On a phone, svh is the height with the toolbar shown, so a collapsed toolbar left a gap under a composer pinned to the bottom. Web's own shell already uses h-dvh for this reason. Wherever no collapsing toolbar exists (a desktop webview such as Tauri/WKWebView/WebKitGTK, or a desktop browser window), dvh and svh are the same height. The frame never scrolls, so the dynamic height changes only when the toolbar itself changes. That is why it is right for every consumer and needs no opt-in.

Upgrade note (the README has no unreleased section, so this is for the release batch): TurnRow and SessionTimeline add onLoadBody(id) ("Read the rest" on a truncated prompt or answer; the item's new load and bytes fields carry the fetch and the size, typed BodyLoad) and openToolRunIds / onOpenToolRunIdsChange (hold a folded tool-call run open). SessionTimeline now also forwards renderItemFooter, openToolCallIds / onOpenToolCallIdsChange, thinkingLabel, thinkingBody, onOpenAttachment and onCopyPayload, and draws a turn holding a held call even past its window. AppFrame is h-dvh (was h-svh); the same height except on a phone browser whose toolbar has collapsed.

Left out:

  • Loading and error states on a tool payload's "Load full …". Web shows them today, but the brief asked for prompts and replies only. Adding load?: BodyLoad to Payload would take about ten lines if you want that parity.
  • AuthSplit and SettingsShell still use h-svh. The same reasoning probably applies to them, but they were not in scope.
  • A pre-existing edge case from ATL-900: CommsView team-chat blocks, and ToolCallCard / TurnRow opt-in props #19, not changed here: inside one run, a held call past the 80-call window stays drawn only while it is held.

Evidence

  • bun run typecheck, format:check, theme:check, test (42 files, 393 tests), build, test:consumer, build-storybook, storybook:smoke (646 stories) and test:storybook (646 stories in Chromium with axe): all green.
  • New unit tests (session-timeline.test.tsx):
    • "Truncated" stays when onLoadBody is unset.
    • "Read the rest · 47.2 KB" calls onLoadBody with the prompt and answer ids.
    • Loading is aria-disabled/aria-busy and ignores clicks; failed retries.
    • The button is gone once the body is whole.
    • A controlled run stays closed until the host passes the new set, and folding removes all of the run's ids.
    • SessionTimeline forwards onLoadBody, renderItemFooter and openToolRunIds.
  • New stories, with plays:
    • session-turnrow--read-the-rest: click, then a 600ms fetch, then the body fills in.
    • --read-the-rest-failed: the retry state.
    • --read-the-rest-states: both states, static.
    • --controlled-tool-run.
    • session-sessiontimeline--deep-link-to-folded-call: turn 301 of 400 is drawn, its run is open and its card is open.
    • --deep-link-then-close: closing the card keeps more than 300 turns drawn.
    • --read-the-rest.
  • Screenshots of the new stories and layout-appframe--default, in Atlas dark and light, are in shots/ATL-876/.

Merge Danger

  • AppFrame height is the one change that applies with no props set. It is the same height on desktop. On a phone browser the frame now follows the visible viewport. Anything that measured the frame against svh would see a taller frame once the toolbar collapses. I found no such consumer: desktop doesn't use AppFrame yet, and web's shell is already h-dvh.
  • SessionView changes are additive and optional: BodyLoad, plus bytes? and load? on the prompt and the text item.
  • TurnRow is memoised. A host that passes a new Set every render re-renders every turn, so keep the sets in state.
  • No version bump and no tag.

…SessionTimeline forwards TurnRow's props; AppFrame on h-dvh

- TurnRow onLoadBody(id): a truncated prompt or answer offers "Read the rest"
  (with the body's size); the item's load (loading | failed) shows the fetch
  and a retry. SessionView gains BodyLoad and bytes/load on the prompt and text
  items. Unset, a truncated body still says "Truncated".
- TurnRow openToolRunIds / onOpenToolRunIdsChange: a folded run held open by a
  call it contains, controlled by the host.
- SessionTimeline forwards renderItemFooter, openToolCallIds(+change),
  thinkingLabel, thinkingBody, onOpenAttachment, onCopyPayload, onLoadBody and
  openToolRunIds(+change), and draws a turn holding a held call past its window
  (widening only, so letting go never unmounts it).
- AppFrame is h-dvh: a phone's collapsing toolbar leaves no gap under the
  composer; equal to svh wherever there is no such toolbar.
@uzayer
uzayer merged commit 4b17fb6 into main Nov 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant