the docs search only matched titles/folders, so searching a term that lives in
a doc's body (e.g. 'heartbeat') returned nothing — you had to already know
which doc to open.
- search now matches title AND body across all docs; results show the title
plus a context snippet with the query highlighted (<mark>)
- doc bodies are fetched once on first search and cached (invalidated when the
doc list changes); in-flight searches cancel on a new query
- clicking a result opens the doc (and updates the URL); clearing returns the
folder tree
- a11y: the homepage API peek used role=tablist/tab without tabpanels (an
incomplete ARIA pattern) — switched to a labeled button group with aria-pressed
- verified live: 'heartbeat' -> 3 body matches with highlighted snippets,
click opens Connect-your-broker, clear restores the tree
a mobile audit (no overflow anywhere; agent modal + on-this-page TOC both fine)
turned up one weak spot: on phones the doc tree was a cramped 210px scroll area
pinned above every page, and it never scrolled the active doc into view — so
you couldn't tell which doc you were reading or reach half of them easily.
- the sidebar now collapses to a compact bar showing the CURRENT doc + a
chevron; tap to reveal the full tree (active doc highlighted), tap a doc to
navigate and auto-collapse
- desktop is byte-for-byte unchanged: the collapsible wrapper is display:contents
off-mobile, so the tree stays a normal flex child (sidebar still 280px)
- verified live: mobile collapsed shows 'API reference', expands to 8 docs,
selecting Quickstart navigates + collapses + relabels; desktop toggle hidden,
tree intact
builds on per-doc routing: long docs (API reference has 6 sections, Roadmap 4)
are now navigable and section-shareable.
- each h2/h3 gets a slug id + a hover '#' anchor; URL form is
#/<doc-slug>/<section-slug> (e.g. #/api-reference/keys-self-service)
- an 'On this page' TOC renders for docs with >=3 headings; click or deep-link
scrolls to the section; browser back/forward still work
- decorations (anchors, ids, code copy buttons, syntax highlighting) are now
baked into the memoized HTML string instead of mutated in post-render DOM
WHY: the post-render mutation approach was being wiped. setToc() inside the
decorate effect triggered a re-render that re-applied dangerouslySetInnerHTML,
resetting the article's children and dropping every decoration, with the
effect never re-running (deps unchanged). Doing it at the string level makes
the markup self-contained and immune to re-injection. Copy buttons use event
delegation; anchors are real links (work without JS).
- verified live: 6/6 heading ids + anchors on API reference, TOC navigates,
3 copy buttons + highlighting on Connect-your-broker, deep-links land and
scroll to the section, TOC hidden on short docs
the docs site kept the selected document only in React state, so you couldn't
bookmark, share, or refresh-into a specific doc, and browser back/forward did
nothing — a real gap for a developer docs site people want to link into.
- each doc now has a slug URL: docs.amerc.ai/#/connect-your-broker
- selecting a doc pushes the slug to the URL (history.pushState)
- loading a #/<slug> URL lands directly on that doc; unknown/empty falls back
to Quickstart as before
- hashchange + popstate listeners make browser back/forward switch docs
- the browser tab title now reflects the open doc (<title> · Docs · amerc)
- verified live on docs.amerc.ai: click updates URL+view+title, deep-links
land correctly, back/forward navigate between docs
- visiting docs.amerc.ai showed a blank 'Select or create a document' main
area — a poor first impression for the public docs/onboarding surface
- auto-select a sensible default on load (Quickstart -> a 'start here' doc ->
first doc) without overriding a user's later selection
- verified live: docs.amerc.ai lands on Quickstart, sidebar highlights it
- minimal dep-free highlighter for fenced code blocks: strings (green),
numbers (amber), keywords (purple)
- deliberately NO comment rule, so '//' inside URLs (https://, wss://) is
never mis-colored or mangled — the common micro-highlighter pitfall
- applied in the DocsApp post-render pass alongside the copy buttons; the
copy button still yields the exact original text
- verified live: 22 tokens colored, both https:// and wss:// URLs preserved
byte-for-byte, code intact
- fix fenced code blocks: reset the doubled inline-code background on
'pre code', readable monospace styling (applies to all technical docs)
- DocsApp decorates rendered code blocks with a hover copy button
- seed a 'Connect your broker' guide (guides/) — the lasting reference for
the supply-side last mile: heartbeat loop (curl + Node) to stay online,
the relay WebSocket, and how it fits together (accurate from the API)
- verified live on docs.amerc.ai: guide renders, 3 code blocks, 3 copy
buttons wired, clean styling
- amerc-api: GET /docs + /docs/:id are public (reads); writes still require auth
- DocsApp/ConsoleShell: publicView mode renders docs read-only when logged out,
with a 'Log in to edit' header CTA; edit/new/delete hidden for anonymous
- Docs nav link now shown to everyone
- seeded 5 quality guides: Quickstart, Publish an agent, Embed a chatbox, Showcase, API reference