WFDASH-WEBAPP/src/lib
Dave 8c59f594f8 fix(pos): make cart quantity editable, and fix the sheet that hid it
Ringing up 800 of something means typing 800, and the only route to the
quantity field was a 600ms long-press with no affordance anywhere on
screen. The quantity itself — the thing a cashier reaches for — was a
plain <div class="v">, so it rendered inert.

  - the quantity is now a real button that opens the Edit line sheet,
    with an aria-label and a 44px touch target (it was 30px, too narrow
    to even show "800")
  - holding +/- no longer pops the sheet open mid-tap: the pointerdown
    handler bails for .qty/.rm before starting the timer
  - the sheet is quantity-only. The Unit price field is gone on request;
    a mis-keyed price is expensive and easy to miss. The per-line
    override it fed is removed with it — pos-service.ts only ever read
    unit_price, the "price edited" label and the sale record's `edited`
    flag were unreachable, and nothing else could set an override,
    including a cart reload (persistCart saves only {id, qty, p})

The discount trigger moved out of its own 54px footer row to ride
inside the Subtotal row, so it costs no vertical height at all while
staying visible — a discount control that appears from nowhere is one
nobody finds under pressure. The applied-discount red totals row
remains the always-on indicator.

Fixes a pre-existing bug found while testing: long-pressing a cart row
showed a grey screen with no dialog. #editSheet is a SIBLING of
#editBackdrop, but the CSS revealed it with
`.edit-backdrop.show .edit-sheet` — a descendant selector that can
never match a sibling — so the sheet sat at opacity:0 while the
backdrop went opaque. Nothing threw and the build was green, which is
why it survived; it is also why manual quantity entry looked missing.
The sheet now has its own z-index above the backdrop and its own .show
rule. They stay siblings on purpose: nesting the sheet inside the
backdrop would make every tap on Save bubble to the backdrop's
onclick and close the dialog.

Verified in jsdom against the real markup: old CSS reproduces the grey
screen (backdrop opacity 1, sheet opacity 0, not clickable), the fix
clears it (sheet opacity 1, z-index 71 > 70, position fixed). 125 POS
tests pass, including 23 new ones asserting the tap target exists, the
long-press guard fires before the timer, the sheet stacks above its
backdrop, and the popup stays quantity-only.

sw.js v30 -> v33: pos-app.js and pos.html are both served cache-first out
of the shell, so without the bump tills keep the old ones.
2026-10-07 12:54:47 +02:00
..
pdf fix(delivery-note): signed copy invisible, and a bigger QR in the corner 2026-10-04 17:00:30 +02:00
reports feat(audit): implement audit trail for delivery notes and orders 2026-09-30 01:48:44 +02:00
scan fix(scan): speed up QR recognition and keep scanning 2026-10-05 09:43:53 +02:00
server fix(delivery-notes): return to the list after quoting; kill the phantom supplier 2026-10-05 19:49:20 +02:00
audit-fetch.test.ts feat(audit): implement audit trail for delivery notes and orders 2026-09-30 01:48:44 +02:00
audit-fetch.ts feat(audit): implement audit trail for delivery notes and orders 2026-09-30 01:48:44 +02:00
audit-format.test.ts feat(audit): implement audit trail for delivery notes and orders 2026-09-30 01:48:44 +02:00
audit-format.ts feat(audit): implement audit trail for delivery notes and orders 2026-09-30 01:48:44 +02:00
delivery-note-stage.test.ts fix(delivery-notes): merge cancelled into completed, and fix the search 2026-10-04 23:29:48 +02:00
delivery-note-stage.ts fix(delivery-notes): merge cancelled into completed, and fix the search 2026-10-04 23:29:48 +02:00
dev-identity.test.ts
dev-identity.ts
file-fields.test.ts fix(delivery-note): signed copy invisible, and a bigger QR in the corner 2026-10-04 17:00:30 +02:00
file-fields.ts fix(delivery-note): signed copy invisible, and a bigger QR in the corner 2026-10-04 17:00:30 +02:00
geo.test.ts feat(visits): batch pin tool — tag every customer on a shaft at once 2026-09-07 08:30:23 +02:00
geo.ts feat(visits): batch pin tool — tag every customer on a shaft at once 2026-09-07 08:30:23 +02:00
giellie-image.ts feat(giellie): chat UI, approval card, photo/file composer, sidebar rename 2026-10-01 00:06:50 +02:00
giellie-sse.test.ts fix(giellie): stale-tab approval guard, size guard, SSE heartbeat, shared in-flight set 2026-10-01 00:36:55 +02:00
giellie-sse.ts feat(giellie): shared types and SSE codec 2026-09-30 23:34:53 +02:00
giellie-types.ts fix(giellie): args-aware tool policy, deny quotes.re_run_ai, harden bridge and agent 2026-10-01 00:36:54 +02:00
item-status-ui.test.ts feat(quotes): enhance scoring logic to include price matching 2026-08-24 07:09:39 +02:00
item-status-ui.ts Revert "feat(orders): add Duplicates tab surfacing flagged duplicate orders" 2026-08-31 16:34:37 +02:00
letterhead.test.ts feat(delivery-notes): standardize delivery-note letterhead across PDFs 2026-08-18 11:53:25 +02:00
letterhead.ts fix(pdf): render through renderToBuffer, not pdf().toString() 2026-10-04 13:14:59 +02:00
order-age.test.ts feat(orders): add order-age util with bucket thresholds 2026-09-01 01:58:46 +02:00
order-age.ts feat(orders): add order-age util with bucket thresholds 2026-09-01 01:58:46 +02:00
order-color.test.ts
order-color.ts
order-invoices.test.ts feat(audit): implement audit trail for delivery notes and orders 2026-09-30 01:48:44 +02:00
order-invoices.ts feat(audit): implement audit trail for delivery notes and orders 2026-09-30 01:48:44 +02:00
order-item-qty.test.ts fix(orders): bill the customer quantity, not the supplier order_qty 2026-08-30 18:28:33 +02:00
order-item-qty.ts fix(orders): bill the customer quantity, not the supplier order_qty 2026-08-30 18:28:33 +02:00
order-rep.test.ts
order-rep.ts
pb-helpers-duplicate.test.ts
pb-helpers.ts feat(delivery-notes): one linear flow control, and fix the quote lookup 2026-10-05 18:21:19 +02:00
pin-model.test.ts
placeholder-customers.ts
pocketbase.ts
pos-cart-quantity.test.ts fix(pos): make cart quantity editable, and fix the sheet that hid it 2026-10-07 12:54:47 +02:00
pos-inline-handlers.test.ts fix(pos): revive the dead "Print cash-up" button, add 20c/10c denominations 2026-09-19 07:30:11 +02:00
pos-search.test.ts feat(pos): tiered catalog search — word order, plurals, glued SKUs 2026-10-06 23:36:12 +02:00
price-list-search.ts
quote-pricing.test.ts fix(delivery-notes): what the browser found — clipped actions, zero-margin lines 2026-10-05 16:01:55 +02:00
quote-pricing.ts fix(delivery-notes): what the browser found — clipped actions, zero-margin lines 2026-10-05 16:01:55 +02:00
quote-status.test.ts
quote-status.ts feat(quotes): allow resubmit from any post-submit status, not just rejected 2026-09-07 16:51:55 +02:00
rep-visibility.test.ts feat: add isRepUser helper for rep-scoped list filtering 2026-08-31 23:24:25 +02:00
rep-visibility.ts feat: add isRepUser helper for rep-scoped list filtering 2026-08-31 23:24:25 +02:00
repair-document-stage.test.ts feat(stock): update pricing logic and transform script for fasteners 2026-09-21 12:32:44 +02:00
repair-document-stage.ts feat(stock): update pricing logic and transform script for fasteners 2026-09-21 12:32:44 +02:00
safe-next-path.ts fix: preserve destination through the login redirect 2026-09-01 15:47:27 +02:00
sops.ts feat: implement discount functionality in POS system 2026-09-03 12:19:21 +02:00
stock-fulfillment.test.ts
stock-fulfillment.ts
stock-low-stock.ts
stock-match.ts
stock-status.test.ts
stock-status.ts
supplier-color.test.ts
supplier-color.ts
theme-types.ts
themes.ts
tracker-parsing.test.ts feat(rep-visits): FleetAI tracker adapter, nearby-customer matching, stop detection 2026-09-06 14:22:28 +02:00
tracker-parsing.ts feat(rep-visits): FleetAI tracker adapter, nearby-customer matching, stop detection 2026-09-06 14:22:28 +02:00
types.ts fix(delivery-note): signed copy invisible, and a bigger QR in the corner 2026-10-04 17:00:30 +02:00
use-boolean-preference.ts feat(invoicing): implement detailed view toggle for supplier and PO number 2026-08-16 11:01:52 +02:00
use-split-ratio.test.ts
use-split-ratio.ts
use-theme-id.ts
user-color.ts
utils.test.ts feat(orders): enhance order handling with email_message_id deduplication and displayContactName utility 2026-08-21 19:18:02 +02:00
utils.ts feat(orders): enhance order handling with email_message_id deduplication and displayContactName utility 2026-08-21 19:18:02 +02:00
visit-matching.test.ts feat(rep-visits): FleetAI tracker adapter, nearby-customer matching, stop detection 2026-09-06 14:22:28 +02:00
visit-matching.ts feat(rep-visits): FleetAI tracker adapter, nearby-customer matching, stop detection 2026-09-06 14:22:28 +02:00
visit-stops.test.ts feat(rep-visits): FleetAI tracker adapter, nearby-customer matching, stop detection 2026-09-06 14:22:28 +02:00
visit-stops.ts feat(rep-visits): FleetAI tracker adapter, nearby-customer matching, stop detection 2026-09-06 14:22:28 +02:00
working-days.ts