Skip to content

feat(web): deep-link the dependency-graph drawer via ?graph=1 (TASK-1786)#723

Merged
xarmian merged 4 commits into
mainfrom
feat/graph-deeplink
Jun 8, 2026
Merged

feat(web): deep-link the dependency-graph drawer via ?graph=1 (TASK-1786)#723
xarmian merged 4 commits into
mainfrom
feat/graph-deeplink

Conversation

@xarmian

@xarmian xarmian commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Makes the per-item dependency graph drawer deep-linkable.

  • The item page auto-opens the graph drawer when loaded with ?graph=1, so any surface (item pages, standup reports, chat links) can link straight into the view: /{user}/{ws}/{collection}/{ref}?graph=1. The one-shot capture mirrors the existing ?new=1 pattern and is always reassigned, so a stale open state can't linger onto a subsequent item.
  • Opening/closing the drawer syncs the ?graph param (replaceState, no scroll) so the open state is shareable and back-button-aware. setGraphParam no-ops when already in sync to avoid redundant navigation.
  • Close is centralized via closeGraph() across the backdrop, Close button, and Escape handlers.

Context

Implements TASK-1786 under PLAN-1780 — the final task. Builds on the drawer (#721). Pairs with IDEA-1740's deep-linking idea.

Test plan

  • cd web && npm run check — 0 errors (preexisting unrelated warnings only)
  • cd web && npm run build — clean
  • [n/a] go tests — no Go changes

xarmian added 4 commits June 8, 2026 23:23
…786)

- The item page auto-opens the graph drawer when loaded with ?graph=1, so
  item pages / standup / chat can link straight into the view
  (/{user}/{ws}/{collection}/{ref}?graph=1). One-shot capture mirrors the
  existing ?new=1 pattern; always reassigned so a stale open state can't
  linger onto a subsequent item.
- Opening/closing the drawer syncs the ?graph param (replaceState, no scroll)
  so the open state is shareable and back-button-aware; setGraphParam no-ops
  when already in sync to avoid redundant navigation.
- Centralized close via closeGraph() across the backdrop, Close button, and
  Escape handlers.

Parent: PLAN-1780.
… Codex review (round 1)

- Capture the ?graph intent at request scope (reqGraph) and only apply the
  drawer open/close in loadData's finally when the load is still the current
  route (req slugs match). Prevents a late-finishing earlier load from forcing
  showGraph against a newer route.
- replaceState keeps ephemeral drawer toggles out of history by design; dropped
  the inaccurate "back-button-aware" claim from the comment (shareable is the
  real property).

Parent: PLAN-1780.
…s per Codex review (round 2)

loadData() runs for same-item SSE/sync refreshes as well as navigation. The
finally block forced showGraph from the URL on every run, so a refresh could
stomp a drawer toggle the user made mid-refresh. Thread an isNavigation flag
(true only from the route-param effect) so refreshes never touch showGraph;
the deep-link auto-open fires only on actual navigation.

Parent: PLAN-1780.
…per Codex review (round 3)

Same-slug ?graph navigations and browser back/forward update page.url without
retriggering loadData, so the prior loadData-coupled approach left showGraph
stale for search-param-only navigations. Drive showGraph from a dedicated
effect that watches the ?graph param instead:

- Handles initial load, navigation, back/forward, and param-only changes
  uniformly; data refreshes never touch it (they don't change the URL), which
  also resolves the earlier refresh-stomp finding.
- open/close just flip the param (setGraphParam); the effect reflects it. The
  lazy component load is deferred to a microtask so reading ItemGraphComp
  doesn't register as an effect dependency (no reactivity tangle).
- Added retryGraphLoad() for the import-failure Retry (param already set, so
  setGraphParam would no-op). Removed the now-unused loadData coupling
  (isNavigation flag, reqGraph capture, finally block).

Parent: PLAN-1780.
@xarmian
xarmian merged commit a37fa16 into main Jun 8, 2026
4 checks passed
@xarmian
xarmian deleted the feat/graph-deeplink branch June 8, 2026 23:37
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