The bells, the pickers, and the note that was never the menu - #852
Merged
Merged
Conversation
Owner: "beep sound is not good. i want like new order came. make it good. not beep." He was right, and the reason was in the generator: a plain sine contains nothing but its fundamental, which is what a beep is. Two things make a struck object sound struck and that tone had neither. The new one carries partials above the note and an envelope that decays from the instant it is hit. Owner: "First bell is we got new order. I want one bell for each line item before read it." The opening and the plate count are about the ticket; everything after is a dish and gets a smaller tap in front of it. Where that boundary falls is decided beside the words and travels with them, so the page never guesses by counting sentences - a guess that breaks the first time the wording moves. Owner: "how about user picks the bell sound as choice how you gave me. also give choice voice also." Three arrival bells, three taps, and the voices the machine has, each with its own Play button, because nobody can choose a sound from its name. A kitchen with a fryer roaring needs a different bell from a quiet dining room and that is not a decision to make once, in one file, for every shop. Owner: "different countries might need different voice and accent." The voice is stored by name and an empty name means the best one here, so a machine that lacks the chosen voice falls back rather than going silent. A downloaded voice pack later adds another name to the same list. Everything merges onto what is stored: turning the reading off must not lose the bell somebody spent five minutes choosing.
Owner, looking at a live ticket on the handset: "i see active kot i see some descirption details inside the line items. actually we need to show only item name if any customization note delibertly captain entered. otherwise dont show any other details. dont confuse captain." Two server paths treated a line with no note as a line that ought to borrow one. Adding a dish to an open order stamped the catalogue's description onto the sale line, and the ticket view model fell back to a `description` key that a sale line has never had in its schema, so it could only ever pick up menu copy from something catalogue-shaped passing through. Worth being blunt about why that is a fault and not clutter. A note on a kitchen ticket is an INSTRUCTION, and a cook reading one assumes somebody at the table asked for it. Menu copy in that position is an instruction nobody gave, in the one place where the sane response is to obey it, and it buries the line somebody did ask for. A blank note means nothing was asked for. Blank is the honest answer. The description still belongs to the item and is one lookup away for anything that genuinely wants it. Open orders created before this keep whatever was already stored; new lines are clean.
Contributor
|
Merged to 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:3000When you have tested it, say what you did and what happened, and set Reporting that something is broken is as useful as fixing it. It is |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These two commits were on #848 when it was opened but not in what it merged: GitHub's PR head was still reporting
aaaa5e18when the merge button was pressed, sof5a6d022and8ce3c47bwere left behind. Nothing here is new work, it is the tail of that PR.Verified against
origin/developrather than against the PR:ARRIVAL_BELLSis absent there, anditem.item_description || item.descriptionis still present.1. The bells
The old tone was two pure sine waves. A pure sine contains nothing but its fundamental, which is what a beep is, and at 1568 and 2093 Hz it was closer to a smoke alarm than a chime. Owner: "beep sound is not good. i want like new order came. make it good. not beep."
The new ones are struck notes: partials above the fundamental, each with its own decay, and an envelope that starts instantly and fades. The 3ms attack is not decoration, a waveform starting at full height clicks and a click sounds like a fault on a till speaker.
One bell for the order, one tap before each dish. Owner: "First bell is we got new order. I want one bell for each line item before read it." The opening and the plate count are about the ticket; everything after is a dish. Where that boundary falls is decided beside the words and travels with them as
head, so the page never guesses by counting sentences.2. The shop picks
Owner: "how about user picks the bell sound as choice how you gave me. also give choice voice also."
Three arrival bells, three taps, and the voices the machine has, each with its own Play button on Core Settings, because nobody can choose a sound from its name. A kitchen with a fryer roaring needs a different bell from a quiet dining room, and that is not a decision to make once in one file for every shop.
Owner: "different countries might need different voice and accent." The voice is stored by name, and an empty name means the best voice on this machine, so a till that lacks the chosen voice falls back rather than going silent. A downloaded voice pack later adds another name to the same list.
Everything merges onto what is stored, so turning the reading off never loses the bell somebody spent five minutes choosing.
3. The note is never the menu
Owner, looking at a live ticket: "i see active kot i see some descirption details inside the line items. actually we need to show only item name if any customization note delibertly captain entered. otherwise dont show any other details. dont confuse captain."
Two server paths treated a line with no note as one that should borrow the menu copy:
sale.repository.jsadd-item path:item.item_description || itemDoc.descriptionwhereitemDocis the catalogue documentsales.helper.jsformatSaleListEntry():item.item_description || item.descriptionA sale line has no
descriptionfield and never has, so that second fallback could only ever pick up catalogue copy. A note on a kitchen ticket is an instruction and a cook assumes somebody asked for it, so menu copy in that position is an instruction nobody gave, in the one place where the sane response is to obey it.Open orders keep what was already stored. New lines are clean.
Tests
tests/one-bell-for-each-dish.test.js(13): where the food starts, both bells sent, the chosen bell is the one used, an unknown name falls back rather than going silent, every offered bell actually plays, a tap is smaller than a bell, a struck note decays where a beep does not, and choosing a bell does not turn a switch offapi/tests/unit/helpers/the-ticket-carries-the-note-not-the-menu.test.js(5): verified failing on the parent commitLocally: 1614 repository tests and 38 helper tests pass, desktop suite has zero assertion failures.