Skip to content

feat(dashboard): support ?view=domain deep-link#496

Open
vector-field wants to merge 1 commit into
Egonex-AI:mainfrom
vector-field:feat/domain-view-deeplink
Open

feat(dashboard): support ?view=domain deep-link#496
vector-field wants to merge 1 commit into
Egonex-AI:mainfrom
vector-field:feat/domain-view-deeplink

Conversation

@vector-field

Copy link
Copy Markdown

What

Adds a ?view=domain URL parameter to the dashboard so it can open directly on the domain flow view instead of always starting on the structural graph.

Why

Today the dashboard always loads on the structural view, and the only way to reach the domain view is to click the Domain toggle in the toolbar. That makes it impossible to bookmark or share a link that lands on the domain flow, or to have tooling launch the dashboard pointed straight at a domain graph. After running /understand-domain, jumping to the domain view is a common next step.

How

In the domain-graph.json fetch handler in App.tsx, after the domain graph is set in the store, check for ?view=domain and switch viewMode to "domain".

if (result.success && result.data) {
  setDomainGraph(result.data);
  // Deep-link: `?view=domain` opens straight on the domain flow view.
  if (new URLSearchParams(window.location.search).get("view") === "domain") {
    useDashboardStore.getState().setViewMode("domain");
  }
}

The switch is intentionally applied in the fetch handler, not at init — the domain view can't render until the domain graph is loaded into the store (App falls back to structural otherwise). It also composes cleanly with the existing token param, which is stripped from the URL separately while view persists.

Notes

  • No new imports — useDashboardStore is already used the same way a few lines above for the knowledge view.
  • Scope is minimal and additive: absent the param, behavior is unchanged (still defaults to structural).
  • Only domain is handled here since structural is the default and knowledge is auto-selected for knowledge graphs; happy to extend to a general view switch if preferred.

🤖 Generated with Claude Code

Opening the dashboard always lands on the structural view; reaching the
domain flow view requires manually clicking the Domain toggle. This adds a
`?view=domain` URL parameter so the dashboard can open directly on the domain
view (useful for bookmarks, shared links, and tooling that launches the
dashboard pointed at a domain graph).

The switch is applied in the domain-graph fetch handler rather than at init
because the domain view cannot render until the domain graph is loaded into
the store — applying it earlier would fall back to structural.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant