The status line takes back what is no longer true - #224
Merged
Merged
Conversation
Found by clicking through the application before a release: with no editor open anywhere, the line read "Editing table: Products". The tab had been opened and closed again and the sentence stayed behind it. Most of what this line carries is an EVENT - "executed in 9 ms", "loaded 28 rows" - and an event stays true after it happens, which is why the line is not simply cleared whenever something changes. "Editing table X" is not an event. It is a state, it belongs to the tab, and it ends when the tab does. So a state is said WITH AN OWNER: SayThisWhile(tab, ...) remembers who said it, and closing that tab takes it back - by reference AND by comparing the line to what was set, so a message that arrived from anywhere else in the meantime is never taken away by the owner closing afterwards. Both of those are cases in the fixture, beside the third: closing a query tab leaves what it reported on the line. Red with the call removed from the close path. Studio: 1030 green. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Found by clicking through the application before a release: with no editor open anywhere, the line read Editing table: Products. The tab had been opened and closed again, and the sentence stayed behind it.
The distinction
Most of what this line carries is an event - executed in 9 ms, loaded 28 rows - and an event stays true after it happens. That is why the line is not simply cleared whenever something changes: clearing it would throw away the answer to the last thing the user did.
Editing table X is not an event. It is a state, it belongs to the tab, and it ends when the tab does.
The fix
A state is said with an owner -
SayThisWhile(tab, …)- and closing that tab takes it back. The owner is matched by reference and by comparing the line to what was set, so a message that arrived from anywhere else in the meantime is never taken away by the owner closing afterwards.The guard
TheStatusLineTakesBackWhatIsNoLongerTrueTests, three cases, two of them in the other direction:Red with the call removed from the close path.
Studio: 1030 green.
🤖 Generated with Claude Code