You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+19-2Lines changed: 19 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,32 @@
1
1
# Changelog
2
2
3
+
## [0.2.19-beta2] — 2026-05-30
4
+
5
+
Beta release. Two additions: a new 'Selected users' sidebar visibility mode, and a panel UI language override.
6
+
7
+
**Sidebar panel visibility**
8
+
9
+
- New `selected_users` mode. The Sidebar panel dropdown now reads: Admins only / Selected users / Everyone / Hidden.
10
+
- New `Selected users for sidebar` multi-select field in the install + reconfigure flows. Picks which HA users can access the panel when the mode is `selected_users`. Owner is implicitly allowed (pre-checked + stripped on save).
11
+
- Implementation: HA's `frontend.async_register_built_in_panel` only takes `require_admin: bool` — no per-user allowlist at the platform layer. In `selected_users` mode, the panel registers with `require_admin=False` and the panel.js side reads the allowlist from the registration config and gates the body client-side. The sidebar entry is visible to all users in this mode; non-allowed users see an access-denied placeholder when they click through.
12
+
-`CONF_PANEL_SELECTED_USERS` is added to `_RELOAD_REQUIRING_KEYS` so changes take effect on save.
13
+
14
+
**Panel UI language**
15
+
16
+
- New `Panel language` field in the install + reconfigure flows. Options: `auto` (default, follows each user's HA language), `en`, `sv`.
17
+
-`panel.js` resolves the effective language on render and looks up its hardcoded strings against a translation table. The most-visible strings are covered in this beta: bulk action buttons (Take all / Take due / Take missed), Saving spinner, modal section titles (Identity / Notes / Codes / Visibility / Prescriptions), modal buttons (Save / Cancel / Delete / + Add prescription), Add medicine label, Undo, loading/empty/access-denied placeholders. Status badges, schedule descriptions, and detailed form hints are not yet translated and stay English regardless of language setting — they remain a TODO for the next beta.
18
+
- HA-managed translations (the config flow forms) follow each user's HA language natively and are unaffected by this setting.
- New per-medicine `visibility` setting with four modes: `everyone` (default), `linked_person`, `admins_only`, `specific_users`. Owner and managers always pass regardless of mode — visibility is the gate for everyone else.
8
25
- Visibility section added to the panel's Add and Edit medicine modal. When `specific_users` is selected, a multi-select of HA users (lazy-fetched via the new `pillpilot/get_users` WS endpoint) appears with the owner pre-checked as an informational hint.
9
26
- Panel filters its rendering through `_canSeeMedicine`. The `_getMedicines` cache key now includes the current user_id so the filter result invalidates when sessions change.
10
27
- WS mutating commands (`update_medicine`, `delete_medicine`) carry a new `@_require_can_see_medicine` decorator stacked after `@_require_manager`. Both must pass: a manager who can't see the medicine cannot edit it either.
11
28
- Backend strips owner_id from `visibility_users` on save (v0.2.18 pattern applied here too). Owner remains implicitly allowed via `user.is_owner`.
12
-
- Sensors stay globally readable — HA's entity registry permissions are admin / non-admin only, so per-user filtering is panel-level. Sensor gating for hard privacy is Tier 3, deferred.
29
+
- Sensors stay globally readable — HA's entity registry permissions are admin / non-admin only, so per-user filtering is panel-level. Sensor gating for hard privacy is deferred.
13
30
- HA Settings reconfigure flow does not yet expose visibility — panel-only for this beta. Pre-v0.2.19 medicines keep `everyone` as their effective mode.
14
31
- New constants in `const.py`: `CONF_MED_VISIBILITY`, `CONF_MED_VISIBILITY_USERS`, `VIS_EVERYONE`, `VIS_LINKED_PERSON`, `VIS_ADMINS_ONLY`, `VIS_SPECIFIC_USERS`, `DEFAULT_MED_VISIBILITY`, `MED_VISIBILITY_OPTIONS`.
Beta release. Two additions: a fourth sidebar visibility mode and a panel UI language override.
4
4
5
-
## What's new
5
+
## Sidebar panel visibility
6
6
7
-
Each medicine now has a **Visibility** setting in the panel's Add and Edit modal. Four modes:
7
+
The Sidebar panel dropdown in Settings → Devices & services → PillPilot → Configure now reads:
8
8
9
-
-**Everyone** — default, backward-compat with pre-v0.2.19 medicines. Anyone with panel access can see and (if a manager) edit.
10
-
-**Linked person only** — only the HA users whose person entity is the `person_id` of any prescription on this medicine, plus owner and managers.
11
-
-**Admins only** — only owner, managers, and HA admins.
12
-
-**Specific users** — explicit allowlist. A multi-select of HA users appears beneath the mode dropdown; pick the ones who should see the medicine. Owner is pre-checked as an informational hint (owner always has access regardless) and stripped from the stored list on save.
9
+
-**Admins only** — only HA admins see the sidebar entry.
10
+
-**Selected users** — only HA users on the new allowlist see the useful panel content. Owner always has access.
11
+
-**Everyone** — anyone with PillPilot access sees the sidebar entry.
12
+
-**Hidden** — panel not registered at all.
13
13
14
-
Owner and managers always have access regardless of mode — visibility is the gate for everyone else.
14
+
When `Selected users` is picked, a multi-select user list appears under the dropdown. Add the users you want to grant access to. The owner is pre-checked as an informational hint (owner always has access regardless) and stripped from the stored list on save.
15
15
16
-
Mutating WS commands (`update_medicine`, `delete_medicine`) now check both manager status and visibility. A manager who can't see a medicine cannot edit it via the WS either.
16
+
**Platform limitation worth noting.** Home Assistant's panel registration API does not support per-user allowlists at the frontend layer — a panel is either registered (visible to everyone or admins-only) or not registered at all. The `Selected users` mode works around this by registering the panel for everyone and gating the panel body client-side in `panel.js`. The sidebar entry itself is visible to all users in this mode; clicking it as a non-allowed user shows an access-denied placeholder instead of the medicines view. The mutating WS commands (`create_medicine`, `update_medicine`, `delete_medicine`) remain gated server-side and aren't affected by this limitation.
17
17
18
-
## Known limitations
18
+
## Panel UI language
19
19
20
-
Sensors stay globally readable. Any HA user with access to Developer Tools can still read the sensor state of a restricted medicine. That's a Home Assistant platform limitation — entity registry permissions are admin / non-admin only, no per-user filtering. Tier 2 stops at panel-level visibility. Sensor gating (skip creating sensors for restricted medicines) is Tier 3 and deferred.
20
+
New **Panel language** field in the Configure form. Three options:
21
21
22
-
HA Settings reconfigure flow does not yet expose visibility. Panel-only for this beta. Visibility can only be set via the Add / Edit medicine modal in the panel.
22
+
-**Auto** (default) — follows each user's HA language at render time.
23
+
-**English** — force English regardless of HA locale.
24
+
-**Svenska** — force Swedish regardless of HA locale.
25
+
26
+
The most-visible panel strings are translated in this beta: bulk action buttons (Take all / Take due / Take missed), Saving spinner, modal section titles, modal buttons (Save / Cancel / Delete / Add prescription), and loading / empty / access-denied placeholders. Status badges (Due / Taken / Missed / etc), schedule descriptions, and detailed form hints are not yet translated and stay English for now — TODO for the next beta.
27
+
28
+
The Configure form translations (the labels for each field) follow HA's normal translation system and respect each user's HA locale automatically.
23
29
24
30
## Upgrading
25
31
26
-
Replace the `pillpilot` directory in `custom_components/` with the contents of this zip and restart Home Assistant. HACS users on the beta channel: update normally. Hard-reload the panel (Ctrl+Shift+R) — HACS doesn't bust the browser cache of `panel.js`.
32
+
Replace the `pillpilot` directory in `custom_components/` with the contents of this zip and restart Home Assistant. Hard-reload the panel (Ctrl+Shift+R) — the `?v=...` query string on the panel.js URL should bust the cache, but a hard reload guarantees it.
27
33
28
-
Pre-v0.2.19 medicines keep their current behavior — `everyone` is the effective mode until you edit a medicine and pick a different one.
34
+
No data migration. Existing installs keep their current sidebar visibility setting and default to `Auto` language. Pre-v0.2.19 medicines keep `Everyone` visibility.
0 commit comments