Skip to content

fix(rewards): list only the selected child's rewards on a tabbed card (#1074) - #1075

Merged
tempus2016 merged 1 commit into
mainfrom
fix/1074-rewards-tab-sibling-rewards
Oct 15, 2026
Merged

tempus2016 merged 1 commit into
mainfrom
fix/1074-rewards-tab-sibling-rewards

Conversation

@tempus2016

Copy link
Copy Markdown
Owner

Fixes #1074

What was wrong

On a rewards card with no child_id pinned, every child tab listed every reward, including ones assigned only to a sibling. With that tab selected, the reward showed the selected child's progress and a Claim reward button. The backend then refused the claim, because the reward is not for that child. This was found while testing v6.4.0 on the dev Home Assistant. The behaviour is older than this release.

Fix

  • A new _rewardsFor() lists the rewards open to everyone plus those assigned to the pinned child or, when nothing is pinned, the selected tab. Both the classic and the designed render paths use it in place of their pinned-only filter.
  • In the designed styles, the empty state used to replace the whole body, tabs included. The tabs and child selector now stay up when the selected child has no rewards, so another child can still be picked. The classic path already kept its tabs.
  • A pinned card behaves as before.

Testing

  • 4 new tests in taskmate-rewards-card.test.cjs, run under classic and playroom: a tab lists only that child's rewards, and the tabs stay when the selected child has none. All 4 fail on main.
  • Full frontend suite: 721 passed. ESLint is clean and node --check passes.
  • Dev Home Assistant: I added a temporary reward assigned only to Vaiha and injected this branch's card. Malia's tab shows 2 rewards without it; Vaiha's tab shows 3 with it, in classic and playroom. Checked by eye in a screenshot. The reward was removed afterwards.

…#1074)

With no child_id pinned, every tab listed every reward, so a child was
shown a reward assigned only to a sibling, with a claim button the
backend then refused. The selected tab now filters the list the way a
pinned card does. In the designed styles the tabs stay up when the
selected child has nothing, so another child can still be picked.
@github-actions github-actions Bot added cards Lovelace cards / frontend (www/*.js) tests Test suite labels Oct 15, 2026
@tempus2016
tempus2016 merged commit 2fd53ef into main Oct 15, 2026
16 checks passed
@tempus2016
tempus2016 deleted the fix/1074-rewards-tab-sibling-rewards branch October 15, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cards Lovelace cards / frontend (www/*.js) tests Test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rewards card: a child tab lists rewards meant only for a sibling and offers to claim them

1 participant