Dispatch Ochre
v1.0A field-service dispatch desk for a plumbing crew: a day board you drag jobs onto, jobs, technicians, customers and invoices, in sand and ochre.
Sayfa adresi: /
Yerleşik
Neler alırsınız- Açık ve koyuTema renklerinizi kullanır
- Masaüstü, tablet ve telefonTasarlandığı ekranlar
- Paketler…
- Kod boyutu…
- Pil dostu30 fps, dururken boşta
- Gizliyken dururEkran dışında veya başka sekmede
- Hareketi azaltİsteyenler için sakin
Her değişiklikte kontrol edilir
Güvenlik kontrolü: 3 Ara- Tür denetimiKatı TypeScript
- Lint ve biçimESLint · Prettier
- Testler ve derlemeAçık ve koyu ekran görüntüleri
- Güvenlik denetimiYüksek veya kritik uyarı yok
- Paket yaşıHer sürüm 7+ gündür herkese açık
- Boşta CPUDururken yarım çekirdekten az, ≤ 30 fps
Kod
dispatch-ochreReact
- dispatch-ochre.tsxThe page: the sections in order.
- content.tsEvery word and number: brand, nav links, each section's copy and lists.
- theme.tsThe colors as CSS variables, and the shared class strings.
- README.mdHow to install it, and where to change the text, colors and form.
- pagesOne file per page: the sections it shows, in order.
- customers.tsxCustomers: everyone the company has worked for, searchable, with their zone, jobs, last visit and what they have paid; a sheet with their details and job history (?customer=C-1204&dtab=jobs) and a New job for them; the form for adding or editing one (?new=customer, ?edit=C-1204). Deleting asks first and takes their jobs with them.
- dispatch.tsxDispatch, the overview: the day's four numbers, the board (the jobs no one has yet, and every technician's lane), then the jobs by status and the live feed side by side. The day follows the top bar's stepper.
- invoices.tsxInvoices: done jobs waiting for a bill (pick some, Create invoices), then every invoice by status with its total; picked invoices can be sent or marked paid together. The sheet (?invoice=INV-2314) edits the lines and sends, marks paid or deletes it.
- jobs.tsxJobs: the day's jobs in one list, tabs by status with their counts, search and the type and zone filters (kept in the address), and a bar for the picked rows: move them on a step or delete them. A row opens the job's sheet; on a phone each row folds onto two lines.
- settings.tsxSettings: the job types (length, price, the skill a technician needs), the zones, the workday the board shows, and Appearance (theme and language). Types and zones are added and edited in a dialog (?new=type, ?edit=t-leak); one still in use can't be deleted, and says why.
- sign-in.tsxThe sign-in page (#/sign-in): the logo and the form on one card over the backdrop, without the sidebar and top bar: one quiet card on the sand ground, as plain as the rest of the desk.
- technicians.tsxTechnicians: the crew in one list (where each one is right now, their skills, today's load), tabs for who is working, on a job or off, a sheet with their day and details (?tech=tech-3), and the form for adding or editing one (?new=tech, ?edit=tech-3). Removing one asks first; their open jobs go back to the board.
- sectionsOne file per page section.
- account-menu.tsxThe account menu under the avatar in the top bar: who is signed in, Settings and Sign out; the arrow keys move through it, Escape, Tab or a click outside closes it.
- appearance.tsxSettings → Appearance: the theme (System, Dark or Light), each choice shown as a small preview, and the language (System or one of locales/list.ts).
- bottom-tabs.tsxThe phone's tab bar: the four pages used most, and More for the rest (the sidebar in a sheet). It sticks to the bottom of the screen under the page, framed by its own top line.
- day-board.tsxThe day board, the signature: the jobs no one has yet as cards on top, and one lane per technician under them with their jobs as blocks on the day's hours. Drag a card onto a lane and it snaps to a 15-minute slot inside its arrival window; a lane missing the skill (or off that day) dims and refuses it. The now line runs down every lane today.
- day-panels.tsxThe two panels under the board: the day's jobs by status as columns (on site, the live one, in the accent) with the zones under them, and the live feed of what the crew and the desk just did, newest on top.
- job-form.tsxThe job form in a dialog: New job (?new=job, ?for=<customer> picks them) and Edit (?edit=J-4131). The customer brings the address and zone, the type its length and price; the arrival window is two hours; a technician is optional (the board can take it later). Its own errors, no browser ones.
- job-sheet.tsxThe job sheet (?job=J-4131): its status steps with the next one as a button, who goes and when (only technicians with the skill who work that day, at 15-minute starts in the arrival window), the job's facts, its timeline and its invoice. Edit opens the job form; Delete asks first.
- kpi-strip.tsxThe KPI strip: four numbers in one bordered box split by hairlines, each with its note under it and a sparkline or a progress bar; a changed number rolls to its new value and a sparkline grows a point. Each cell links to the list behind it.
- sidebar.tsxThe sidebar: the company, search with the ⌘K shortcut, the pages in two groups with their live counts and a pill that glides to the current one, Settings, and the live strap with its pause.
- sign-in-form.tsxThe sign-in form: email and password with their errors under them, show or hide the password, keep me signed in, and the demo account to fill in; a wrong pair says so above the fields.
- top-bar.tsxThe top bar: the menu button on tablets, where you are, the day stepper on Dispatch and Jobs, the live dot, New job (the one main action), the theme switch and the account menu. It frosts only once the page scrolls under it.
- partsWhat several sections share.
- buildWhat several sections share.
- cardsWhat several sections share.
- deal.tsThe deal card style: each card is dealt from the side of the current nav item, a short slide toward its place, one quickly after another.
- rowsWhat several sections share.
- mask.tsThe mask row motion: each part of a row on screen (its children) slides up from behind its own mask.
- core.tsxThe page's build-in: on first load and on every page switch the cards arrive in the app's card style and their contents build: bars grow, lines draw, rings fill, the list rows on screen ripple in in the app's row motion, numbers count. The two picks are wired in ./index.ts.
- index.tsThe app's two build-in picks, wired here and nowhere else: its card style (cards/) and its row motion (rows/). npm run new-app copies only the two it is given (--cards, --rows).
- appearance.tsHow the app looks right now: dark or light, Glass or Solid, from Settings → Appearance, the page around it and the Style setting.
- avatar.tsxA person's initials in a round badge, tinted with the primary.
- backdrop.tsxThe Glass style's backdrop: what shows through the see-through panels, faded out in Solid; with followBackground it paints your background instead.
- bits.tsxThe small shared marks every page uses: a job's status glyph and chip, colour dots for job types and zones, initials, the load bar, the page heading, a page's tab strip with a gliding pill and the panel head.
- command-palette.tsxThe command palette (⌘K or Ctrl K): type to find a page or an action, then Enter.
- dialog.tsxA centered modal dialog (a form, a confirm): rises in, plays its way out, Escape or a tap outside closes it, and the focus goes back where it was.
- drag-slot.tsDrag a job onto a technician's day lane (the Dispatch board): mouse and pen at once, touch after a short press (a swipe still scrolls), the lifted copy kept under the grab point and following 1:1, the lane under it showing the slot it would take (snapped to the job's arrival window), the board and the page scrolling near their edges, Escape to cancel. On release the copy glides into the exact slot and the save runs; a drop off the lanes glides it home.
- field.tsxA labeled form field (a text input or a select) with its error line under it, tied together for screen readers.
- flip.tsFLIP for a list that re-sorts or filters: after each change every row that stayed glides from where it was to where it is now. Rows carry data-flip="<id>"; positions are measured inside the list, so a page scroll never reads as a move, and measured again when the list is resized, so a new width never reads as one either.
- format.tsHow numbers and dates are written: by Intl, the current language's way ("1,240", "1.240"; "Nov 19", "19 nov."). Add a helper here when a page needs money, times or a list.
- icons.tsxThe logo and the line icons, drawn on a 24-unit grid with round ends.
- language.tsThe app's language: the words every page reads (useWords), how dates and numbers are written (parts/format.ts) and the reading direction. Picked in Settings → Appearance (or System: the page's own language) and kept in this browser; English is built in, any other language loads only when it shows (locales/list.ts).
- live-clock.tsxOne shared clock for everything live: it ticks only while something on screen listens, the tab is visible and live isn't paused, and the bare button that pauses it. What a tick does (move the demo's time, bring in an event, reload) is the app's, passed to liveClock.
- live.tsThe app's one live clock: every 6 seconds the crew moves on (data/live.ts: a technician heads out, arrives or finishes, a new call comes in) and every page reloads in place; every 10 the board's now line and the "min ago" times redraw. It rests while nothing live is on screen, the app is scrolled away, the tab is hidden or live is paused.
- moments.tsThe animations the sidebar, the sign-in card, menus, dialogs, the phone sheet, the side sheet and toasts play, timed by their moments in theme.ts.
- motion.tsMotion helpers: the reduced-motion check, live, and run-once-in-view.
- router.tsThe page switcher: reads the app's page from the address hash (#/settings, #/?status=open).
- scroll-to-view.tsScrolls an element into view moving only its own scroll container, never the page around it.
- select-box.tsxA native select dressed to match the app: no browser arrow, a drawn chevron instead.
- session.tsWhether someone is signed in: a first visit is signed in as the demo account; Sign out holds until the next sign-in, and a sign-in without Keep me signed in lasts only this tab.
- sheet.tsxThe phone sheet: a modal panel that springs in from the left with the sidebar; Escape, a tap outside or its close button slides it away.
- side-sheet.tsxThe detail sheet: a modal panel that slides in from the end edge over the page (a job, a technician, a customer, an invoice), with tabs whose underline glides to the one picked. Escape, a tap outside or its close button slides it away; the address keeps what it shows (?job=J-4931&dtab=timeline).
- states.tsxThe data states every page shares: a calm skeleton while loading, an error with Try again, and an empty note with a way out.
- store.tsThe app-wide state several parts share: the theme mode and style (kept in the browser) and the toasts.
- ticker.tsxA number that counts up while its page builds in, and rolls to its new value whenever it changes.
- toasts.tsxThe toasts: short notes that confirm what just happened, at the bottom end.
- use-api.tsLoads data through the fake API with loading, error and retry, remembering each answer so a page you come back to shows at once.
- use-dialog.tsOpens and closes a native <dialog> as a modal; on close it plays its way out first (data-closing), so dialogs, sheets and the palette never vanish in one frame.
- dataThe pretend data and the fake API: swap it for your backend.
- account.tsThe demo account: who is signed in (the account menu shows them) and the email and password the sign-in page takes.
- api.tsThe fake API: every page loads and saves through these functions, so wiring a real backend happens here only.
- db.tsThe pretend database in memory: what data/api.ts reads and saves, every change logged to the live feed. Swap it for your backend; the views at the bottom are what the pages ask for.
- live.tsThe live demo: the crew working while you watch. Each call is one thing that happens in the field or on the phone (a technician heads out, arrives, finishes; a new call comes in) through the same database the pages read. Wire your backend's events here instead.
- now.tsThe demo's "now": today at 10:40 plus the real time since the app loaded, so the board is mid-morning busy at any hour; every seeded date is set from it. Wire your backend and use the real time.
- seed.tsThe pretend plumbing company: 14 technicians, 2 dispatchers, about 60 jobs a day, customers, invoices and the morning's activity, all made from fixed lists and a seeded random so every visit looks the same. Replace with your backend's data.
- types.tsThe shapes the fake API answers with: jobs, technicians, customers, invoices, the catalog (job types, zones, the workday) and the live feed. Your backend returns the same shapes.
- localesEvery word the app shows, one JSON file a language; list.ts names them.
- en.jsonOne language's words, with the keys of en.json.
- es.jsonOne language's words, with the keys of en.json.
- list.tsThe languages the app offers, in the picker's order: one JSON file each, en.json the source. To remove one, delete its file and its line; to add one, copy es.json, translate it and add a line. English is built in; the rest load only when picked. TypeScript checks each file has en.json's keys, scripts/check/check-locales.mjs the rest (no extra keys, plural forms, {slots}).
dispatch-ochre.tsx
The page: the sections in order.
Yükleniyor…
- Şunlar için uygun
- Plumbing, HVAC and other field-service companies whose dispatchers book, assign and bill a crew's jobs every day.
- Nasıl çalışır
- Drag a waiting job onto a technician's lane: it snaps into its time slot, and the crew's en route and on site moves show live.
- Nasıl kullanılır
- Edit words in content.ts and colors in theme.ts, and swap the bodies in data/api.ts for calls to your backend.