Conversation
astral303
force-pushed
the
fix/tui-composer-undo-redo-with-paste-burst-grouping
branch
from
August 16, 2026 20:30
09447e6 to
5ce8a50
Compare
astral303
force-pushed
the
fix/tui-composer-undo-redo
branch
from
August 16, 2026 20:30
4534617 to
0036105
Compare
astral303
force-pushed
the
fix/tui-composer-undo-redo-with-paste-burst-grouping
branch
from
August 16, 2026 23:56
5ce8a50 to
9fa720a
Compare
astral303
force-pushed
the
fix/tui-composer-undo-redo
branch
from
August 21, 2026 18:00
0398516 to
4f06916
Compare
astral303
force-pushed
the
fix/tui-composer-undo-redo-with-paste-burst-grouping
branch
2 times, most recently
from
August 23, 2026 21:56
fdad0dc to
ad9d565
Compare
astral303
force-pushed
the
fix/tui-composer-undo-redo
branch
2 times, most recently
from
August 25, 2026 17:46
43bb812 to
d2fa1db
Compare
astral303
force-pushed
the
fix/tui-composer-undo-redo-with-paste-burst-grouping
branch
from
August 25, 2026 17:46
ad9d565 to
675fa98
Compare
Composer edits can now be reversed as complete draft states without losing
cursor placement, paste payloads, mentions, or attachments.
- Replace the private `ComposerDraft` with
`EditableDraft { content, cursor }`. Comparing `EditableDraftContent`
separately prevents cursor-only motion from recording an edit or
invalidating redo, while restored drafts retain their cursor.
- Rename the existing cross-screen `ComposerDraftSnapshot` to
`StartupDraftSnapshot`. It carries startup history and activity state and
is not an undo record.
- Keep bounded undo and redo history on `ChatComposer`, with 100-entry and
32 MiB limits, and clear it when submission, recall, or programmatic
replacement starts a new draft lifecycle.
- Add composer-scoped shortcuts, using Ctrl+Z on Windows and Alt+Z on Unix
so terminal job control remains available.
- Cover complete-state restoration, edit order, Ctrl+C recovery, redo
divergence, lifecycle resets, keymap fallback, and history limits.
Nested key handlers can now tell the outer dispatcher when they already changed undo history, and retained-byte accounting fails loudly if it drifts. - Rename the internal revision to `mutation_epoch` and advance it for every record, clear, undo, and redo. An unchanged epoch leaves the outer dispatcher responsible for recording the edit. - Route pops, limit eviction, and stack clearing through checked byte removal instead of saturating subtraction, so corruption cannot silently weaken the memory cap. - Derive fallback conflict detection from typed default undo and redo bindings while retaining exact terminal compatibility aliases. - Cover duplicate outer recording after a nested history mutation and retained-byte underflow.
Shell-style Up/Down now reuses an adjacent undo or redo state when the recalled draft has the same complete content. Unrelated prompts still establish a new baseline, so navigation itself never becomes an undo step. - Carry Older/Newer through HistoryNavigation so cached and asynchronous recall share one transition. Rename HistorySearchDirection because it already serves normal navigation. - Compare complete EditableDraftContent but restore the exact stored snapshot, preserving cursor and rich state without a second buffer. - Cover Ctrl+C -> Up -> Ctrl+Z, symmetric Down/redo, unrelated and equal-text rich-state mismatches, and asynchronous lookup.
Vim commands and ordinary composer edits now share one bounded undo/redo lineage, so undo can cross mode switches without maintaining two stacks. - Keep Vim state as a pending transaction coordinator and commit complete commands or insert sessions into ComposerUndoHistory. - Route Vim u and composer undo/redo through the same rich-draft restoration path while preserving repeat and search state. - Suppress ordinary per-key records when Vim completion owns the action boundary, preventing duplicate history entries. - Cover mixed-mode traversal, mode switches, and active insert-session undo alongside the upstream Vim behavior.
Retro-captured paste bursts no longer leave per-character undo records that can resurrect only part of the paste. - Remove the detector-reported number of provisional edit records when an existing retro-capture path reclassifies typed characters as one paste, then let the normal paste flush record the final action once. - Advance the history mutation epoch during removal so the outer dispatcher does not recreate a discarded entry. - Keep paste thresholds, timing, and terminal support unchanged. - Cover whole-paste undo and redo through the existing detector.
Retro-capture now validates the exact undo suffix before removing provisional entries, so a stale detector count cannot consume older history. - Pair the detector count with the complete pre-capture `EditableDraft` and require the first candidate suffix entry to match it. A missing or stale boundary leaves history unchanged. - Centralize textarea removal, history validation, and paste-buffer seeding in one transition shared by the ASCII and non-ASCII capture paths. - Advance the mutation epoch only after validated removal, keeping the outer dispatch transaction coherent. - Cover invalid boundaries, preservation of an older undo entry, non-ASCII retro-capture, and a second undo that cannot resurrect the paste prefix.
astral303
force-pushed
the
fix/tui-composer-undo-redo-with-paste-burst-grouping
branch
from
September 1, 2026 14:33
675fa98 to
daf618e
Compare
Unified undo now preserves existing keymaps and history navigation while grouping detected paste bursts without assuming per-key history exists. - Prune only the new undo/redo defaults when an overlapping configured chord owns their prefix, and keep snapshots independent of platform modifiers. - Restore history-recalled drafts at the navigation boundary and move cross-component coordination into a focused module. - Let active Vim transactions own retro-capture; fall back to ordinary input when provisional history is unavailable, with regressions for both paths.
Paste-burst grouping now lands atomically in PR #10 because the core undo PR must be correct on its own. This empty commit keeps the stacked branch and PR available for later follow-up work without carrying a second implementation.
astral303
marked this pull request as draft
September 1, 2026 23:23
Advance the placeholder head after its stacked base moved so GitHub recomputes the intentionally empty comparison against the updated PR #10 branch.
astral303
force-pushed
the
fix/tui-composer-undo-redo
branch
3 times, most recently
from
September 4, 2026 00:47
39bf86e to
9754f2a
Compare
astral303
force-pushed
the
fix/tui-composer-undo-redo
branch
2 times, most recently
from
September 10, 2026 02:55
09a14ea to
ca8421c
Compare
astral303
force-pushed
the
fix/tui-composer-undo-redo
branch
from
September 18, 2026 03:32
ca8421c to
bfee594
Compare
astral303
force-pushed
the
fix/tui-composer-undo-redo
branch
2 times, most recently
from
October 3, 2026 20:14
a9156d1 to
8b23268
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.
Status
This pull request is intentionally empty.
The paste-burst grouping work originally carried here was folded into #10 so the unified composer history is correct as a standalone change. The empty commit preserves this branch and PR as a placeholder for later composer-undo follow-up work without maintaining a second implementation or temporary history model.