feat(desktop): Pages row in Settings > Links — external/internal + split/tab (SUPER-2315, SUPER-2192)

Merged
HA
2mo ago
+235-13

What

SUPER-2315 — a dedicated "Pages" row in Settings → Links so a Page link's destination (Superset vs. system browser) is configured independently of the generic "URL links" default.

SUPER-2192 — the placement axis on top of that: once a Page opens inside Superset, whether it splits the active pane or opens as a new tab.

SUPER-2315 — why / fix

runUrlLinkAction recognized Page URLs (parseSupersetPageUrl), but only after checking whether the resolved click action was "external":

if (action === "external") { openExternal(url); return; }   // ← exits before the page check
const pageSlug = parseSupersetPageUrl(url, ...);
if (pageSlug) { openPagePaneInStore(...); return; }

Anyone whose "URL links" default click is external never reached the Page branch — a Page link always followed them out to the OS browser.

  • New pageOpenAction preference, a single select (not a modifier-tiered map) mirroring portOpenAction.
  • New "Pages" section in LinksSettings.tsx, same shape as "Ports".
  • TerminalPane's default URL click checks parseSupersetPageUrl before resolving the generic urlLinks tier, routing Page links through pageOpenAction instead. The right-click "Open in ..." context menu is untouched — an explicit pick always does exactly what it says.

SUPER-2192 — why / fix

openPagePaneInStore always hardcoded "tab" placement, so there was never actually a difference between "pane" and "newTab" for pages — both landed in the same place. This closes that gap now that a placement primitive already existed (focusOrOpenPane's "split" | "tab", previously only ever called with "tab").

  • openPagePaneInStore(store, page, placement) — placement defaults to "split", forwarded to focusOrOpenPane.
  • pageOpenAction gets its third value back: "newTab" is back in the Pages Settings row, now backed by a real distinct outcome.
  • runUrlLinkAction and the right-click "Open in ..." submenu both map their action to a placement, so picking "New Tab" on a page link actually tabs instead of always splitting/tabbing the same way.
  • useOpenPage's inPane decision falls back to pageOpenAction === "pane" when a caller doesn't pass an explicit override, so the Pages grid's plain click (not just terminal links) honors the setting too. Modifier-click there still forces inPane, unchanged.
  • Dropped the "Open in Superset" placeholder label now that "pane" truly means a split — the existing actionLabel "Open in split pane" wording is accurate, so lingui correctly extracted the now-orphaned string out of every locale catalog.
  • Updated openPagePaneInStore's tests for the new split-by-default behavior and added coverage for explicit "tab" placement.

Testing

  • bun run --filter=@superset/desktop typecheck — pass
  • bun run check:i18n — clean, 0 missing across all 16 locales
  • bun run --filter=@superset/desktop test — 3752/3754 pass; the 2 failures are in terminal-ws-transport.test.ts (jest.advanceTimersByTime incompatibility), pre-existing and unrelated — reproduced identically on main before this change
  • biome check on touched files — clean
  • Addressed CodeRabbit review feedback: hover-tooltip/click-action mismatch for Page links, and an Italian translation wording fix

Closes SUPER-2315, SUPER-2192.

https://claude.ai/code/session_01V89xJG2G36ArAT9XM9WygA

Summary by CodeRabbit

  • New Features

    • Added a Pages link preference in Links settings.
    • Choose whether Page links open in a pane, a new tab, or the external browser.
    • Page links from terminals, chat messages, task markdown, and page views now follow the selected preference.
    • The preference defaults to opening links in a pane.
    • Page links opened in panes now split the current tab by default.
  • Localization

    • Added translations for the Pages setting and its description across supported languages.