Skip to content

feat(drawer): add ?view=yaml URL deep link for resource drawer#677

Open
nadaverell wants to merge 1 commit into
mainfrom
feature/yaml-deeplink
Open

feat(drawer): add ?view=yaml URL deep link for resource drawer#677
nadaverell wants to merge 1 commit into
mainfrom
feature/yaml-deeplink

Conversation

@nadaverell
Copy link
Copy Markdown
Contributor

Summary

Lets users bookmark or share a URL that opens the resource drawer straight into YAML view, e.g.:

/resources/pods?resource=ns/name&view=yaml

State stays in sync with the URL: toggling YAML on/off in the drawer adds/removes ?view=yaml; closing the drawer clears it. Normal row clicks (no ?view) still open in detail mode as before.

Wiring

  • WorkloadView fires a new onYamlChange?(yaml) callback whenever the drawer YAML toggle flips (called from switchView).
  • ResourceDetailDrawer threads it through the children render prop.
  • App.tsx subscribes to write the URL, and reads ?view=yaml on mount when restoring ?resource= from a deep link.

?view= is also used by TimelineView for list|swimlane, but the two routes are mutually exclusive and App.tsx strips view-specific params on view change, so there's no leak. TimelineView's value cast falls back to undefined if the param doesn't match.

Verified

  • Cold-start ?view=yaml → drawer opens directly to YAML
  • Toggle YAML on/off → URL updates / clears
  • Drawer close → ?view cleared
  • Normal row click (no ?view) → opens in detail mode (no YAML)

Lets users bookmark or share a URL that opens the resource drawer
straight into YAML view, e.g.:

  /resources/pods?resource=ns/name&view=yaml

State stays in sync with the URL: toggling YAML on/off in the drawer
adds/removes ?view=yaml; closing the drawer clears it. Normal row
clicks (no ?view) still open in detail mode as before.

Wiring:
- WorkloadView fires a new onYamlChange callback whenever the drawer
  YAML toggle flips
- ResourceDetailDrawer threads it through the children render prop
- App.tsx subscribes (writes URL) and reads ?view=yaml on mount when
  restoring ?resource= from a deep link
@nadaverell nadaverell requested a review from hisco as a code owner May 10, 2026 15:45
@cursor
Copy link
Copy Markdown

cursor Bot commented May 10, 2026

You have used all Bugbot PR reviews included in your free trial for your GitHub account on this workspace.

To continue using Bugbot reviews, enable Bugbot for your team in the Cursor dashboard.

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