Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions custom_components/taskmate/www/locales/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -3250,6 +3250,7 @@
"kiosk.all_done": "Alt klaret for i dag — fantastisk, {name}!",
"kiosk.waiting": "Venter på en voksen",
"kiosk.needs_check": "En voksen tjekker",
"kiosk.up_for_grabs": "Først til mølle — den første vinder",
"kiosk.do_on_phone": "Gør denne på din telefon",
"kiosk.phone_group": "Gør disse på din telefon",
"kiosk.nothing_here": "Intet at sætte flueben ved her i dag",
Expand Down
2 changes: 1 addition & 1 deletion custom_components/taskmate/www/locales/da/cards.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions custom_components/taskmate/www/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -3305,6 +3305,7 @@
"kiosk.all_done": "Heute alles erledigt — super, {name}!",
"kiosk.waiting": "Warte auf einen Erwachsenen",
"kiosk.needs_check": "Ein Erwachsener prüft das",
"kiosk.up_for_grabs": "Wer zuerst kommt, gewinnt",
"kiosk.do_on_phone": "Mach diese auf deinem Handy",
"kiosk.phone_group": "Mach diese auf deinem Handy",
"kiosk.nothing_here": "Heute hier nichts abzuhaken",
Expand Down
2 changes: 1 addition & 1 deletion custom_components/taskmate/www/locales/de/cards.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions custom_components/taskmate/www/locales/en-GB.json
Original file line number Diff line number Diff line change
Expand Up @@ -3311,6 +3311,7 @@
"kiosk.all_done": "All done for today — amazing, {name}!",
"kiosk.waiting": "Waiting for a grown-up",
"kiosk.needs_check": "A grown-up will check",
"kiosk.up_for_grabs": "Up for grabs — first one wins",
"kiosk.do_on_phone": "Do this one on your phone",
"kiosk.phone_group": "Do these on your phone",
"kiosk.nothing_here": "Nothing to tick off here today",
Expand Down
2 changes: 1 addition & 1 deletion custom_components/taskmate/www/locales/en-GB/cards.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions custom_components/taskmate/www/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3311,6 +3311,7 @@
"kiosk.all_done": "All done for today — amazing, {name}!",
"kiosk.waiting": "Waiting for a grown-up",
"kiosk.needs_check": "A grown-up will check",
"kiosk.up_for_grabs": "Up for grabs — first one wins",
"kiosk.do_on_phone": "Do this one on your phone",
"kiosk.phone_group": "Do these on your phone",
"kiosk.nothing_here": "Nothing to tick off here today",
Expand Down
2 changes: 1 addition & 1 deletion custom_components/taskmate/www/locales/en/cards.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions custom_components/taskmate/www/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -3311,6 +3311,7 @@
"kiosk.all_done": "Tout est fait pour aujourd'hui — bravo, {name} !",
"kiosk.waiting": "En attente d'un adulte",
"kiosk.needs_check": "Un adulte vérifiera",
"kiosk.up_for_grabs": "Au premier arrivé — le plus rapide gagne",
"kiosk.do_on_phone": "Fais celle-ci sur ton téléphone",
"kiosk.phone_group": "Fais-les sur ton téléphone",
"kiosk.nothing_here": "Rien à cocher ici aujourd'hui",
Expand Down
2 changes: 1 addition & 1 deletion custom_components/taskmate/www/locales/fr/cards.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions custom_components/taskmate/www/locales/nb.json
Original file line number Diff line number Diff line change
Expand Up @@ -3311,6 +3311,7 @@
"kiosk.all_done": "Alt ferdig for i dag — kjempebra, {name}!",
"kiosk.waiting": "Venter på en voksen",
"kiosk.needs_check": "En voksen sjekker",
"kiosk.up_for_grabs": "Førstemann til mølla — den første vinner",
"kiosk.do_on_phone": "Gjør denne på telefonen din",
"kiosk.phone_group": "Gjør disse på telefonen din",
"kiosk.nothing_here": "Ingenting å krysse av her i dag",
Expand Down
2 changes: 1 addition & 1 deletion custom_components/taskmate/www/locales/nb/cards.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions custom_components/taskmate/www/locales/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -3311,6 +3311,7 @@
"kiosk.all_done": "Alles klaar voor vandaag — wat knap, {name}!",
"kiosk.waiting": "Wacht op een volwassene",
"kiosk.needs_check": "Een volwassene kijkt na",
"kiosk.up_for_grabs": "Wie het eerst komt, wint",
"kiosk.do_on_phone": "Doe deze op je telefoon",
"kiosk.phone_group": "Doe deze op je telefoon",
"kiosk.nothing_here": "Hier vandaag niets om af te vinken",
Expand Down
2 changes: 1 addition & 1 deletion custom_components/taskmate/www/locales/nl/cards.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions custom_components/taskmate/www/locales/nn.json
Original file line number Diff line number Diff line change
Expand Up @@ -3311,6 +3311,7 @@
"kiosk.all_done": "Alt ferdig for i dag — kjempebra, {name}!",
"kiosk.waiting": "Ventar på ein vaksen",
"kiosk.needs_check": "Ein vaksen sjekkar",
"kiosk.up_for_grabs": "Fyrstemann til mølla — den første vinn",
"kiosk.do_on_phone": "Gjer denne på telefonen din",
"kiosk.phone_group": "Gjer desse på telefonen din",
"kiosk.nothing_here": "Ingenting å kryssa av her i dag",
Expand Down
2 changes: 1 addition & 1 deletion custom_components/taskmate/www/locales/nn/cards.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions custom_components/taskmate/www/locales/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -3250,6 +3250,7 @@
"kiosk.all_done": "Na dziś wszystko zrobione — rewelacja, {name}!",
"kiosk.waiting": "Czeka na dorosłego",
"kiosk.needs_check": "Dorosły to sprawdzi",
"kiosk.up_for_grabs": "Kto pierwszy, ten lepszy",
"kiosk.do_on_phone": "To zrób na swoim telefonie",
"kiosk.phone_group": "Te zrób na swoim telefonie",
"kiosk.nothing_here": "Dziś nie ma tu nic do odhaczenia",
Expand Down
2 changes: 1 addition & 1 deletion custom_components/taskmate/www/locales/pl/cards.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions custom_components/taskmate/www/locales/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -3311,6 +3311,7 @@
"kiosk.all_done": "Tudo feito por hoje — incrível, {name}!",
"kiosk.waiting": "Aguardando um adulto",
"kiosk.needs_check": "Um adulto vai conferir",
"kiosk.up_for_grabs": "Quem chegar primeiro leva",
"kiosk.do_on_phone": "Faça esta no seu celular",
"kiosk.phone_group": "Faça estas no seu celular",
"kiosk.nothing_here": "Nada para marcar aqui hoje",
Expand Down
2 changes: 1 addition & 1 deletion custom_components/taskmate/www/locales/pt-BR/cards.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions custom_components/taskmate/www/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -3311,6 +3311,7 @@
"kiosk.all_done": "Tudo feito por hoje — fantástico, {name}!",
"kiosk.waiting": "À espera de um adulto",
"kiosk.needs_check": "Um adulto vai verificar",
"kiosk.up_for_grabs": "Quem chegar primeiro leva",
"kiosk.do_on_phone": "Faz esta no teu telemóvel",
"kiosk.phone_group": "Faz estas no teu telemóvel",
"kiosk.nothing_here": "Nada para marcar aqui hoje",
Expand Down
2 changes: 1 addition & 1 deletion custom_components/taskmate/www/locales/pt/cards.json

Large diffs are not rendered by default.

25 changes: 24 additions & 1 deletion custom_components/taskmate/www/taskmate-kiosk-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -1886,6 +1886,10 @@ class TaskMateKioskCard extends LitElement {
// missed-chore mode says, so it never offers a Done button.
const dimMissed = row.missed && (this._missedMode() === "dim" || (!!row.setTime && state === "todo"));
const needsCheck = state === "todo" && !dimMissed && chore.requires_approval !== false;
// First come: it sits on every sibling's list until one of them finishes
// it, so mark it as a race rather than as this child's own chore.
const upForGrabs = chore.assignment_mode === "first_come" && !dimMissed
&& (state === "todo" || state === "elsewhere" || state === "later");
let action;
if (dimMissed) {
action = html`<div class="km-done is-elsewhere"><ha-icon icon="mdi:clock-alert-outline"></ha-icon><span>${this._t("kiosk.missed")}</span></div>`;
Expand All @@ -1910,7 +1914,7 @@ class TaskMateKioskCard extends LitElement {
action = html`<div class="km-done is-elsewhere"><ha-icon icon="mdi:cellphone"></ha-icon><span>${this._t("kiosk.do_on_phone")}</span></div>`;
}
return html`
<div class="km-row ${dimMissed ? "missed" : state}">
<div class="km-row ${dimMissed ? "missed" : state}${upForGrabs ? " grab" : ""}">
<div class="km-row-icon">
${visual.kind === "image"
? html`<img src="${visual.url}" alt="" loading="lazy">`
Expand All @@ -1924,6 +1928,7 @@ class TaskMateKioskCard extends LitElement {
<div class="km-row-meta">
<span class="km-row-pts"><ha-icon icon="${icon}"></ha-icon> ${__tmNum(this.hass, this._pointsFor(chore, child.id))}</span>
${this._boostMult(chore, child.id) ? html`<span class="km-boost-x">×${this._fmtMult(this._boostMult(chore, child.id))}</span>` : ""}
${upForGrabs ? html`<span class="km-tag km-grab-tag"><ha-icon icon="mdi:hand-back-right"></ha-icon>${this._t("kiosk.up_for_grabs")}</span>` : ""}
${needsCheck ? html`<span class="km-tag"><ha-icon icon="mdi:account-check-outline"></ha-icon>${this._t("kiosk.needs_check")}</span>` : ""}
${undoable ? html`<button class="km-undo" ?disabled=${!!this._busy}
aria-label="${this._t("child.undo_named", { name: chore.name })}"
Expand Down Expand Up @@ -2399,6 +2404,24 @@ class TaskMateKioskCard extends LitElement {
.km-row.done .km-row-name { text-decoration: line-through; text-decoration-thickness: 2px; }
.km-row.elsewhere { opacity: 0.55; }
.km-row.missed { opacity: 0.5; }
/* A first-come chore: whoever finishes it first gets it. A dashed accent
border and a tinted background set it apart from this child's own. */
.km-row.grab {
border-style: dashed;
border-color: var(--tmd-warn, #e67e22);
background: color-mix(in srgb, var(--tmd-warn, #e67e22) 14%, var(--tmd-surface, var(--card-background-color, #fff)));
}
/* Tinted, not solid, like .km-tag: the design's own text colour on a
warn tint passes 4.5:1 in every design (a fixed dark ink on a solid
warn fill only reached 3.7:1 on Graphite). A stronger tint and a
dashed border, matching the row's, tell it apart from "A grown-up
will check" when both sit in the same row. */
.km-tag.km-grab-tag {
background: color-mix(in srgb, var(--tmd-warn, #e67e22) 28%, transparent);
color: var(--tmd-text, var(--primary-text-color));
border: 1.5px dashed var(--tmd-warn, #e67e22);
padding: 1px 8px;
}
.km-row-icon {
width: 50px; height: 50px; min-width: 50px; border-radius: 50%;
display: grid; place-items: center; overflow: hidden;
Expand Down
10 changes: 10 additions & 0 deletions tests/frontend/taskmate-kiosk-card.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,16 @@ test("done and waiting chores show their state; approval chores say a grown-up c
assert.match(markup, new RegExp(localize("kiosk.needs_check")));
});

test("a first-come chore is marked up for grabs", async () => {
const card = await childView({
chores: [chore("dishes"), chore("bins", { assignment_mode: "first_come", requires_approval: false })],
status: { children: [{ id: "vaiha", has_pin: false, can_act: true, due: ["dishes", "bins"] }] },
});
const { markup } = view(card);
assert.equal((markup.match(/km-row todo grab/g) || []).length, 1, "only the first-come chore");
assert.equal((markup.match(new RegExp(localize("kiosk.up_for_grabs"), "g")) || []).length, 1);
});

test("undo follows the #918 window and goes through undo_chore", async () => {
const card = await childView({
status: { children: [{ id: "vaiha", has_pin: false, can_act: true, due: [] }] },
Expand Down
4 changes: 4 additions & 0 deletions wiki/Kiosk-Mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,10 @@ These don't count against "all done", so a child with one of them still gets the

Chores that need approval show **A grown-up will check** and change to **Waiting for a grown-up** once ticked. A [teamwork chore](Teamwork-Chores.md) shows **Waiting for your team** after the child joins. If the [child undo window](Child-Undo-Window.md) is switched on, a child can take back a mistaken tap from the kiosk too.

A [first-come chore](Chore-Scheduling.md#first-come-first-served) sits on every child's list until one of them finishes it, so it's marked **Up for grabs — first one wins**, with a dashed border and a tinted row, to tell it apart from the child's own chores.

![A first-come chore on the kiosk: dashed row and tag, and one that also needs a grown-up's check](images/kiosk-up-for-grabs.png)

---

## Linked Accounts
Expand Down
Binary file added wiki/images/kiosk-up-for-grabs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading