Tickets Larkspur
v1.0A minimal SaaS help desk for a small support team: an inbox whose SLA rings tick down on every row, conversations with internal notes, customers, saved replies and reports, in slate with one violet-blue accent.
ที่อยู่หน้า: /
มีในตัว
สิ่งที่คุณได้รับ- สว่างและมืดใช้สีของธีมคุณ
- เดสก์ท็อป แท็บเล็ต และโทรศัพท์หน้าจอที่สร้างมารองรับ
- แพ็กเกจ…
- ขนาดโค้ด…
- ประหยัดแบตเตอรี่30 fps หยุดพักเมื่อนิ่ง
- หยุดเมื่อซ่อนอยู่นอกหน้าจอหรืออยู่แท็บอื่น
- ลดการเคลื่อนไหวสงบสำหรับผู้ที่ตั้งค่าไว้
ตรวจสอบทุกครั้งที่มีการเปลี่ยนแปลง
ตรวจสอบความปลอดภัย 3 ธ.ค.- ตรวจสอบไทป์TypeScript แบบ strict
- Lint และฟอร์แมตESLint · Prettier
- ทดสอบและบิลด์ภาพหน้าจอโหมดสว่างและมืด
- ตรวจสอบความปลอดภัยไม่มีคำเตือนระดับสูงหรือวิกฤต
- อายุแพ็กเกจทุกเวอร์ชันเผยแพร่มาแล้วอย่างน้อย 7 วัน
- CPU ขณะว่างต่ำกว่าครึ่งคอร์ขณะพัก ≤ 30 fps
โค้ด
tickets-larkspurReact
- tickets-larkspur.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.tsxEvery customer in one table: search and plan in the address (#/customers?plan=enterprise), each row with their company, plan, open and total tickets, satisfaction and last contact; a row opens the customer's sheet, New customer the form.
- inbox.tsxThe inbox: one view of the queue (all, mine, unassigned, breaching soon) with its filters in the address (#/inbox?view=unassigned&priority=high), the tickets grouped by status, the bulk bar for a pick, and the keys that work it (sections/ticket-list.tsx). A ticket opens in the side sheet (?t=3912).
- overview.tsxThe start page: the desk at a glance. The KPI strip (open, breaching soon, median first reply, satisfaction), the tickets whose reply is due soonest (or the unassigned ones, or yours) beside the live feed, tickets in per day beside the queue by tier, and the team with what each has open.
- replies.tsxSaved replies: the categories down the side (add, rename, delete), the replies of the one picked, and the picked reply's text with its uses over the last 8 weeks; New reply, Edit and Delete work through dialogs. The address keeps the pick (#/replies?cat=rc-billing&r=r-refund).
- reports.tsxReports over 4, 12 or 26 weeks (#/reports?range=12w): the KPI strip, the median first reply week by week, SLA breaches by week, tickets solved per agent and breaches by plan. A new range morphs the charts instead of drawing them again; the current week grows with what happens live.
- settings.tsxThe settings page (#/settings?tab=team): SLA targets per plan, the team, tags and Appearance (theme and language), one tab at a time.
- 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.
- 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: Overview, Inbox, My tickets and Customers, and More for the rest (the sidebar in a sheet). It sticks to the bottom of the screen under the page.
- bulk-bar.tsxThe bar that rises when tickets are picked: how many, set their status or priority, give them to someone, add a tag, delete them (Undo in the toast), or clear the pick.
- conversation.tsxA ticket's conversation: the customer's messages, the team's replies and its internal notes (on a quiet ground with a lock, only the team sees them), oldest first, and the composer under them: Reply or Internal note, a saved reply to insert, and the status the reply leaves the ticket in. Ctrl or ⌘ Enter sends.
- customer-sheet.tsxA customer in the side sheet (?customer=c-ada-park): their plan and its SLA, satisfaction, and every ticket they've sent, with Edit and Delete; and the customer form (?new=customer, ?change=c-ada-park) to add or change one.
- delete-dialog.tsxThe one "are you sure" before something goes: what goes, what goes with it, Cancel and the red action. Undo stays in the toast after.
- feed.tsxThe live feed: who did what, newest first, then the ticket and what was said muted under it; a row that arrives (a ticket coming in, a teammate's reply) slides in at the top.
- kpi-strip.tsxThe KPI strip: four numbers in one bordered box, each with its line under it and a sparkline or a progress bar; a changed number rolls to its new value and a sparkline grows a point.
- reply-form.tsxThe saved-reply form (?edit=new or ?edit=r-refund on Saved replies): title, category, shortcut and text, with {first} and {agent} filled in when an agent inserts it; and the small dialog that names a category.
- settings-desk.tsxSettings → SLA targets (per plan and priority: the first reply and the time to solve, in minutes; every ring and report follows them) and Settings → Tags (add, rename, recolour, delete).
- settings-team.tsxSettings → Team: the nine agents, their tier, role and open tickets, who is away (away agents get nothing new), adding someone and removing them (their open tickets go back to Unassigned).
- sidebar.tsxThe sidebar: the workspace, search with the ⌘K shortcut, the desk's views with their counts (they roll when a ticket is assigned or arrives) and a pill that glides to the current one, the team's pages, 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.
- ticket-form.tsxNew ticket (?new=ticket, from the top bar, the palette or any page): who it's from, what it's about, its priority and owner, a tag and the customer's message. It opens in the side sheet once made.
- ticket-list.tsxThe inbox list: tickets grouped by status (New, Open, Pending, Solved), each row with its priority, number, status, title and customer, tags, the SLA ring ticking down and who has it. The keyboard works it like a queue: J and K (or the arrows) move, X picks, Enter opens, A assigns it to you (in Unassigned it slides out, the counts roll) and Shift+A gives it back. New tickets slide in at the top; rows that move glide (FLIP).
- ticket-sheet.tsxA ticket in the side sheet (?t=3912): its status, priority and owner to change in place, the SLA ring for the next reply, and tabs for the conversation (with the composer under it), the details (title, tags, the customer, delete) and the customer's other tickets.
- top-bar.tsxThe top bar: the menu button on narrow screens, where you are, the inbox's view switch (All, Mine, Unassigned, Breaching), the live dot, New ticket, 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.
- text.tsThe text card style: cards fade in while titles, labels and numbers (data-build="text") slide up from behind a mask; numbers show their final text.
- rowsWhat several sections share.
- spot.tsThe spot row motion: each row on screen lights up from faint as a soft primary glow passes it.
- 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.
- bar-chart.tsxA bar chart: bars grow in, and the picked bar (in the primary), its guide line and tooltip glide to the bar you point at or pick with the arrow keys; a new range morphs the bars instead of drawing them again.
- command-palette.tsxThe command palette (⌘K or Ctrl K): type to find a page, an action, a ticket (by its subject or #number) or a customer, then Enter.
- desk.tsxThe small pieces every helpdesk page shares: a status glyph, a priority's bars, the SLA ring that counts down a ticket's next reply, a tag's chip, a channel's icon, a person's initials, and which rows just arrived (they slide in).
- 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.
- 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.
- format.tsHow numbers, dates and durations are written: by Intl, the current language's way ("1,240", "1.240"; "Nov 19", "19 nov."; "42m", "3h"). Add a helper here when a page needs another kind.
- 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).
- line-chart.tsxA line chart with a soft area under it, in the primary: the line draws itself in, the latest point marked, and new values roll the line to its new shape.
- 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 7 seconds the helpdesk moves (a ticket arrives, a teammate replies, a customer answers, one is solved: data/live.ts) and every page reloads in place; every 5 the SLA rings redraw. It rests while nothing live is on screen, the tab is hidden or live is paused.
- moments.tsThe animations the sidebar, the sign-in card, menus, dialogs, the phone sheet and toasts play, timed by their moments in theme.ts.
- motion.tsMotion helpers: the reduced-motion check, live, and run-once-in-view.
- overlays.tsxEverything that opens over the page from the address: a ticket or a customer in the side sheet, and the New ticket and customer forms. Any page can open one by adding its query (?t=3912, ?customer=c-ada-park, ?new=ticket).
- read.tsOne read of the fake API by its key, through useApi: useRead("overview"), useRead<"deal">(`deal:${id}`). Each key keeps one load function, so a page that mounts again finds its answer.
- 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 ticket, a customer), 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 (?t=3912&dtab=details).
- 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, "My tickets" are theirs) 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 and every change to it: tickets (assign, status, priority, tags, delete and restore), replies and notes, customers, saved replies and their categories, the SLA targets, the team and the tags. The fake API (data/api.ts) calls these; the pages never do.
- live.tsThe live demo: the helpdesk at work while you watch. Each call is one thing that happens (a customer writes in, a teammate replies, a customer answers back, a teammate solves one) through the same database the pages read. Wire your backend's events here instead.
- now.tsThe demo's "now": today at 14:20 plus the real time since the app loaded, so the queue is busy at any hour; every seeded time is set from it. Wire your backend and use the real time.
- seed-history.tsThe reports' history: 26 weeks of rollups (tickets in and solved, median first reply and time to solve, SLA breaches by plan, satisfaction, solved per agent), smooth week to week like a real queue. The current week is counted live from the tickets (data/views.ts).
- seed-people.tsThe pretend team and customers: nine agents in three tiers, 120 customers at 60 companies on four plans, the tags and the SLA targets each plan buys. Replace with your backend's records.
- seed-replies.tsThe team's saved replies in their categories: the answers agents insert instead of typing them again. {first} becomes the customer's first name and {agent} the agent's when inserted.
- seed-tickets.tsThe pretend queue: about 300 open tickets (new, open and pending) and the last week's solved ones, each with its conversation, made the same way on every load from the topics, the customers and the demo's "now". Replace with your backend's tickets.
- seed-topics.tsWhat customers of a project-management app write in about: each topic with a few ways people title it, how they describe it, its tags, the tier that handles it, how urgent it tends to be and the line an agent answers with.
- sla.tsThe SLA rules in one place: when a ticket's next reply is due (the clock starts when the customer writes and stops when an agent replies; pending and solved tickets have none), and how much of its time is left.
- types.tsThe shapes of the helpdesk's data: tickets and their messages, customers and their plans, agents, tags, saved replies and the SLA targets. The fake API (data/api.ts) answers in these shapes; a real backend would too.
- views.tsWhat each page reads, worked out from the database: the inbox rows for a view and its filters, the sidebar counts, the Overview numbers, a ticket with its conversation, customers, saved replies, reports and settings. Counts and lists use the same rules (isOpen, isMine, isUnassigned), so a number and the list it opens always agree.
- 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}).
tickets-larkspur.tsx
The page: the sections in order.
กำลังโหลด…
- เหมาะสำหรับ
- Small support teams who answer tickets against SLA targets per plan and want a calm, keyboard-first help desk.
- ทำงานอย่างไร
- Press A on an unassigned ticket: it slides out of the list, the sidebar counts roll and a line lands in the live feed.
- วิธีใช้
- Edit words in content.ts and colors in theme.ts, and swap the bodies in data/api.ts for calls to your backend.