feat: shareable replay deep-link on /cockpit (?replay=<id>&step=<n>) [agent:clawd]#7
Conversation
Hydrate the guided replay from a shareable URL on mount, keep the URL in sync per step via history.replaceState, and add a Copy-link control to the replay rail. Navigating to /cockpit?replay=flux-retry&step=3 now arms the replay at that beat; invalid/missing params degrade gracefully. Closes #6 agent:clawd
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough
ChangesShareable Replay Deep-Link
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
The mount effect may run before the ops snapshot resolves, so setReplayRoutingRule has no cache entry to update and the routing-applied state is lost on first load. Add a [data] effect that re-applies the routing rule once for the deep-linked step as soon as data is available. Addresses autoreview [P2] finding. agent:clawd
Closes #6
What
Shareable replay deep-links on
/cockpit:?replay=<scenarioId>arms the guided incident replay at step 0, and&step=<n>jumps to a specific beat. As the viewer steps through the replay, the URL stays in sync (history.replaceState— no extra history entries, no scroll jump), so every beat is copy-shareable. A Copy link control in the replay rail copies the current beat's URL.This makes SignalOps' strongest first-90-seconds recruiter moment reachable via a direct link — the portfolio case study and wow-lab roadmap can now drop a viewer straight into a specific replay beat.
Changes (additive, 2 files, +138/-6)
src/components/dashboard.tsxreadReplayParams()— parses?replay/&stepclient-side, validates the id againstreplayScenarios, clamps the step to the valid range; unknown/empty/invalid values degrade to no replay (no crash).replayScenarioId/replayStepIndexseeded from the URL via lazy state init (no mount flash).goToReplayStep()(rAF-deferred so the scroll target settles first).syncReplayUrl()on scenario/step change; replay exit clears the params.src/components/incident-replay.tsxCopyLinkButton— clipboard write of the current URL (already kept in sync by the dashboard), with a 2s "Copied" confirmed state; silently no-ops when clipboard is unavailable.No new runtime dependencies. No rewrite of existing
dashboard.tsxcontrol logic — URL hydration just seeds the initialgoToReplayStep()call.Verification
pnpm checkgreen (lint + typecheck + build). Next.js 16.2.6 production build compiles,/cockpitprerenders as static./cockpit?replay=flux-retryarms at step 0;?replay=template-cost&step=3lands on step 3 (clamped); stepping updates the URL; Copy link yields a working URL;?replay=garbageloads the normal dashboard with no console error; replay exit clears params.agent:clawd
Summary by CodeRabbit
replayandstep), including automatic step clamping, URL synchronization, and reliable application after data loads.