feat(tabs): show the open table's name and database in the window title (#1475)#1479
feat(tabs): show the open table's name and database in the window title (#1475)#1479datlechin wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: badf207bba
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| windowTitle = newSession.connection.name | ||
| } | ||
| view.window?.subtitle = newSession.connection.name | ||
| windowSubtitle = newSession.connection.name |
There was a problem hiding this comment.
Preserve table subtitle across session refreshes
When a table tab is selected and the connection session changes without selecting another tab (for example after reconnect/status changes or database/schema updates), this unconditionally replaces the new database · schema subtitle with the connection name. Since the existing tab selection does not necessarily change afterward, updateWindowTitleAndFileState() may not run to restore the table context, leaving the visible window subtitle stale until the user switches tabs.
Useful? React with 👍 / 👎.
badf207 to
0c17e83
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0c17e830f8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| windowSubtitle = MainSplitViewController.resolveDefaultSubtitle( | ||
| tab: selectedTab, | ||
| connection: connection | ||
| ) |
There was a problem hiding this comment.
Preserve preview state in the subtitle
When preview tabs are enabled and a table is opened as a preview, this now sets the subtitle only from the table context, while the commit also removed the previous updatePreviewSubtitle calls. I checked the remaining isPreview usages and there is no other UI marker for a preview tab, even though preview tabs are filtered out of persistence, so a temporary preview window tab is indistinguishable from a promoted table tab until it unexpectedly gets replaced or dropped on restart.
Useful? React with 👍 / 👎.
Closes #1475.
Problem
When only one table tab is open, there's no indicator of which table you're viewing. The native tab bar is hidden by macOS for a single tab, and TablePro also hid the window title, so the only cue was the highlighted row in the sidebar, which means scrolling a long list to find it.
Fix
Show the table identity where macOS expects it: the window title bar.
database · schema(schema is dropped for databases that don't have one, like MySQL).This is the HIG-canonical place to "confirm your location" (
NSWindow.subtitle, macOS 11+), and it's what TablePlus and DataGrip do. The.unifiedtoolbar with a visible title is already used by the inspector window, so the chrome doesn't change height.Title and subtitle now resolve through one shared resolver, so they can't drift. The subtitle updates live on every tab switch, table change, and reconnect (same path as the title), so it never goes stale.
Behavior by tab type:
database · schemaQuery tabs never show a fabricated table name, even when a single editable table is resolved.
Notes
titleVisibilityflips from.hiddento.visibleon the editor window.Tests
14 new cases for the subtitle resolver:
database · schema, schema omission, query-tab non-fabrication, and the connection-name fallbacks (no database, no table name, non-table tab types).To verify on build
With the
.unifiedtoolbar, the title sits at the leading edge next to the centered connection chip. Worth a glance to confirm they don't crowd each other on a narrow window. If they do, the native fix is to adjust the toolbar item layout, not change the approach.