feat: expand edge POP chip with telemetry panel - #100
Conversation
Make the footer chip interactive: Performance-based RTT, click-to-expand POP/city/country/protocol details, and light locate-to-ready motion.
|
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: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📜 Recent review details🔇 Additional comments (3)
📝 WalkthroughSummary by CodeRabbit
WalkthroughPopChip now measures POP latency and protocol, displays expandable telemetry details, handles dismissal interactions, and applies loading and ready-state animations. Tests cover timing fallbacks, accessibility behavior, failure states, and panel interactions. ChangesPopChip telemetry
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant PopChip
participant POPEndpoint
participant PerformanceResourceTiming
participant TelemetryPanel
PopChip->>POPEndpoint: fetch POP lookup
POPEndpoint-->>PopChip: return POP data
PopChip->>PerformanceResourceTiming: read endpoint timing
PerformanceResourceTiming-->>PopChip: return latency and protocol
PopChip->>TelemetryPanel: render ready telemetry
TelemetryPanel-->>PopChip: receive Escape or outside event
PopChip->>TelemetryPanel: close panel
Possibly related PRs
Suggested labels: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/pop-chip.test.tsx`:
- Around line 189-213: Add a focus-based dismissal test alongside the existing
PopChip dismissal tests: render PopChip, open it via the trigger, focus a
sibling button outside the component, and assert the trigger’s aria-expanded
changes to "false".
In `@src/components/pop-chip.tsx`:
- Around line 276-279: Update the loading, ready, and panel animation styles in
the PopChip component, including the elements around the “locating” indicator
and the referenced 317-353 section, to honor prefers-reduced-motion: reduce.
Disable the pulse/keyframe animations and transform transition under reduced
motion while preserving the existing appearance and behavior by default.
- Around line 193-200: Update the request flow around response.json() so the end
timestamp is captured immediately after the response body is consumed, before
calculating wallClockMs and updating state. Preserve the existing timing
fallback using latencyMs when available and wallClockMs otherwise.
- Around line 203-205: In the effect cleanup around the timeout and
AbortController, set disposed to true before calling controller.abort(). Guard
both success and error setState calls with if (!disposed), while preserving
timeout-triggered aborts as the "error" state.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 004b54dd-c85c-46f4-989c-a59eab4b95c3
📒 Files selected for processing (3)
src/app/globals.csssrc/components/pop-chip.test.tsxsrc/components/pop-chip.tsx
📜 Review details
🔇 Additional comments (3)
src/components/pop-chip.tsx (1)
3-165: LGTM!Also applies to: 174-174, 214-245
src/components/pop-chip.test.tsx (1)
1-187: LGTM!Also applies to: 215-227
src/app/globals.css (1)
121-142: LGTM!
Measure wall-clock RTT after body consume, ignore disposed effect completions, gate animations with motion-safe, and cover focus dismiss.
|
Addressed the four CodeRabbit review comments:
|
Summary
region · protocol · RTTsummary and an expandable telemetry panel (POP, city, country, proto, RTT).PerformanceResourceTimingfor RTT (responseEnd - requestStart), with wall-clock fallback when timing is unavailable.Test plan
pnpm test(48 passed)pnpm dev— footer shows chip, expand/collapse works