Repository navigation
refactor(editor): make a tab kind data rather than another method (#286) - #648
Merged
Merged
Conversation
EVWorth
force-pushed
the
fix/sql-quote-escaping
branch
from
September 11, 2026 23:46
5fe2136 to
dbd55b4
Compare
`editorStore` had one `add*Tab` method per kind, each about thirty lines repeating the same shape: look for an open tab with the same identity, activate it if found, otherwise build one and append. Adding a kind meant a union member, a method, a dedup block and a title rule, scattered through a 437-line store that spanned six features (#286). A kind is now three answers — what identifies a tab of this kind, what it is called, and what fields it carries — and the store has one `openTab` that uses them. The five methods remain as named arguments over it, so no caller changed; the thirty lines behind each are gone. The session persistence went with it. The parser, the reader, the writer and the tab-counter recovery are not state, and they were the other half of the store's length. 211 lines, from 437. `TAB_KINDS` is exported so a test fails when a kind is added without a spec, rather than the kind silently never deduping. Two things the tests pinned down that the old methods only implied: a designer tab opened with `""` for a table name and one opened with nothing are the same new table — treating them as different opened a second designer for the same thing — and a designer tab must not be mistaken for a structure tab, which carries the same three fields. Co-Authored-By: Claude Opus 5 <[email protected]>
EVWorth
force-pushed
the
refactor/editor-tab-kinds
branch
from
September 11, 2026 23:50
5301c9c to
d4d2f16
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.
Stacked on #647.
editorStorehad oneadd*Tabmethod per kind, each ~30 lines repeating the same shape: look for an open tab with the same identity, activate it if found, otherwise build one and append. Adding a kind meant a union member, a method, a dedup block and a title rule, scattered through a 437-line store spanning six features.A kind is now three answers — what identifies a tab of this kind, what it's called, and what fields it carries — and the store has one
openTabthat uses them. The five methods remain as named arguments over it, so no caller changed; the thirty lines behind each are gone.The session persistence went with it: the parser, the reader, the writer and the tab-counter recovery aren't state, and they were the other half of the store's length.
211 lines, from 437.
TAB_KINDSis exported so a test fails when a kind is added without a spec, rather than the kind silently never deduping.Two things the tests pinned down that the old methods only implied
""for a table name and one opened with nothing are the same new table — treating them as different opened a second designer for the same thing.2660 unit + 341 browser tests, all passing unchanged through the refactor. 31 new tests on the registry.
Closes #286
🤖 Generated with Claude Code