Make Display Priority 0 Hide Vehicles#5321
Conversation
✅ Deploy Preview for teslamate ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@swiffer @JakobLichterfeld thoughts on this? |
|
not sure i like mixing display_priority and show_in_dashboards by reusing the display_priority field. in #5188 we've started sorting the vehicles in the teslamate settings by display_priority - that means all vehicles with prio 0 will be shown first (instead of last which would be expected). This PR looks good to me UI-wise (exposing display_priority, new toggle and grouped in Visualization) - the backend related changes still look larger than needed and overall this PR now is in between two different to approaches overall which makes it hard to review. |
Same here, and with tendency to dislike it, as this are separate use cases.
Only can echo this and repeat from here:
Combined with switching git usernames I tend to close and block. |
Hey Jacob, this PR is from my brother.... him and I decided to work on this together since we both use teslamate. I'll wait for him to chime in. |
I am uneasy with this also. We are reusing one attribute for two different purposes. Which means for example that if you want to hide a value can no longer store the display_priority anymore. Maybe trivial here, but makes me uneasy. My LLM said "When a car is hidden, the priority input is disabled (not submitted). When re-enabling, the fallback logic returns 1, silently discarding any previously set custom priority." I asked my LLM, and it pointed out some other potential issues:
I haven't investigated these in too much detail, but I think they do deserve some attention. |


Summary
This exposes the existing per-car
display_prioritysetting in Settings as a small “Visualization” section and reuses that same field for Grafana dashboard visibility.Cars with
display_priority > 0continue to appear in dashboard car selectors, ordered bydisplay_priority. Setting the car to hidden storesdisplay_priority = 0, so no new setting column or migration is needed.Rationale
The goal is to let users keep a car in TeslaMate and continue managing it in Settings, while hiding it from Grafana dashboard selectors when it should not appear in visualizations.
This keeps dashboard visibility and dashboard ordering represented by one existing field instead of introducing a separate
show_in_dashboardssetting.Changes
car_idvariables withdisplay_priority > 0.display_priority.Verification
mix testMIX_ENV=test mix cimix gettext.extract --check-up-to-dategit diff --checkcar_idvariables use the visibility filter.