Repository navigation
session: Read the rest on prompts and answers, controlled tool runs, SessionTimeline forwards TurnRow's props; AppFrame h-dvh - #21
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).TurnRow(andSessionTimeline) takeonLoadBody?: (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.SessionViewgainsBodyLoad = "loading" | "failed", plusbytes?andload?onTurnView.userand on thetextitem. While loading, the button shows a spinner and isaria-disabled/aria-busy. It usesaria-disabledrather thandisabledso keyboard focus stays on it. On failure it reads "Couldn't load the rest, retry", and clicking it callsonLoadBodyagain. Once the adapter setstruncated: false, the button goes away. The copy is web's, with the em dash turned into a comma. The type is the quiettext-2xsmuted tone that the prompt's "Show more" already uses.onLoadPayloadtopart: "body", which the issue suggested: widening a callback's parameter breaks every consumer's existing handler understrictFunctionTypes. A new prop is purely additive. Web mapsonLoadBody(id)topayload(id, "body").TurnRowtakesopenToolRunIds?: ReadonlySet<string>andonOpenToolRunIdsChange?, built the same way as ATL-900: CommsView team-chat blocks, and ToolCallCard / TurnRow opt-in props #19'sopenToolCallIds. 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 whenopenToolCallIdsstarts to hold one of its calls". A comment deep link can therefore hold only the run, or the run and the card.SessionTimelineforwards ATL-900: CommsView team-chat blocks, and ToolCallCard / TurnRow opt-in props #19'sTurnRowprops:renderItemFooter,openToolCallIds/onOpenToolCallIdsChange,thinkingLabel,thinkingBody,onOpenAttachmentandonCopyPayload, 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 whatToolCallsalready 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.AppFrameish-dvh, replacingh-svh. On a phone,svhis 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 usesh-dvhfor this reason. Wherever no collapsing toolbar exists (a desktop webview such as Tauri/WKWebView/WebKitGTK, or a desktop browser window),dvhandsvhare 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):
TurnRowandSessionTimelineaddonLoadBody(id)("Read the rest" on a truncated prompt or answer; the item's newloadandbytesfields carry the fetch and the size, typedBodyLoad) andopenToolRunIds/onOpenToolRunIdsChange(hold a folded tool-call run open).SessionTimelinenow also forwardsrenderItemFooter,openToolCallIds/onOpenToolCallIdsChange,thinkingLabel,thinkingBody,onOpenAttachmentandonCopyPayload, and draws a turn holding a held call even past its window.AppFrameish-dvh(wash-svh); the same height except on a phone browser whose toolbar has collapsed.Left out:
load?: BodyLoadtoPayloadwould take about ten lines if you want that parity.AuthSplitandSettingsShellstill useh-svh. The same reasoning probably applies to them, but they were not in scope.Evidence
bun run typecheck,format:check,theme:check,test(42 files, 393 tests),build,test:consumer,build-storybook,storybook:smoke(646 stories) andtest:storybook(646 stories in Chromium with axe): all green.session-timeline.test.tsx):onLoadBodyis unset.onLoadBodywith the prompt and answer ids.aria-disabled/aria-busyand ignores clicks; failed retries.SessionTimelineforwardsonLoadBody,renderItemFooterandopenToolRunIds.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.layout-appframe--default, in Atlas dark and light, are inshots/ATL-876/.Merge Danger
AppFrameheight 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 againstsvhwould see a taller frame once the toolbar collapses. I found no such consumer: desktop doesn't useAppFrameyet, and web's shell is alreadyh-dvh.SessionViewchanges are additive and optional:BodyLoad, plusbytes?andload?on the prompt and the text item.TurnRowis memoised. A host that passes a newSetevery render re-renders every turn, so keep the sets in state.