Skip to content

The kitchen can actually hear it: a voice, real pauses, and no gesture - #842

Merged
sridharkalaibala merged 2 commits into
developfrom
fix/the-kitchen-can-actually-hear-it
Sep 16, 2026
Merged

sridharkalaibala merged 2 commits into
developfrom
fix/the-kitchen-can-actually-hear-it

Conversation

@sridharkalaibala

Copy link
Copy Markdown
Contributor

Follow-up to #837, prompted by two questions from the owner - and one of the three fixes here is the one that would otherwise have kept the speaker silent.

"little pause between line items"

The announcement was one sentence with full stops in it. A full stop is a shorter gap than a kitchen needs, so it is now one utterance per line:

Table 5, new order.
One Chicken Biryani.
One Chicken Tikka Masala.

A speech engine leaves a real gap between utterances - long enough to hold one dish in your head before the next arrives.

"its indian english. not so fluent"

An American voice reads biryani, paneer and kuzhambu like somebody who has never ordered one. Windows ships en-IN voices (Heera, Ravi), so one is preferred where the machine has it, then en-GB, then any English.

Chosen once and remembered: getVoices() fills in asynchronously, and asking per ticket is how the first announcement of a service comes out in the wrong accent. It also listens for onvoiceschanged, because asking at load usually returns an empty list.

The one nobody asked about, and the one most likely to have broken it

Chromium refuses to play audio until somebody has interacted with the page.

On a counter till that is invisible - it is clicked all day. On the machine at the pass it is the whole problem: it sits untouched for hours, which is exactly when a ticket needs announcing, and the chime would have been refused with nothing in any log to say why.

app.commandLine.appendSwitch('autoplay-policy', 'no-user-gesture-required');

Set before the app is ready, because afterwards it is ignored.

A correction

I also claimed the script only loaded on one page of ten and "fixed" that. It was not a defect: dashboard is not a screen, it is the shell the 57 modules run inside, so it was already loading everywhere that matters. The change was reverted rather than left in as churn.

Tests

21 pass, including two new ones on the line-at-a-time behaviour.

They still do not cover the speaker or the voice. That needs the kitchen machine, the Bluetooth speaker and one real ticket - and until that happens nobody should assume this works.

Three things the owner asked about, and one he did not, which was the one
that would have kept the speaker silent.

A PAUSE BETWEEN DISHES. Owner: "little pause between line items." The
announcement was one sentence with full stops in it. A full stop is a
shorter gap than a kitchen needs, so it is now one utterance per line and
the engine leaves a real gap between them - long enough to hold one dish
in your head before the next arrives.

INDIAN ENGLISH. Owner: "its indian english. not so fluent." An American
voice reads biryani, paneer and kuzhambu like somebody who has never
ordered one. Windows ships en-IN voices, Heera and Ravi, so one is
preferred where the machine has it, then en-GB, then any English. Chosen
once and remembered: getVoices() fills in asynchronously, and asking per
ticket is how the first announcement of a service comes out in the wrong
accent. It also listens for onvoiceschanged, because asking at load
usually returns an empty list.

AND THE ONE THAT MATTERED MOST. Chromium refuses to play audio until
somebody has interacted with the page. On a counter till that is
invisible - it is clicked all day. On the machine at the pass it is the
whole problem: it sits untouched for hours, which is exactly when a
ticket needs announcing, and the chime would have been refused with
nothing in any log to say why. The switch is set before the app is ready,
because afterwards it is ignored.

I also claimed the script only loaded on one page of ten and "fixed" it.
That was wrong: `dashboard` is not a screen, it is the shell the fifty
seven modules run inside. The change was reverted rather than left in as
churn.

Twenty one tests. They still do not cover the speaker or the voice: that
needs the kitchen machine, a Bluetooth speaker and one real ticket.
Owner: "KOT total items also print and voice read please. so that chef's
can hear well."

    ------------------------------------------------
    TOTAL ITEMS                                    4

and, before the list rather than after it:

    Table 5, new order.
    Three items.
    One Chicken Biryani.
    Two Butter Naan.

BEFORE, because a number heard first is one you can count against. A chef
told three plates are coming notices when they have heard two. After the
list it is a fact nobody can act on.

PLATES, NOT LINES. One biryani and two naan is three things to cook and
two lines on the ticket. A kitchen works in plates, and the printed total
and the spoken one count it the same way on purpose - a cook checking the
paper against what they heard must not find two different numbers.

The count is the whole ticket even when the announcement is cut to six
lines and summarised. That is precisely when it earns its place.

Four older tests changed expectations rather than failed: they asserted
the exact sentence, and the sentence now carries the count. The other 64
tests around the ticket renderer pass unchanged.
@sridharkalaibala
sridharkalaibala merged commit ce426d4 into develop Sep 16, 2026
9 checks passed
@github-actions github-actions Bot added the ready for QA Merged to develop and live on develop.posnic.io - anyone can test it label Sep 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Merged to develop. Anyone can test this - you do not need write access.

Try it at https://develop.posnic.io, or run it yourself:

git fetch origin develop && git checkout develop
npm install && npm --prefix api install
npm run dev   # then http://localhost:3000

When you have tested it, say what you did and what happened, and set
QA passed or QA failed. If you cannot set labels, just comment -
a maintainer will.

Reporting that something is broken is as useful as fixing it. It is
better found here than by a shopkeeper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for QA Merged to develop and live on develop.posnic.io - anyone can test it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant