Skip to content

fix(share): open shared EV charger links on the EV layer for new visitors - #145

Merged
GeiserX merged 1 commit into
mainfrom
fix/ev-share-link-fuel
Sep 18, 2026
Merged

GeiserX merged 1 commit into
mainfrom
fix/ev-share-link-fuel

Conversation

@GeiserX

@GeiserX GeiserX commented Sep 18, 2026 •

Copy link
Copy Markdown
Owner

Sharing an EV charger produced /es?station=ES:reve-…&lat=…&lng=… with no fuel. A fresh visitor opened that on the default fuel (Diesel A); the viewport fetch is fuel-filtered, so the charger never loaded and the deep-link resolver, which only matches loaded features, never opened the popup. The visitor saw diesel stations around the spot with no hint anything failed. Since #143 every German charger link is affected too.

Fixes #129 the way the issue sketched it:

  • buildStationQuery carries the fuel the station was shared from (popup share/copy, and the URL the app writes on selection).
  • readDeepLink's station branch validates and applies fuel exactly like the route branch already did.

Links without a fuel behave as before (default fuel), and an invalid code is ignored. Regression tests on all three layers (URL helpers, popup share link, HomeClient deep-link read); each was checked to fail against the unfixed code.

Summary by CodeRabbit

  • New Features
    • Station deep links now preserve the selected fuel type, including EV.
    • Shared station links open with the correct fuel layer and location.
    • Invalid or missing fuel values continue to use the default E5 layer.

…tors

A station share link carried no fuel, so a fresh visitor landed on the default fuel; the viewport fetch is fuel-filtered, the charger never loaded and the popup never opened (#129). Station links now carry the fuel they were shared from, and the deep-link reader honours it the way route links already did. Old links without a fuel behave as before.
@coderabbitai

coderabbitai Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 08f4efb7-2eab-4f49-9375-a1a81e310a52

📥 Commits

Reviewing files that changed from the base of the PR and between d1ac375 and d38c7b8.

📒 Files selected for processing (6)
  • src/components/home-client.deeplink.test.tsx
  • src/components/home-client.tsx
  • src/components/map/station-popup.test.tsx
  • src/components/map/station-popup.tsx
  • src/lib/share-url.test.ts
  • src/lib/share-url.ts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Station share URLs now preserve the selected fuel. Station deep-link parsing validates that fuel and applies valid values. Tests cover EV, default, invalid, absent, and serialized fuel values.

Changes

Station fuel deep links

Layer / File(s) Summary
Share URL fuel contract
src/lib/share-url.ts, src/lib/share-url.test.ts
StationShareParams accepts optional fuel. Station URLs serialize non-empty fuel values, and parsing returns the raw value or null. Tests cover these cases.
Station link creation and resolution
src/components/map/station-popup.tsx, src/components/home-client.tsx, src/components/map/station-popup.test.tsx, src/components/home-client.deeplink.test.tsx
Station popup links include the active fuel. Station deep links validate and apply supported fuel values. The write effect updates the URL when the selected fuel changes. Tests cover EV, default, invalid, and absent fuel values.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to d38c7

The change preserves and validates station-link fuel selection with regression coverage for valid, invalid, and absent values.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 6 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: shared EV charger links now open on the EV layer for new visitors.
Linked Issues check ✅ Passed The PR satisfies the coding requirements in [#129]. buildStationQuery accepts and emits fuel, and StationPopup passes the active station fuel. readDeepLink validates station fuel with `fuelTyp…
Out of Scope Changes check ✅ Passed The changed files support [#129]. The URL helper changes define the station fuel parameter, the popup and HomeClient changes produce and consume it, and the test changes provide regression coverage. N…
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@GeiserX

GeiserX commented Sep 18, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@GeiserX
GeiserX merged commit 412247e into main Sep 18, 2026
8 checks passed
@GeiserX
GeiserX deleted the fix/ev-share-link-fuel branch September 18, 2026 12:24
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.

Shared EV charger links never open the station popup for new visitors

1 participant