Skip to content

feat(tabs): show the open table's name and database in the window title (#1475)#1479

Open
datlechin wants to merge 1 commit into
mainfrom
feat/1475-table-title-indicator
Open

feat(tabs): show the open table's name and database in the window title (#1475)#1479
datlechin wants to merge 1 commit into
mainfrom
feat/1475-table-title-indicator

Conversation

@datlechin
Copy link
Copy Markdown
Member

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.

  • Window title = the open table's name.
  • Window subtitle = 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 .unified toolbar 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:

Tab Title Subtitle
Table table name database · schema
Query unchanged connection name
Create Table / ER Diagram / Server Dashboard label connection name

Query tabs never show a fabricated table name, even when a single editable table is resolved.

Notes

  • titleVisibility flips from .hidden to .visible on the editor window.
  • The old per-tab "Name - Preview" subtitle is gone. Preview state is already shown in the tab UI; the subtitle now carries the table context instead.

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 .unified toolbar, 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.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@datlechin datlechin force-pushed the feat/1475-table-title-indicator branch from badf207 to 0c17e83 Compare May 29, 2026 05:51
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +200 to +203
windowSubtitle = MainSplitViewController.resolveDefaultSubtitle(
tab: selectedTab,
connection: connection
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Add Currently Selected Table Indicator When Only One Table is Open

1 participant