Skip to content

D621: the Help Center's Popular this week and Did this answer it?, wired to their stores (#1280 step 2) - #1332

Draft
guillaumelauzier wants to merge 2 commits into
mainfrom
claude/spinout-lab-workspace-wuyyqd
Draft

guillaumelauzier wants to merge 2 commits into
mainfrom
claude/spinout-lab-workspace-wuyyqd

Conversation

@guillaumelauzier

@guillaumelauzier guillaumelauzier commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Objective

#1280 step 2: the Help Center's last two parts that needed a store. The Help Center canvas draws:

  • "Popular this week" on the home;
  • "Did this answer it?" on each guide.

D599 left both out for want of a store, and the contract test banned them. D603 (#1286) built the stores. This PR wires the page to them and lifts the two bans.

Part of #1280: step 3, the content regroup, remains.

Implementation

All three parts are in pages/docs/HelpSignals.jsx, mounted by DocsLayout.jsx.

Popular this week, on the home

  • Four cards: the most-viewed guides of the last 7 days that you can open, in the route's order.
    • Each card has a rank (the first violet, as drawn), the guide's title, and "1,240 views · Capital & Finance".
    • A view is one member reading a guide on one day.
  • Left out: a guide you cannot open, or one the Help Center no longer has. It is never shown as a dead card. The page asks the route for its maximum of 10, so the next guide fills the gap.
  • Placement: under the areas. It steps aside while a search is shown.

Did this answer it?, on each guide

  • Opening a guide records the view. The Worker counts one per member per guide per day.
  • Yes saves at once.
  • No opens one field, "What was missing?":
    • optional;
    • 500 characters at most (the Worker's limit), with a counter;
    • Send saves the answer.
  • Once you have answered, the card says what you answered, quotes what was missing, and offers "Change your answer".
  • Placement: before Related, as drawn.

The answers, for an admin, on the home

  • One card under the tickets card, for admins only:
    • each guide's yes and no counts, most "no" first, with the guide linked;
    • each "What was missing", newest first, with its guide and date;
    • five of each, then Show all.
  • No member is named. The route sends none, and the card says "no names".

Every part

  • Loading draws no figure.
  • A failed read says what could not be read, and offers Try again. It never shows as an empty week or a guide nobody answered.

Where the build departs from the canvas, and why

  • The note says who reads the answers. The canvas says a no "goes to whoever wrote the guide". No guide records its author, so that promise would go unkept. The note now reads: "Axal's admins read the answers, without your name."
  • The admin card is not on the canvas. Without it, no screen would show a single answer, and "Did this answer it?" would collect text nobody reads.
  • States the canvas does not draw: loading, a failed read, an empty week, changing an answer, an earlier answer that could not be read, and a failed save.

Files changed

  • Frontend:
    • pages/docs/HelpSignals.jsx (new)
    • pages/docs/helpCenter.js: the pure helpers
    • pages/docs/DocsLayout.jsx: the three mounts, and the header note
  • Docs:
    • decisions/D621.md (new)
    • D599 and D603 each point to it
    • ROUTE_MAP's Help Center row
  • Tests:
    • frontend/test/help_signals_d621.test.mjs (new)
    • help_center_contract.test.mjs: the two bans lifted

Testing

The full suite. npm run build, then npm run test:drift, gave EXIT=0 on this PR's head (4e6950ef4, on main at 3ae3a22c1):

  • frontend: 5,125 pass;
  • Worker: 5,935 pass, 3 skipped;
  • retention: 127 pass;
  • the guards, both type checks, lint:undef and the dark-mode check all pass.

The second commit answers Semgrep's detect-non-literal-regexp on the test file. The helper now takes one literal pattern per constant, so no regex is built from a string.

New tests (12):

  • The constants: the route's limit and window, and the 500-character cap, are read from the Worker.
  • The cards:
    • the route's order;
    • guides you cannot open left out;
    • zero views dropped;
    • four at most;
    • a reply with no list treated as a failed read.
  • Your answer: none, yes, no with or without text, and unreadable.
  • The admin view: counts and texts only, nothing about a member.
  • Every rendered state of the three parts.
  • Where each part mounts, and how each one reads.

Mutation checks: 24 of 24 caught. Each undid one behaviour, and every file was restored and checked by sha256.

Rendered check. The built bundle was served with stubbed /api replies, at 1280 and 390 wide, in light and dark:

  • The home: four cards, with a removed guide skipped. As an admin, the answers card reads "20 yes · 9 no · no names", with what was missing.
  • A guide:
    • the view is recorded;
    • No, then text, then Send reads back "You said this did not answer it." with the text quoted;
    • Yes reads back on a phone in dark.
  • Failures:
    • the home says each read failed, with Try again;
    • a guide whose earlier answer could not be read still offers Yes and No.
  • No page errors, and nothing scrolls sideways.

Risks

  • What ships: the frontend only. There is no Worker change and no migration.
  • Who notices:
    • every member on /help sees the popular cards;
    • every guide asks "Did this answer it?";
    • admins see the answers card.
  • Roll back by reverting the merge.

Dependencies

D603 (#1286, migration 408) is on main.

Agent

S01 · Claude Code

Review requested

The owner.

🤖 Generated with Claude Code

https://claude.ai/code/session_018jkNYLq29UXAvcqYxGCSB3


Generated by Claude Code

…red to their stores (#1280 step 2)

D603 built the stores and routes; this wires the page and lifts the two bans
the contract test held until they existed (pages/docs/HelpSignals.jsx):

- Popular this week (H1): the four most-viewed guides of the last 7 days
  that the reader can open, in the route's order. A guide they cannot open,
  or one the manifest no longer has, is left out, never a dead card.
- Did this answer it? (H2): opening a guide records the view; Yes saves at
  once, No opens one field for what was missing (the Worker's 500 cap), and
  an answer reads back and can be changed.
- The answers, for an admin, on the home: per-guide yes and no, most "no"
  first, and each missing text, with no names. The member note says who
  reads the answers, which this card makes true; the canvas's "whoever
  wrote the guide" names an author no guide records.

Loading draws no figure; a failed read says so and offers Try again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018jkNYLq29UXAvcqYxGCSB3
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Preview: https://studioos-pr-1332.guillaumelauzier.workers.dev (built from 4e6950e)

The pull request's SPA build on a Worker with no bindings: pages and deep links work, /api/* is a 404, and nothing here can reach production data. Redeployed on every push; deleted when the PR closes.

Comment thread frontend/test/help_signals_d621.test.mjs Fixed
Semgrep's detect-non-literal-regexp flagged the helper that built a RegExp
from a constant's name. The names were hard-coded, so nothing reachable was
at risk, but the helper now takes one literal pattern per constant, and the
rank check is a plain string check: the file builds no expression from a
string.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018jkNYLq29UXAvcqYxGCSB3

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants