Help Center and playable guides
The in-app Help Center (/help) is a set of task articles for users. It is
pure frontend content: no backend, no database, no markdown pipeline. This
page covers how articles are built, how their screenshots render, and the
playable guides ("Walk me through it") that walk a user through an article on
the real screens. For the writing rules, see
conventions.
Articles
Each article is a TypeScript module in frontend/src/content/help/, one file
per article, registered in articles.ts. The model is in types.ts: a
HelpArticle has a slug, title, category, summary, a list of blocks
(heading, paragraph, steps, bullets, note, image), and an optional guide.
app/help/page.tsx lists the cards, app/help/[slug]/page.tsx renders one
article through components/HelpArticleBody.tsx.
Screenshots
Screenshots live in frontend/public/help/ and are referenced as
/help/<file>.png.
- Capture at device scale 2. Use a 1440x900 viewport at
device_scale_factor=2(Playwright) and crop to the region the step needs. A full page shot is about 2000 to 2880 px wide. - Rendering.
HelpArticleBodyrenders every screenshot at the full width of the article column, but never wider than the file's own pixel width (screenshotMaxWidth), so a small crop is never stretched into mush. Tall portrait shots (height more than 1.15x width) cap at 620 px wide. Click a screenshot to open it full size in a lightbox. - History. Until November 2026 images were drawn with
w-full max-h-[460px] object-contain. The height cap shrank every normal 16:10 screenshot to a box about 60% of the column wide with empty space either side, and thew-fullstretched tiny 1x crops (the product switcher shot was 380x160) to the full column, which blurred them. Both are gone, and a test keeps the cap from returning. - Enforced by tests.
backend/tests/test_help_guides.pyfails when a referenced screenshot is too small to be sharp at full width (under 1400 px wide for strips, under 1000 px for boxy panels). Older 1x captures are listed inLEGACY_1Xin that test; they render at their own size. The list may only shrink: recapture one at 2x, then delete it from the list. - A referenced file that does not exist yet renders a captioned "Screenshot coming soon" placeholder on purpose.
Playable guides
A step-by-step article can carry a guide: an ordered list of GuideSteps.
When it does, the article page shows a Walk me through it button
(components/guides/WalkMeThroughButton.tsx) and its card shows a
Walkthrough badge. Ported from ContentsEstimation's guide player, built
in this app's design system.
interface GuideStep {
title: string // short, verb-first
body: string // one or two sentences, **bold** allowed
route?: string // '/dashboard' is navigated to; '/claims/:id' is matched only
target?: string // data-guide id of the element to spotlight
await?: 'next' | 'click' | 'input' | 'check' // default 'next'; 'check' is training only
image?: string // optional /help/... screenshot shown small in the player
checks?: string[] // training lessons only: check keys a 'check' step waits on
shortcut?: { keys: string[]; label: string } // training lessons only: a shortcut it teaches
}
Training lessons play through the same player as a CustomGuide (steps
built at runtime, not from an article), persisted under cv.guide.custom.v1.
See taking a course.
How it runs
| Piece | File | Role |
|---|---|---|
| Step logic | src/lib/guideSteps.mjs | Pure helpers: route matching, which control to show, saved state parsing, guide validation. Unit tested with node --test. |
| Provider | src/lib/guides.tsx | GuideProvider (mounted in app/layout.tsx) holds the active guide and step, persists it in sessionStorage (cv.guide.v1) so it survives navigation and reloads, and pushes each step's concrete route. |
| Spotlight | src/components/guides/GuideSpotlight.tsx | Finds [data-guide="<target>"] (first visible match), scrolls it into view, dims the page around it with a pulsing ring, and for click / input steps advances when the user clicks it or types into or changes it (a file drop counts). Never takes pointer events. |
| Player | src/components/training/ChatBubble.tsx | The help chat bubble. A guide plays inside its panel (a GuideWindow: movable, resizable, zoomable, remembered per user, clamped to the visible viewport) as a chat thread: finished steps as ticked lines, the current step as a message with its hints, and Back / Next / Skip / Finish pinned in the footer, Exit in the header. The panel opens by itself when a guide starts. The launcher shows n/N while a guide runs. |
| Window | src/components/training/GuideWindow.tsx | The floating window every guide surface shares (chat panel, tour card, mission tracker). Drag the header or use the arrow keys to move, the corner grip or Shift + arrows to resize, A- / A+ to zoom 80% to 160%. Layout is saved per user and per window, and clamped to the visible viewport (visualViewport) so the footer never sits under browser toolbars. Geometry rules are in src/lib/guideWindow.mjs (unit tested). |
The help chat bubble
ChatBubble is mounted on every signed-in page: a round launcher at the
bottom right. Hovering it offers to tuck it into the wall as a slim tab, and
the open and tucked states are remembered (cv-chat-open, cv-chat-hidden
in localStorage). With no guide running, the panel has three tabs:
- Ask. The question is scored against every Help Center article locally
(
searchArticles: each word over two letters that appears in the article counts, title hits count triple). The top three go toPOST /api/support/askwith the question; the server saves both turns (support_chats, kept a year after the last message) and answers with the articles. With none, or when the person asks for a human (services/support_drafts.py), it answers with the support form filled in. No AI is involved. - Guide. Every article with a guide.
finding-your-way-around, the short "where things are" tour, comes last, except on the Sedgwick instances (by hostname,lib/productLinks.mjs), where it comes first and opens by itself once per person (StarterGuideOnce.tsx,starter_guide_seen). - Support (
SupportPanel.tsx). Contact (a form with attachments), Tickets (the person's own history from Zendesk) and Chats (their past Ask chats).
Rules for tickets (routes/support.py, services/zendesk.py):
- Only
POST /api/support/ticketsmakes one, and only the person's own Send calls it. Never create a ticket, or email support, on someone's behalf here. - The requester is the signed-in person's email, so ContentsVision and ContentsEstimation show the same history. The user search must match the email exactly, a ticket must be theirs, and internal notes are dropped.
- ContentsEstimation adds
email_changed_atto its sign-in token when a person's email has changed. Tickets older than that are hidden. - An admin viewing as someone cannot send.
When a guide starts (from here, an article, or a training lesson) the panel opens by itself and switches to the guide thread described above.
Both visual pieces are mounted in components/AppShell.tsx, so they only run
inside the signed-in app shell. Z-order: modals are z-100, the spotlight
z-110, the player z-120, so a guide can highlight controls inside modals.
Confirm dialogs (ConfirmModal, which renders ModalShell with
layer="confirm") sit above the player at z-125, so a yes/no question is
never hidden under a lesson. When a step that waits on server checks passes on
the LAST step, the player finishes the lesson (grades it and opens the course
page) instead of just stepping past the end (checkPassedAction in
lib/guideSteps.mjs).
Degrading gracefully
- A
click/inputstep only waits while its target is on screen. If the target is not found within 8 seconds (TARGET_TIMEOUT_MS), the player says so and shows Next. While it is still searching, Next is shown too. - Every waiting step has Skip, so a guide can never dead-end.
- Route patterns (
/claims/:id,/rooms/:id) are never navigated to: the player cannot know which claim the user means. Guides that work on a claim start with the sharedOPEN_A_CLAIMstep (content/help/guide-common.ts), and later steps tell the user to open a claim if they are elsewhere. - If the user wanders off a concrete route mid-step, the player offers Take me there instead of yanking them back.
- Clicking the target on the last step finishes the guide, like Finish.
data-guide targets
Targets are plain data-guide="..." attributes on real elements, separate
from the training tour's data-tour ids. Two families are templated:
nav-<route> on every sidebar link (nav-help, nav-settings, ...) and
settings-tab-<id> on the Settings tabs. Never rename a data-guide without
updating the guides that use it; the tests catch it.
Writing a guide
- Only for step-by-step task articles. One action per step.
- The first step needs a concrete
route(usually/dashboard), so a guide started from the Help Center takes the user somewhere. - Use
await: 'click'/'input'for the action the step is about, and plainnextfor "look at this" steps. - Do not
await: 'click'on a button that spends credits or sends data (the Send to ContentsEstimation submit button is anextstep). Users do the real thing on their own claims.
Tests
backend/tests/test_help_guides.py (part of ./run_tests.sh):
- runs
src/lib/guideSteps.test.mjs(step logic) andsrc/content/help/guides.test.mjs(loads the realarticles.tswith Node's type stripping and validates every guide: titles, bodies, awaits, routes, images, and that every target exists as adata-guide); - checks, without Node, that every
target:in the help content has a matchingdata-guideinfrontend/src; - checks the player and spotlight are mounted and animate out, and the CSS classes exist;
- the screenshot size checks above.
The Node parts skip when Node is not installed (the content test needs Node 23+). There is no browser component test harness in the frontend; the guides were verified end to end in a real browser with Playwright.