Skip to content

Polestar: beta mark, variant picker by model and year, admission on the credentials - #86

Merged
vcanuel merged 3 commits into
mainfrom
polestar-beta
Oct 22, 2026
Merged

vcanuel merged 3 commits into
mainfrom
polestar-beta

Conversation

@vcanuel

@vcanuel vcanuel commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Part of #52

Changes

Admission on the credentials. PUT /connection/api-key and PUT /connection/polestar now ask the extension's Admission first. An account held back gets 403 not_admitted (the JSON error, the route named in its message) and nothing is stored; a failure to read the admission is a 500 internal. On the application key, the 409 instance_key check still comes first. The forms show a generic message ("reload the page") and leave the redirect to the extension's guards. TestAdmissionOfCredentials covers held, failing and admitted accounts for both routes.

Beta mark. A chip beside the Polestar heading on the Connection page (en/fr/sv).

Variant picker. The vehicle's settings ask for the model first, then the variant:

  • GET /variants gives each option's family (the contract and golden files are regenerated). The form groups by it: a family can be two words ("Polestar 2"), so cutting names was no option.
  • The model buttons (aria-pressed in a labelled role="group", one always pressed) show only when the variants are of several models, i.e. a Polestar of the Data Portal; a Volvo is offered its own family's only.
  • The model shown first: that of the variant in effect, else the vehicle's family, else the one all candidates share, else the only one; with none, "Automatic" alone and a hint to choose the model.
  • That model's variants of the vehicle's model year come first; the others are folded under "Other model years (n)" (aria-expanded/aria-controls), opened when it holds the chosen variant. Unknown year, or no variant of it: everything listed.
  • The two radio groups share one name, so one radio stays checked across them.
  • Pressing another model forgets a variant of the previous one.
  • The variant's label moved to VariantLabel.vue, shared by both groups.

AGENTS.md is updated (extension points, Polestar credential, vehicle settings, Connection page).

Tests

  • task unit: green (Go lint 0 issues, Vitest 1268 tests, coverage ~97 %, build).
  • go test ./internal/api on each commit.
  • task e2e: 120 passed, 2 skipped (the wrong-password tests, two projects only), including a new Playwright/axe test of a Polestar's model then variant on the four projects.

🤖 Generated with Claude Code

vcanuel and others added 3 commits October 22, 2026 13:58
The extension's Admission sent an account to its route before the Volvo
ID authorization only: an account could still give an application key or
a Polestar credential through the API. PUT /connection/api-key and PUT
/connection/polestar now ask it first and refuse with 403 not_admitted,
nothing stored; a failure to read it is a 500. The forms tell the user to
reload the page, where the extension's guards lead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Data Portal is not yet checked on a real car: the Connection page
says so beside the Polestar heading.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A Polestar of the Data Portal is offered every variant of its brand, a
long list of several models and years. The vehicle's settings now ask
for the model first (shown when the variants are of several), then list
that model's variants of the vehicle's model year, the others folded
under a toggle. Pressing another model forgets a variant of the
previous one. GET /variants gives each variant's family, which the form
groups them by: a model's name is no word to cut from the variant's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vcanuel
vcanuel merged commit 3b40c7f into main Oct 22, 2026
7 checks passed
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