Repository navigation
feat(chat): give a notebook many named chat sessions (#97) - #188
Merged
Merged
Conversation
5 tasks
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.
What does this PR do?
Gives a notebook many named chat sessions instead of exactly one, and turns the
silent automatic context rollover into a visible, navigable archive boundary.
Why?
A notebook used to hold one conversation, and
SessionAutoSwitchServicerolled itover silently when it approached the context budget. Every topic shared one
thread and its context; the reader could not start a separate line of inquiry;
and the rollover was a backend event they could neither see nor navigate. This
implements #97.
Related issue
Fixes #97
What changed?
0022_concerned_spyke):chat_sessionsgainslast_opened_at(which session the notebook returns to) andtitle_is_auto(a placeholder title the first message may replace).
getMostRecentSessionByNotebookreplacesgetActiveSessionByNotebook(many sessions can beactive, so status can nolonger identify one);
touchSession,deriveSessionTitleIfAuto,searchMessagesInNotebook,countSessionsByNotebook, and use-ordered sessionlisting.
touch-sessionandsearch-messages;send-messagenames aplaceholder session from its first user message.
parentSessionIdpointing back at it, and drops the silent "context optimized"system message. The rollover stays visible through the data, not a one-shot
toast.
SessionSwitcherin the chat panel header (list,+ New chat,rename, confirmed delete, message search across sessions, archived badge) and
SessionContinuationNotice(the archive boundary with an "open archived chat"action).
en-USandzh-CN.How was this tested?
Verifyis green on Linux, macOS and Windows — typecheck, design guard,unit tests,
electron-builder --dir, andsmoke:packaged(which runs the realpackaged app and therefore applies migration
0022).npm test— 478 pass, including newtest/sessionTitle.test.tsand theupdated automatic-switch renderer test.
npx electron-vite build— bundles main, preload and renderer.The manual workflow from the issue (three sessions, restart, confirm histories,
force a rollover) is covered by the packaged smoke run only at startup; a full
interactive pass is still worth doing before release.
Checklist
npm run typecheckpasses (CI).npm run buildpasses (CI).Desktop / build changes
npm run build:unpackpasses (CI).npm run smoke:packagedpasses (CI).