Repository navigation
An operation remembers the slot it was about, even when it changed nothing - #156
Closed
AliceLafox wants to merge 7 commits into
Closed
AliceLafox wants to merge 7 commits into
AliceLafox wants to merge 7 commits into
Conversation
A normalize that finds its slot already at target writes nothing, so it had no slot_changes row and the history had no slot for it: no badge, no place in the slot filter, nothing in the slot's own tab (#144). The operation knew its slot all along. Store version 8 adds op_subjects: the slots an operation was about, written down when it begins. Kept apart from slot_changes on purpose: a body-less row there would look like a state to restore. A subject names no state, so it is never offered by Restore and never makes an Undo plan possible; it is a badge, and a line in the slot's timeline, flagged subjectOnly there so it is never read as the state the slot is in. Forgetting a slot takes its subjects with it: an operation nothing is left of goes whole; one still about another slot keeps its row for that slot's badge without moving the Undo boundary, since no state survives in it to be offered half-forgotten; and the plan's entry count is what the slot's tab listed. Maintenance records no subject: clearing a slot's history must not write the slot back into it.
A card row's badges are the union of the slots an operation touched and the slots it was about, ascending, each once: a swap about the two slots it changed wears two, not four. A subject brings no take, so Play, Export and Restore are what they were. In the slot's own tab the newest state is the last row that recorded one. A row that only names the slot, the normalize that found nothing to do, reads its own line, offers nothing, never says "in the slot now", and leaves the row before it as the state the slot is in. A row that names the slot and still carries a state is refused as not the store's. Undo is proven unchanged: the cursor reads kinds and outcomes, and the plan refuses an operation with nothing to put back by name, subject or not.
recorded() writes the job's slot down as the operation's subject right after begin, before the card is touched, so an operation that then changes nothing keeps its slot in the history. The swap job names one slot for its busy row and is about both, so its call site adds the other. Maintenance and the first-seen snapshot do not go through recorded() and record no subject.
… holds nothing Clearing the history of a slot whose one entry was a no-op normalize, the newest operation, warned that Undo would no longer reach past this point and asked for the protected-entries confirmation - and then moved no boundary and changed nothing about Undo. The plan counted every operation the slot named as a boundary and every cursor target as a hold. Both now follow what forgetting really takes out of an operation. The boundary moves for an operation that loses a state here and still stands afterwards - a state elsewhere, a setting, or another slot's badge - since what is left of it must never be offered as the whole. An operation forgotten whole moves nothing, and one that was only about this slot keeps its row and its undo exactly as they were: its name comes off the slot, nothing else. An Undo target is a hold only when it loses a state here. forgetSlot decides by the same three facts, read before the rows go. The store also refuses a subject on a first sighting, on maintenance and on any operation that is not pending: the recorder refused these already, and the store is where the line holds. And the card's timeline reads every operation's subjects through one prepared statement, like its other columns.
…ver recorded The slot's tab read a failed or interrupted operation as something that happened: a tempo refused as out of range showed "Tempo", a push that could not read its source "Pushed", and a One Shot ON attempt that failed "One Shot off" - the switch position of a body that was never written. The window beside it said "failed". Only the window carried a state, and the words for a switch invented a position without a body. A slot's row now carries the same state words the card's rows wear - failed, interrupted, still running, recorded on the pedal - from one function both views read, and the pane paints the state in the window's place and colour. A row that did not finish carries its reason where its numbers would be: what it recorded on the way is not what the slot came to hold. One Shot and Play Count-In say on or off only from the body the operation left; without one they name the switch. And a finished operation that was about the slot with no word for what it did there says "nothing changed" rather than reading like a rename or a tempo change.
…art from what a restore acts on Two recorded jobs with a slot wrote no subject: Clear opens its operation by hand, and a window restore of several slots names none on the job. The clear now names its slot, and the restore every slot it puts back - the same slots the job's description counts. The window's rows were fed one slot list for two jobs: the badges, which are every slot the row is about, and what "Restore this state" acts on, which is only the slots the row recorded. A row touching two slots and about three would have said "Restore 4 slots". The badges read the union and the restore the touched slots. recorded() names each slot once: a job naming its own slot again must reach the core's refusal, not the store's "already a subject".
…bjects and all An operation that lost its last state on the cleared slot and was still about another slot stayed as a half-forgotten boundary. Reachable with real commands: swap 12 and 43, rename 12 away and back, rename 43, "Restore this state" of the swap from the window - it changes only 43, being about both - then clear slot 43. The restore survived on its subject alone, the boundary moved to it, and Undo of slot 12's rename was gone, where without subjects it was on offer. By the branch's own principle a subject is not a surviving state. Such an operation now goes whole, the slots it was still about included: the row the other slot loses said "nothing changed", which is not what a boundary guards. The boundary moves only for an operation that loses a state here and keeps one elsewhere, in a slot or in the settings. An operation that never had a state and is still about another slot keeps standing for that slot's badge, as before. A pinned operation that loses only its badge on the cleared slot is no longer listed as protected: its row, its state and its pin all stay. It is listed when the slot held a state of it, or when it goes whole. The scenario above runs twice in undo_run_tests, with the subjects the app records and with them deleted, and must end with the same Undo on offer and the same boundary.
This was referenced Oct 5, 2026
Member
Author
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 #144. Stacked on #151 (
fix/history-row-badges); the base moves tomainonce #151 is merged.A normalize that found the slot already at target wrote nothing, so the history had no slot for it: no badge, invisible to the slot filter and to the slot's own tab. The operation knew its slot; there was just no place to say so other than "changed this slot".
op_subjects(op, slot), apart fromslot_changes, so a subject can never look restorable or become an Undo target with something to put back. Old stores migrate with every row intact.recorded()names the job's slot when the operation opens (a swap names both, a clear its slot, a window restore every restored slot); maintenance operations and the first-sighting snapshot record none, and the store refuses a subject on them or on an operation that is not pending.Noted for a follow-up issue, pre-existing: an operation that changed nothing is still the Undo cursor's target (refused with "nothing to put back"), so the operations before it cannot be reached with Cmd-Z until it is skipped.
Tests:
history_schema_tests95,history_store_tests128,history_recorder_tests140,card_rows_tests98,slot_rows_tests99,forget_slot_tests194,undo_tests123,undo_run_tests151 (the swap/rename/restore/clear scenario, with and without subjects, same Undo and floor),clear_confirmation_tests262. Non-GUI ctest 58/58; the six GUI harnesses 6/6 locally.