Skip to content

ViewHeader shows a nameless title when a server reports serverInfo with an empty name #1774

Description

@cliffhall

Summary

Follow-up from the #1773 (closes #1772) review. That PR's initializeResult serverInfo fallback is object-level:

// App.tsx ~1477
const resolvedServerInfo = serverInfo ?? { name: activeServer?.name ?? "", version: "" };

?? only fires when the whole serverInfo object is absent (the modern-omitted case #1772 fixes). A server that reports serverInfo: { name: "" } (an empty-but-present name) therefore yields serverInfo.name === "", and ViewHeader (ViewHeader.tsx:246) renders a nameless title — while the tab bar works fine.

The Connection Info modal already degrades gracefully here (serverInfo.name || "—", added in #1773); the header does not.

Why this is separate from #1772

  • Different, milder failure mode: Modern-era connection with no serverInfo renders an empty header (no tabs) #1772 was no tab bar at all (server uninspectable); this is only a blank header name, tabs intact.
  • Needs a non-conforming-ish server (reports an empty name string) to reach.
  • The obvious fix (name: serverInfo?.name || activeServer?.name || "") would surface a catalog name while serverInfoReported is true, muddying the invariant that flag exists to keep clean — so it needs a deliberate decision about how serverInfoReported should behave in that case, not just a one-liner.

Suggested work

Decide the header's empty-reported-name behavior (degrade to catalog name? show "—"? and what serverInfoReported should then be), implement, and add an App test for a reported-but-empty name.

Metadata

Metadata

Assignees

Labels

v2Issues and PRs for v2

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions