Skip to content

fix(rider-app): personalize chat surfaces + show driver vehicle (#79, #80)#86

Merged
variablefate merged 2 commits intomainfrom
fix/ride-status-card-79-80
Apr 29, 2026
Merged

fix(rider-app): personalize chat surfaces + show driver vehicle (#79, #80)#86
variablefate merged 2 commits intomainfrom
fix/ride-status-card-79-80

Conversation

@variablefate
Copy link
Copy Markdown
Owner

Summary

Two small ride-screen polish fixes for the iOS 1.0.1 ship, bundled in a single PR because both touch RidestrUI/Sources/RidestrUI/Components/RideStatusCard.swift and would have collided in separate branches. Each issue is a separate commit for git blame clarity.

Closes #79 — chat surfaces use the driver's name

  • RidestrUI.RideStatusCard chat button: Label("Chat with Driver", …)Label(Self.chatButtonLabelText(driverName: driverName), …). Falls back to the generic copy when driverName is nil/blank.
  • RoadFlare.WiredChatView navigation title: "Chat""Chat with [name]" resolved through the existing AppState.driverDisplayName(pubkey:) helper. Falls back to "Chat" when nil/blank.
  • New RideStatusCard.chatButtonLabelText(driverName:) static helper plus 2 unit tests covering present/nil/empty/whitespace driver names.
  • RoadFlare/RoadFlare/Views/Ride/ChatView.swift now imports RidestrSDK so it can read coordinator?.session.driverPubkey.

Closes #80 — show driver vehicle on driver-on-the-way / arrived

  • RidestrUI.RideStatusCard: additive vehicleDescription: String? = nil parameter (default nil, non-breaking — see issue Rider can\'t see car make/model/color on "driver on the way" / "driver arrived" screens #80's M-effort note).
  • Renders as a subtitle under the driver-name line on the en-route (driverAccepted / rideConfirmed / enRoute) and arrived (driverArrived) stages only. Hidden on idle / waitingForAcceptance / inProgress / completed since it stops being actionable there.
  • Wired from ActiveRideView via appState.driverProfile(pubkey:)?.vehicleDescription — the SDK's vehicleDescription already returns nil rather than emitting "Black undefined undefined" when fields are missing, so no host-side guard needed.
  • Existing fullInit / minimalInit tests updated to round-trip vehicleDescription.

Test plan

  • swift test --filter RideStatusCard on RidestrUI package — 10/10 pass (8 pre-existing + 2 new chat-label tests).
  • xcodebuild build -scheme RoadFlare from worktree — BUILD SUCCEEDED.
  • xcodebuild test -scheme RoadFlareTests — see "Known flakes" below.
  • Manual smoke: launch sim, observe en-route / arrived screens with a profile that has vehicle info → vehicle line appears; without it → row is hidden.
  • Manual smoke: open chat sheet with a known driver → title reads "Chat with [name]", button reads "Chat with [name]".

Known flakes (unrelated to this PR)

Three RoadFlareTests subscription/timing tests failed on first run; none touch the UI code in this PR (they exercise RideCoordinator / ChatCoordinator async subscription replacement using eventually {}):

  • RideCoordinatorTests/locationSubscriptionRestartsAfterAppliedNewerKeyShare
  • ChatCoordinatorTests/cleanupAsyncDoesNotUnsubscribeReplacementSubscription
  • ChatCoordinatorTests/subscribeToChatReplacesExistingSubscription

Re-running these in isolation to confirm flake (will update the PR if any reproduce).

Cross-app symmetry

For #79, the Drivestr Android driver app likely needs a parallel fix on its side ("Chat with Rider" → "Chat with [rider name]"). Worth filing a parallel issue in the ridestr repo — out of scope for this PR.

🤖 Generated with Claude Code

Replace the generic "Chat" / "Chat with Driver" labels with personalized
"Chat with [name]" copy in two surfaces:

- RidestrUI's RideStatusCard chat button label (uses the driverName the
  card already receives, falls back to "Chat with Driver" when nil/blank).
- RoadFlare's WiredChatView navigation title (resolves the driver name
  through the existing AppState.driverDisplayName helper, falls back to
  "Chat" when nil/blank).

Trusted-driver model: riders know their driver, so reinforce that
relationship and disambiguate when chatting across multiple rides.

Closes #79
The driver's vehicle description (color + make + model) is already
published in their Kind 0 profile and exposed via UserProfileContent's
vehicleDescription computed property, but it was never plumbed into the
rider's active-ride card. Without it, riders couldn't recognize which
car was theirs.

- Add an additive `vehicleDescription: String?` parameter (default nil,
  non-breaking) to RidestrUI.RideStatusCard.
- Render it as a subtitle under the driver-name line on the en-route
  ("driver is on the way") and arrived ("driver has arrived") stages
  only — hidden during idle/waiting/inProgress/completed where it
  stops being actionable.
- Wire it from RoadFlare.ActiveRideView using the existing
  AppState.driverProfile helper, falling back to nil when the cached
  profile lacks vehicle info (the SDK's vehicleDescription already
  returns nil rather than emitting partial junk like "Black undefined
  undefined").

Closes #80
@variablefate
Copy link
Copy Markdown
Owner Author

First pass.

Three independent review passes (correctness / CLAUDE.md compliance / git history). Filtered by category (improve-codebase, lower-entropy, fix-bug); discarded scoring and nits.

In-scope findings: 0.

  • Correctness: the new vehicleDescriptionLabel, chatButtonLabelText, and chatTitle paths each handle nil / empty / whitespace inputs cleanly; observability flows correctly through @Observable AppState. No real bugs.
  • CLAUDE.md / ADR: the additive vehicleDescription: String? = nil parameter on RidestrUI.RideStatusCard is consistent with project precedent — prior commits 4d3e7ec and af955c2 added init params to the same component without ADRs. The "new public API" ADR threshold is for genuinely new design surface, not an additive optional default-nil parameter on an existing public type.
  • History / patterns: new code follows the established façade pattern (appState.driverDisplayName(pubkey:) / appState.driverProfile(pubkey:)). No regression of prior review feedback.

Adjacent (out-of-scope) finding: the new sites trim whitespace before isEmpty, while the pre-existing driverName checks at lines 146 / 199 / 237 don't. Pre-existing inconsistency (blame: 4d3e7ec); per the issue scope filed as #87 rather than widening this PR.

Pass 1 is clean — no pass 2 needed.

🤖 Generated with Claude Code

@variablefate variablefate marked this pull request as ready for review April 29, 2026 19:33
@variablefate variablefate merged commit 2bd5372 into main Apr 29, 2026
@variablefate variablefate deleted the fix/ride-status-card-79-80 branch April 29, 2026 21:30
variablefate added a commit that referenced this pull request Apr 29, 2026
Bumps CURRENT_PROJECT_VERSION from 1 to 2 across all 8 build
configurations in project.pbxproj. Build 1 was the live 1.0 build
uploaded 2026-04-16 20:25 PT; build 2 is the 1.0.1 candidate
shipping the merged work since (#66, #69, #71, #76, #84, #85, #86).

Per RELEASING.md, tag will land after App Store Connect confirms
upload acceptance, not before.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant