Conversation
…astsa#746) Clicking New Task now resets the composer to an unpersisted draft instead of eagerly writing an empty session row to SQLite and the sidebar. The session is materialized upon the first prompt or attachment. Abandoning the draft leaves no empty session row in history.
This branch has not been deployed
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.
Closes #746
Supersedes #750
What changed
Reinstates the deferred session creation mechanism originally defined in ADR 0084:
store.newSession): Resets the renderer to an unpersisted draft state (activeSessionId: undefined, empty messages, scope retained) instead of eagerly persisting an empty session slot to SQLite and the sidebar.materializeDraftSessionworkflow remains active and automatically creates/persists the session as soon as the user sends their first prompt or attaches files.Why
Under ADR 0113, clicking "New Task" eagerly wrote an empty session row (
新建任务/ "New task") into the database and sidebar. When users accidentally clicked "New Task" or decided not to proceed, abandoned empty rows accumulated in the history and on disk until manually deleted.Reinstating deferred creation ensures only tasks that actually receive user input are recorded in history and persisted to SQLite.
Affected surfaces
apps/desktop/src/stores/slices/session-slice.ts—newSessionresets renderer state to unpersisted draft.apps/desktop/src/components/Sidebar.tsx— restores title filtering for empty default drafts.app-store-sidebar.test.mjs,composer-send-state.test.mjs, andsession-create.test.mjsupdated to verify unpersisted draft behavior.docs/adr/0084anddocs/adr/0113updated.Validation