feat: add chat summary popover and per-chat cost endpoint#26649
Draft
jaaydenh wants to merge 1 commit into
Draft
feat: add chat summary popover and per-chat cost endpoint#26649jaaydenh wants to merge 1 commit into
jaaydenh wants to merge 1 commit into
Conversation
Docs preview📖 View docs preview for |
Add a reusable ChatSummary component surfaced via an info button placed to
the left of the chat sharing button in the chat header. The button opens a
"Summary" popover (400px on desktop, full width on mobile) showing the
chat's summary plus its Created/Updated dates and cumulative cost.
The summary text is the persisted whole-chat summary (chat.summary) from the
backend summary feature this branch is stacked on. It is generated
asynchronously and may be null until the first summary is produced, in which
case the popover renders a muted empty state.
Cost is served by a new per-chat endpoint, GET
/api/experimental/chats/{chat}/cost, that rolls up assistant-message cost
across a chat's root and child (subagent) chats and is authorized like the
other {chat} routes.
28cda13 to
aa80827
Compare
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.
Stacked on #26657 (the persisted whole-chat summary backend). Base branch is
chat-summary-62j9; review/merge that first.Adds a reusable
ChatSummarycomponent surfaced via an info (i) button placed to the left of the chat sharing button in the chat header. The button opens a "Summary" popover (400px on desktop, full width on mobile) showing the chat's Summary, Created:, Updated:, and Cost:.The summary text is the persisted whole-chat summary (
chat.summary) introduced by #26657. It is generated asynchronously and may benulluntil the first summary is produced, in which case the popover renders a muted empty state. Live updates arrive via that PR'schat_summary_changewatch event, which is already merged into the chat caches.Cost is served by a new per-chat endpoint,
GET /api/experimental/chats/{chat}/cost, which rolls up assistant-message cost across a chat's root and child (subagent) chats and is authorized like the other{chat}routes (read on the chat, 404 otherwise).Visual and interaction coverage lives in
ChatSummary.stories.tsxandChatSummaryPopover.stories.tsx(including populated-summary, empty-state, and cost-loading cases).