feat(editor): clearer edit controls — Edits label, Save emphasis, Save/Cancel#928
Merged
Conversation
…e/Cancel Annotation panel: rename the pinned 'Direct edits' card label to 'Edits' (it line-broke at narrow panel widths). Save button (source-backed sessions): drive its state entirely from the editableDocuments state machine instead of a parallel flag. Shows a dot + emphasis only when there are unsaved disk changes (was inverted before, lighting up when already saved), turns destructive on a failed save, and no longer reflows — the dot slot is always reserved and the label width is pinned to its widest value so Save/Saving/Saved swap without nudging neighbors. Edit exit control: a source-backed session with unsaved edits now shows a two-step 'Cancel' (-> 'Discard?') that discards edits and exits, instead of the ambiguous 'Done'. Plan mode and clean source sessions keep 'Done' (commit edits + exit), so plan-mode keep behavior is unchanged.
In folder annotate mode the editor stays open across files, but the 'Cancel' -> 'Discard?' confirmation was a single app-level flag. Arming it on one dirty file and switching to another dirty file carried the armed state over, so the first click discarded the second file's edits with no confirmation. Reset the confirmation whenever the active editable document changes so each file's discard is independent.
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.
Polishes the markdown edit-mode controls (from #890) based on direct UX feedback. No server changes; plan-mode behavior is unchanged.
Changes
1. Annotation panel: "Direct edits" → "Edits"
The pinned direct-edits card label line-broke at narrow panel widths. Shortened to "Edits".
2. Save button — state-machine driven, zero layout shift
editableDocumentsstate machine (saveStatus) as the single source of truth, instead of a paralleleditorDiffersFromBaselineflag. (The old logic was also inverted — it lit up when already saved.)3. Edit exit control: Save + Cancel
Behavior note: in source-backed mode the two-button model (Save = keep to disk, Cancel = discard) removes the old path of sending unsaved edits to the agent as a diff without writing to the file. Plan mode still supports that.
Test
bun run typecheck— cleanbun run build:hook— bundles cleaneditableDocumentstransitions; plan-mode path confirmed untouched.