feat: multi-tab query editor#413
Open
shaunpatterson wants to merge 1 commit into
Open
Conversation
Adds a tab strip above the query editor so multiple queries can be drafted side by side. Tab state lives in the query reducer: the existing top-level fields remain the live (active-tab) fields, and switching tabs saves/restores them, so all existing consumers are untouched. Legacy persisted state without tabs hydrates into a single tab containing the current query. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
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.

What
Adds browser-style tabs to the query editor: a slim tab strip above the editor toolbar with per-tab query text, query/mutate action, and query variables. + adds a tab, × closes one (hidden when only one tab remains), double-click renames inline (Enter/blur commits, Escape cancels).
Design
The existing top-level
query/action/queryVars/allQueriesfields in the query reducer remain the live state for the active tab, so every existing consumer — EditorPanel, frames actions, history loading viaupdateQueryAndAction— works unchanged. Switching tabs saves the live fields into the departing tab and loads the target's. The reducer also syncs the active tab's snapshot on every action, so loading a query from history updates the active tab and persisted snapshots are never stale.queryslice is already redux-persist-whitelisted. Legacy persisted state (notabs) hydrates into a single "Query 1" tab seeded from the current fields via an unconditional reducer guard, so old state can never crash; a danglingactiveTabIdis repaired the same way.allQuerieskeeps the query/mutate text memory isolated between tabs.uuiddependency (same pattern as frames).Testing
15 reducer tests (~45 assertions) through real action creators: add/switch/close/rename, neighbor selection in both directions, close-last reset, unknown-id no-ops, empty-rename ignored, legacy migration (query and mutate mode), switch-preserves-edits, history loads targeting the active tab, counter numbering.
npm run buildpasses.🤖 Generated with Claude Code