Repository navigation
Supplier web: Express jobs and printing files from the PC - #330
Merged
Merged
Conversation
A shop on a PC can now take an Express document job from start to finish in the browser: accept (A), open and print the file, mark it ready (R), and hand it over with the client's typed code. The supplier rail now follows the phone app's four sections: To do, Messages, Money and My shop. My shop carries the shop-wide Express switch. - Today: the Express "do this first" card, then After that, Due today, You earned today (Owner) and Alerts with sound - File viewer: PDFs and pictures print in the page; Word files are download only; opens and downloads are recorded with the device id - Hand over: six digits in a side panel, sent on the sixth - Done panel: the delete-files reminder only after a download - Staff: Today and All jobs only, with no money anywhere - Every existing supplier page keeps its route; the old dashboard is now "How the shop is doing" at /supplier/performance Refs #327 (report 35304A2A)
…ield on time Review fixes for PR #330: - An Express job's page emptied the regular actions, so on an API that still gates Express like a regular job (before gridgo-api#419) the shop could never send its finished photos and was stuck. The page now keeps the regular steps (minus accept and decline, which the Express card owns) once the job is on the press or the API's readiness check still names a shop step (expressNeedsRegularSteps). While they are there, the regular step leads and the card drops its yellow and its shortcuts. A regression test walks the whole older path from the card's It's ready to Ready for rider pickup. - After too many wrong codes, the code field stayed locked past GRIDGO's retry time until something else re-rendered. It now unlocks at the deadline on its own (timer cleaned up), with a fake-clock test. Refs #327
This was referenced Nov 21, 2026
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.
Refs #327 (issue report 35304A2A)
A shop on a PC can now take an Express document job from start to finish in the browser: accept, open and print the file, mark it ready, and hand it over with the client's code. The supplier rail now matches the phone app's four sections. Built against the contract in gridgoph/gridgo-api#419; where an API doesn't have a #419 field yet, the screen falls back cleanly.
What changed
Sidebar (supplier only; Operations and Super Admin are unchanged)
railHiddeninnav.ts). The old dashboard moved to/supplier/performance("How the shop is doing")./supplier/dashboard(Today), for the Owner and for Staff.Today
File viewer (
/supplier/jobs/:id/files)openedand downloading recordsdownloaded(POST /orders/:id/files/:fileId/access), sending this browser's device id. The signed-link request carriesX-GRIDGO-Device-Id.Hand over
Done panel
downloadedrow from the API, or this browser's own record of a download. If nothing was downloaded, the panel shows "Back to To do".My shop (Owner only)
GET/PATCH /me/express-settings, with theexpectedVersionhandshake;409 shop_profile_stalereloads and says so). An API without the switch shows "Express is set on each product for now".Staff
Small fixes on touched pages
3FF0-128E-105A) instead of the raw id.It's readyon an older API: when the one-steppayment_authorized → ready_for_dispatchis refused (transition_not_allowed), the card sendsproductionthenready_for_dispatch. If GRIDGO wants a photo or its own check first, the card says so and links to the job.payment_requirednow says GRIDGO hasn't confirmed the payment, instead of a connection error.application/pdfor the image type before drawing it on this origin. SVG, HTML and anything else is download-only.API gaps and decisions (no stop needed)
POST …/files/:fileId/accessneeds ajobId, but orders don't expose job ids to the shop. The portal reuses thejobIdfrom existingfileAccessesrows, and otherwise sends"", which the API treats as all of this shop's jobs on the order.Screenshots
docs/screenshots/supplier-express/. Names and shop names are anonymised. The#RIG_…references come from seeded test ids; real ids read like3FF0-128E-105A.before-owner-dashboard-1440,before-owner-dashboard-390,before-owner-express-job-1440,before-staff-jobs-1440owner-today-offer-desktop-{light,dark},owner-today-offer-390-{light,dark}flow-1-accepted-by-A→flow-2-viewer-after-download→flow-3-ready-counter→flow-4-code-five-digits→flow-5-done-delete-reminderowner-viewer-pdf-desktop-{light,dark},owner-viewer-pdf-390-light,owner-viewer-word-desktop-lightowner-my-shop-desktop-{light,dark},owner-my-shop-390-darkstaff-today-1440-{light,dark},staff-today-390-light,staff-my-shop-owner-onlyHow it was tested
next buildplus the standalone server on a spare port). The API was gridgo-api#419's branch, run on its own scratch Postgres and MinIO, with Express jobs seeded for a dev shop. Nothing touched the shared dev API or database.downloaded, R marked it ready, typing012345handed it over, and the Done panel asked to delete the downloaded file.dev.npm run typecheck: clean.npm run lint: 0 errors; 2 warnings, both in files this PR doesn't touch.npm test: 401 files, 3,602 tests passed (exit 0, no unhandled errors).npm run build: passes, including the account-address and Clerk-secret scans.src/lib/__tests__/express-shop.test.ts: stage, payment words, counter code, the delete reminder only after a download, the viewer's type rules and the shortcut guard.src/app/supplier/_components/express/__tests__/express-card.test.tsx: Accept on A but not while typing, the note tick, R ready in one step and the two-step fallback, Staff sees no money, the typed handover on the sixth digit, a wrong code clearing, and the Done panel with and without a download.src/app/supplier/jobs/[id]/files/__tests__/page.test.tsx: the PDF shows with Print first, Print and Ctrl+P print the frame, Download recordsdownloaded, Word is download-only, and R marks ready.src/app/supplier/__tests__/today.test.ts: the Today queue and panels.Review fixes (second commit)
expressNeedsRegularStepsinsrc/lib/express-shop.tsmakes that call.src/app/supplier/jobs/[id]/__tests__/express-older-api.test.tsxwalks the whole older path. The card's It's ready is refused, finished photos are sent, GRIDGO approves, and Ready for rider pickup goes through. With the fix switched off, the test fails.retryAftertime on its own (the timer is cleaned up). A fake-clock test covers it, and it also fails without the fix.npm run typecheck: clean.npm run lint: 0 errors, the same 2 warnings.npm run build: passes.npm test: 402 files, 3,606 tests. The full run had 4 failures in two files this PR doesn't touch (admin/broadcast,orders/inbox-workspace), all 5-second timeouts under load. Both files pass on their own: 8 of 8.