fix(admin): say on a driver's page that an assigned vehicle is deactivated #826
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
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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
aaronbrethorst
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 -->