Skip to content

Finish the journey, and fix what testing turned up - #44

Merged
sridharkalaibala merged 6 commits into
mainfrom
feat/a-floor-a-waiter-can-read
Sep 12, 2026
Merged

sridharkalaibala merged 6 commits into
mainfrom
feat/a-floor-a-waiter-can-read

Conversation

@sridharkalaibala

Copy link
Copy Markdown
Contributor

Six commits. The first finishes the screen rebuild; the rest are bugs found while you were testing against a real till.

The last three screens

Three screens were rebuilt and three were not, so a waiter crossed one design, hit a second, and came out into the first again.

Tables drew identical boxes in alphabetical order — table 1 first whether it had waited a minute or an hour, which is the same as no order at all. Oldest first now, with the wait on every card and a stripe that colours at 20 and 45 minutes. Deliberately generous: a floor that is all red by eight o'clock is a screen nobody looks at. Four equal header buttons became three quiet icons and one New order.

Table + Pax — pax was a row of icons for 1–6 and a text box above that, so a table of eight meant raising a numeric keyboard while standing at the table. A stepper does it in two taps. Both old controls stay in the page and are still driven by setPersonCount, so one function remains the source of truth.

Order placed — "Order Placed! We're preparing your delicious food 🍽️" is written at a customer; the person holding this phone is the waiter who just sent it. Back to tables is the primary action now.

Bugs found in testing

A wrong password said the server was too old A tokenless 401 means an old server everywhere except the sign-in route, which answers 401 for a bad credential. So a typo told somebody to upgrade their till. Found against develop.posnic.io.
The Wi-Fi search was queueing, not hanging It fired 2..254 at every subnet at once — a thousand requests, and the 500ms probe timeout starts when fetch is called, not when the socket opens. The likely addresses go first now (~30 probes, ~1s), including this device's own neighbourhood, because a router hands out its pool in order. Plus a 20s hard deadline.
The table screen's old stylesheet was still winning .discount-page is a flex row, so the header ran down the left. The slider and its label both had z-index: 1, so "Dine-in" vanished behind a purple pill. The notice and input were written into a 78px grid, so the notice came out a word per line and "Enter Table Number" was cut to "Enter Tabl".
"Add something" was a second, worse search name.includes(query) with a 2-char minimum — the exact substring test the menu was rebuilt to escape. cb found nothing. Now the same ranked search.
The Modify row filled the panel A flex default with no min-width: 0: the name column couldn't shrink below its longest word, so it wrapped to eight lines and pushed the controls off the row.

Also: "Edit" → "Modify" and the rest of the system language with it, the address box now says it takes a code, a URL or an IP, and there is finally a way to change the shop server after signing in — it was reachable only from the sign-in screen, so a phone pointed at the wrong till couldn't be moved without signing out.

Tests

224 node, 115 browser, all green. Two new guards exist because dead selectors bit twice in one session: every selector the browser harness walks for must exist, and every screen in the journey must load design.css. A renamed class doesn't fail a Playwright test loudly — it hangs for the full timeout.

Three screens were rebuilt and three were not, so a waiter crossed one
design, hit a second, and came out into the first again. That is the single
loudest way an app says it was made by different people at different times.

THE FLOOR

The tables screen drew identical boxes in alphabetical order, so table 1 came
first whether it had been waiting a minute or an hour - the same as no order
at all. It is oldest first now, with the wait on every card and a stripe that
colours at twenty minutes and forty-five. Deliberately generous: a floor that
is all red by eight o'clock is a screen nobody looks at.

Four header buttons of equal weight became three quiet icons and one New
order. Only one of them was ever what somebody came to do.

A table name is typed by hand and was going into an href, a data attribute
AND an onclick argument, raw, three times per card. Escaped and delegated.

WHERE THEY SIT, AND HOW MANY

Pax was a row of person icons for 1 to 6 and a text box for anything above,
so a table of eight meant tapping a box, raising a numeric keyboard and
typing, while standing at the table. A stepper does it in two taps and never
raises a keyboard. The quick-pick row stays, because most tables are two or
four and one tap beats two.

Both old controls are still in the page and still driven by setPersonCount -
the box is hidden by CSS rather than removed, because handlePersonInput and
the restore-after-poll path both read it. One function stays the source of
truth for how many people are at the table, so nothing can disagree.

Back and Next were the same orange button, so the way forward and the way
back were indistinguishable at a glance on a screen used without looking
properly, forty times a night.

THE MOMENT AFTER

"Order Placed! We're preparing your delicious food 🍽️" is written at a
CUSTOMER, and the person holding this phone is the waiter who just sent it.
It says what happened, to the person it happened for, and gets out of the
way.

Back to tables is the primary action now. It was New Order, which starts
another order for the same table - and somebody who has just sent table
four's food is almost always walking back to the floor.

The tick is the only animation, because it is the one beat in this app worth
marking: food has been committed to a kitchen.
A renamed class does not fail a Playwright test loudly - it HANGS, for the
full timeout, on a click for an element that will never exist. The floor
screen replaced .kot-btn-add with .floor-new and the harness kept clicking
the old one, which is most of what the thirty-minute run was.

So two node guards now catch it in milliseconds: every selector the harness
walks for has to exist in the pages, and every screen in the journey has to
load design.css.

The first version of that guard built a regex from the selector name and lost
a backslash on the way into the file, so it reported every selector missing.
A test that cries wolf is worse than no test, and this one is checking for
exactly the class of mistake it made itself - so it matches plain strings
now.

And the confirmation screen says "Sent to the kitchen" rather than "Order
Placed! We're preparing your delicious food", so the test says that too.
THE SEARCH WAS QUEUEING, NOT HANGING

The sweep fired 2..254 at every subnet at once. A Windows machine offers
four of them, so that is a thousand requests in flight - and the 500ms probe
timeout starts when fetch is CALLED, not when the socket opens. The later
batches therefore timed out having never left the queue, the whole search
took tens of seconds, and it was reported as a hang.

Owner: "make sure its not hanging while search. most of time within 10 or 15
ip it will get."

That is the fix, and it is his observation that makes it work. A till is
nearly always low on its subnet or on a round static number, so the likely
addresses go first as one small bounded pass across every network: about
thirty probes instead of a thousand, answering in about a second. Only when
that finds nothing does the full sweep run, and it runs NARROWER - the
concurrency is divided across the subnets rather than applied to each, so
four networks no longer put 256 requests in flight.

And a hard deadline over the whole thing, because without one the sweep was
bounded only by how long the slowest of a thousand queued requests took to
give up, which on a busy network is not bounded in any way a person would
call bounded.

A WRONG PASSWORD SAID THE SERVER WAS TOO OLD

A tokenless 401 really does mean an old server everywhere else - one from
before the bearer-token work, refusing the route to everybody. But
kioskMobileLogin answers 401 for a bad credential, which is correct and
ordinary, and this turned it into "This shop's server is too old for this
screen. Update POSNIC on the till."

A confident wrong diagnosis, sending somebody to upgrade a server because
they mistyped a password. The route was already excluded from the
session-clearing branch directly above for the same reason; it was missed
here. Found against develop.posnic.io, which answers 401 for a bad login as
it should.
Four things wrong on one screen, all of them style.css still in charge.

THE HEADER RAN DOWN THE LEFT OF THE PAGE

.discount-page is `display:flex; align-items:stretch; justify-content:center`,
so the header added above the container became a flex ITEM BESIDE it. "New
order" sat vertically centred to the left of everything else.

DINE-IN HAD NO LABEL

The sliding indicator and the label both carried z-index 1 - the indicator
from style.css, the label from seat.css - and the indicator comes later in
the DOM, so it painted on top and the word vanished behind a solid pill. The
other half still read "Take away" because nothing covered it, which is what
made it look like a missing label rather than a stacking order.

THE NOTICE AND THE INPUT WERE LAID OUT AS TABLES

Both are written into .table-list, which is a grid of 78px columns. So the
paragraph explaining that Restaurant is switched off was squeezed into one
cell and came out roughly a word per line, and "Enter Table Number" was cut
to "Enter Tabl". They are full-width rows in that grid, not tiles in it.

AND TWO THINGS WERE STILL ORANGE

The history button and the focus ring, painted from --primary. One stray
colour on an otherwise consistent screen reads as an oversight rather than a
choice.
Owner: "instead of edit use modify. better avoid system language. use normal
people language."

Edit Order -> Modify order. Current Order Items -> On this order. Add New
Items -> Add something. "Search products..." -> "Search the menu". The Edit
button on a KOT is Modify.

ONE ITEM FILLED THE PANEL

Neither side of the row was told what to do with the space, so the flex
default left the name in a column narrow enough to break "Chicken Tikka 1
plate" over three lines and the catalogue description over eight, while the
quantity buttons were squeezed until the row scrolled sideways.

min-width: 0 is the half that is easy to miss: a flex item will not shrink
below its longest word without it, which is what pushed the controls out.

And the description is clamped to two lines. It is the dish's catalogue text -
"Chicken Tikka sold as 1 plate, configured for a INR Restaurant Demo Dataset
POS demo" - written for a menu, not for somebody changing a quantity.

"ADD SOMETHING" WAS A SECOND, WORSE SEARCH

Owner asked whether it was the same search as the main screen. It was not.

It was `name.toLowerCase().includes(q)` with a two-character minimum - the
exact substring test the menu was rebuilt to get away from. It finds Chicken
Biryani from "biry" and from nothing else: not from "cb", which is what
somebody selling two hundred a day types, and not from "chick biry", because
two words are never one substring.

So a waiter who had learned to type "cb" on the menu got nothing here, on the
screen where they are already in a hurry because a table is waiting on a
correction. It uses ItemSearch now, with the spoken-number pass on, so the
two screens answer the same way.
The connect tests pinned "Type the shop code", which is the wording that was
wrong. The box takes three different things and the app completes each: a
bare code becomes https://<code>.posnic.io/api, a web address gains /api, and
a private address gains the till's port.

Owner: "its asking shop code but we enter shop url."
@sridharkalaibala
sridharkalaibala merged commit 9993148 into main Sep 12, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant