Add multiple editor tabs with independent connections (#14)#31
Open
Add multiple editor tabs with independent connections (#14)#31
Conversation
Refactors App to support multiple tabs, each with its own editor buffer, database connection, query results, and sidebar state. Features: - EditorTab struct encapsulates per-tab state (connection, editor, results, sidebar, query history) - Tab bar renders above main content when multiple tabs exist, showing connection indicator (●/○) and database name - Ctrl+T creates a new tab, Ctrl+W closes current tab - Alt+Left/Right cycles between tabs - Alt+1..9 jumps directly to tab N - Each tab maintains independent connection and schema browser - Closing last tab replaces it with a fresh empty tab - Esc in connection dialog closes empty tab if other tabs exist - Status bar shows current tab position (Tab N/M) Closes #14 Co-Authored-By: Claude Opus 4.6 <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.
Summary
Appto support multiple editor tabs via a newEditorTabstruct, each with its own editor buffer, database connection, query results, sidebar state, and query historyChanges
src/ui/app.rs: CreatedEditorTabstruct encapsulating per-tab state; refactoredAppto holdVec<EditorTab>andactive_tab; addedtab()/tab_mut()accessors; addednew_tab()/close_tab()/next_tab()/prev_tab()methods; updated all input handlers and business logic to use tab-based statesrc/ui/components.rs: Addeddraw_tab_bar()function; updated layout to conditionally include tab bar row; updated all rendering functions to read fromapp.tab()instead of directapp.*fields; added tab shortcuts to help overlay; added tab position to status barDesign Decisions
EditorTabto cleanly separate concernsTest plan
cargo checkpassescargo clippypasses with no warningscargo fmtproduces no changesCloses #14
🤖 Generated with Claude Code