← Back to Pull requests

fix(admin): say on a driver's page that an assigned vehicle is deactivated #826

Closed
unknown closed this pull request without merging on Dec 01, 2026 05:10 UTC
View on GitHub
unknown unknown commented on Dec 01, 2026 02:25 UTC
Author

A driver's page listed a deactivated vehicle under "Vehicles this driver may pick" just like one they can pick.

Deactivating a vehicle keeps its assignments, but the app offers a driver only active vehicles, and the server refuses a trip on any other. So a driver whose only vehicle was deactivated has nothing to pick, while their page shows a vehicle and "1 assigned" with nothing to say why. The Operator Manual's "No vehicles are assigned to you" row has to send the admin to the Vehicles list to find out.

The row now says so under the vehicle's name: "bus-7, deactivated, so the app does not offer it". The vehicle stays assigned and Remove works as before. I used a line of text rather than the Vehicles list's Deactivated pill, which would change the row's layout. admin.css builds the same.

Tests: TestUserEditPage_DeactivatedAssignedVehicle, for an admin and a viewer: the active vehicle's row has no note and the deactivated one's has it. It fails on main. I broke the change 3 ways and a test failed each time.

go fmt, go vet and go test ./... pass, with the database tests (4,698 tests).

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

<!-- coderabbit-ai-generated:v1 -->

Summary by CodeRabbit

New Features
Assigned vehicles now show their active or deactivated status on the user form. Deactivated vehicles remain visible in the assignment list, with a notice that the app does not offer them. Active vehicles continue to appear without the deactivation notice.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Diff: 199 lines (+149 / -50) across 2 files Reviewer: aaronbrethorst Review duration: 164m
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.36) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 199 lines diff across 2 files
0.36
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
56%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.317
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #826"
general weight: 0.35
Assignees
Unassigned
Labels
risk: low confidence: 56.8% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 36.1% (MEDIUM) · Higher = larger blast radius
36.1%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 56.8% · Lower = rushed or shallow review
56.8%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 15.6% · Safe to merge
15.6%