Skip to content

feat: expand edge POP chip with telemetry panel - #100

Merged
j-cadena-g merged 2 commits into
mainfrom
feature/pop-chip-v2
Aug 11, 2026
Merged

feat: expand edge POP chip with telemetry panel#100
j-cadena-g merged 2 commits into
mainfrom
feature/pop-chip-v2

Conversation

@j-cadena-g

Copy link
Copy Markdown
Owner

Summary

  • Turn the footer POP chip into a disclosure control with region · protocol · RTT summary and an expandable telemetry panel (POP, city, country, proto, RTT).
  • Prefer PerformanceResourceTiming for RTT (responseEnd - requestStart), with wall-clock fallback when timing is unavailable.
  • Add locate→ready motion plus panel open animation; close via Escape, outside pointer/focus, with a11y fixes from local CodeRabbit review.

Test plan

  • pnpm test (48 passed)
  • Local CodeRabbit review (0 findings after fixes)
  • pnpm dev — footer shows chip, expand/collapse works
  • Confirm Escape and outside click close the panel
  • On a Vercel preview, confirm city/country appear when geo headers are present

Make the footer chip interactive: Performance-based RTT, click-to-expand
POP/city/country/protocol details, and light locate-to-ready motion.
@vercel

vercel Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cadena-sh Ready Ready Preview Aug 11, 2026 8:55pm

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: c1e2e6a7-8f40-4002-b425-70dc56b80368

📥 Commits

Reviewing files that changed from the base of the PR and between 780b2cc and 2ecd9f0.

📒 Files selected for processing (2)
  • src/components/pop-chip.test.tsx
  • src/components/pop-chip.tsx
📜 Recent review details
🔇 Additional comments (3)
src/components/pop-chip.tsx (2)

169-169: LGTM!

Also applies to: 184-195, 209-218


286-289: LGTM!

Also applies to: 318-318, 327-351, 363-363

src/components/pop-chip.test.tsx (1)

215-246: LGTM!


📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added animated loading and ready states for the POP status chip.
    • Added expandable telemetry details, including POP location, protocol, and latency.
    • Added configurable request timeout handling with fallback latency measurement.
    • Improved keyboard and pointer interactions for dismissing expanded details.
    • Enhanced accessibility for the status chip.
  • Tests

    • Added coverage for protocol detection, latency calculations, loading and error states, telemetry interactions, and fallback behavior.

Walkthrough

PopChip 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.

Changes

PopChip telemetry

Layer / File(s) Summary
Timing measurement and fallback
src/components/pop-chip.tsx, src/components/pop-chip.test.tsx
PopChip reads normalized protocol and latency data from PerformanceResourceTiming. It falls back to wall-clock latency when resource timing is unavailable. Tests cover timing extraction, loading, ready, and failure states.
Telemetry panel and visual states
src/components/pop-chip.tsx, src/app/globals.css, src/components/pop-chip.test.tsx
PopChip now renders expandable telemetry rows, supports Escape and outside-event dismissal, exposes accessibility attributes, and applies loading and ready animations. Tests cover panel interaction and displayed 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
Loading

Possibly related PRs

Suggested labels: v0

Poem

I’m a rabbit with a ready chip,
Measuring hops on every trip.
POP and RTT now softly glow,
Panels open, then close just so.
With timing clear, the bytes can leap!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: expanding the edge POP chip with a telemetry panel.
Description check ✅ Passed The description directly explains the telemetry panel, RTT measurement, animations, dismissal behavior, accessibility fixes, and testing.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/pop-chip-v2
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch feature/pop-chip-v2

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between c70b2cc and 780b2cc.

📒 Files selected for processing (3)
  • src/app/globals.css
  • src/components/pop-chip.test.tsx
  • src/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!

Comment thread src/components/pop-chip.test.tsx
Comment thread src/components/pop-chip.tsx
Comment thread src/components/pop-chip.tsx
Comment thread src/components/pop-chip.tsx Outdated
Measure wall-clock RTT after body consume, ignore disposed effect
completions, gate animations with motion-safe, and cover focus dismiss.
@j-cadena-g

Copy link
Copy Markdown
Owner Author

Addressed the four CodeRabbit review comments:

  1. Wall-clock fallback now timestamps after response.json()
  2. Effect cleanup sets disposed before abort and guards both setState paths
  3. Animations/transitions use motion-safe: so they skip under reduced motion
  4. Added a focus-outside dismissal test

pnpm test — 49 passed

@j-cadena-g
j-cadena-g merged commit 7b58cd1 into main Aug 11, 2026
7 checks passed
@j-cadena-g
j-cadena-g deleted the feature/pop-chip-v2 branch August 11, 2026 21:03
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