Skip to content

feat(roi): ROI page with a calculator, behind the roi flag - #335

Open
wab wants to merge 14 commits into
mainfrom
cc/248-roi-page-7d65d1
Open

wab wants to merge 14 commits into
mainfrom
cc/248-roi-page-7d65d1

Conversation

@wab

@wab wab commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Closes #248

What

The ROI page at /fr/roi and /en/roi (/roi redirects to the visitor's language), built from the roi mockup in the prototype repo.

  • Hero with the animated multiplier chart.
  • Walkthrough: the multiplication of the five figures laid out in three bands (formula, today, with RevOps) and the gain.
  • Calculator: five sliders, a conservative or ambitious scenario, a result card (sticky from lg) and a line-by-line detail table.
  • Closing diagnostic block, reused from the challenge pages.

The calculation is pure, in app/utils/roi.ts, written test-first (app/utils/roi.test.ts). Components only format and display it. Figures are formatted per language with Intl.

Flag and sign-off hold

roi stays in DISABLED_PAGES_DEFAULT. It is also listed in AWAITING_SIGN_OFF_PAGES in app/modules/feature-flags.ts:

  • Production keeps the page off whatever DISABLED_PAGES says, until Ocobo signs off the copy.
  • Vercel previews (VERCEL_ENV=preview) and local development follow DISABLED_PAGES, so the copy can be reviewed there by setting DISABLED_PAGES=news,tools.
  • A production build without VERCEL_ENV counts as production (fails closed).
  • To launch: remove roi from AWAITING_SIGN_OFF_PAGES and from DISABLED_PAGES_DEFAULT.

To review the page on the Vercel preview, the Preview environment needs DISABLED_PAGES=news,tools. Without it, the default list still includes roi and the preview returns 404. I could not check the Vercel settings from here.

With the flag off, /roi, /fr/roi and /en/roi return 404 and the sitemap omits the page. With it on, the sitemap lists both languages.

Notes for review

  • Copy awaits Ocobo validation, in particular the assumptions behind the two scenarios and the disclaimer.
  • EN copy is machine-translated from the FR mockup copy. It needs a human pass.
  • No gradient text. ADR 0002 keeps gradients.ai-text for AI content; the hero uses the yellow marker instead.
  • No preset/ change. Everything uses existing recipes and v2 tokens.
  • OG image falls back to the homepage one; there is no ROI-specific image yet.

Shared pieces touched

  • ChallengeDiagnostic is reused as is, with the roi copy. No change to the component.
  • docs/development/component-inventory.md lists the new app/components/roi/ components.

No shared recipe or component changed, so no other page should move on the preview.

Checks

  • pnpm check, pnpm typecheck, pnpm test:run: green.
  • Browser, flag on: FR and EN at 1440px and 375px. Sliders and the scenario toggle update every figure. No horizontal page overflow; the walkthrough scrolls inside its own region on a phone.
  • Browser, default flag: 404 on all three paths, page absent from the sitemap.
  • Code review of the branch diff by a reviewer agent. Fixed: euro figures at the rounding boundaries ("1000 k€"), inline display font replaced by text(), detail table header count, one live region for the gain only, walkthrough reading order, slider hint via aria-describedby, plural in the example copy, walkthrough file split under 400 lines. Left: the hero chart's end chip combines border, shadow and radius inline; it is a pill, not a card.

@vercel

vercel Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
website Ready Ready Preview Nov 17, 2026 2:52pm UTC

Request Review

wab added 10 commits November 17, 2026 15:15
computeRoi multiplies reps, opportunities, win rate, deal value and
duration, then applies a conservative or ambitious RevOps scenario.
The formatting helpers write euros, counts and percentages in French
and English. Both are covered by unit tests (#248).
Production sets DISABLED_PAGES without roi, so dropping roi from the
unbuilt list would publish the page. AWAITING_SIGN_OFF_PAGES keeps it off
in production whatever the env var says, and lets Vercel previews and
local dev follow DISABLED_PAGES so the page can be reviewed. Refs #248.
One shared state (five figures and a scenario) feeds the worked
example, the sliders, the result card and the detail table. Copy lives
in the new roi namespace, FR and EN.
The global h3 rule set them in Bermia and pushed the hint down. They now
share stepTitle and stepHint with the walkthrough steps.
999 600 € read "1000 k€" and 9 999 000 € read "10,00 M€". The unit and
the decimals now follow the rounded figure. French counts group with NBSP
like the other helpers.
The walkthrough file passed 400 lines. The band cells are now sorted by
row and column, so a screen reader reads the formula in order rather than
all terms, then all operators. The example copy takes a plural for the
opportunity lever.
- Figures use text({ variant: 'display-md-black' }) with a size override
  instead of an inline display font (ADR 0001).
- The detail table hides its operator column header, as every row does,
  so headers match cells.
- One polite live region announces the contract value gain; the result
  card and the lever pills no longer announce on every slider step.
- The slider hint is linked with aria-describedby, out of the label.
- The hero is a div, not a second banner landmark.
text() defaults to the dark colour, so the today figure on the result
card and the with-RevOps figure on the final detail row became
invisible on their dark background. Each now names its colour.
- Top padding: the layout already clears the navbar, so the badge now
  sits 168px from the top instead of 288px.
- Headline: plain wrap instead of the reset's balance, so the first
  line breaks after "equipe" as in the mockup.
- Subtitle: the 20px medium lead of the other redesigned heroes, in
  gray.600.
- Dot backdrop behind the chart, with the mockup's mask.
- Chart narrowed to 1024px.
wab added 2 commits November 17, 2026 15:51
cx joins classes without merging them: a shared px/py class emitted later
in the stylesheet overrode the ring, final pill and chip paddings.
- The detail header row shows on phones and its labels fit their columns.
- Header and row paddings no longer clash (8px header, 14px rows).
- Headers and hints use the muted grey, 4.8:1 on white.
- The slider hint sits outside its label, so the accessible name is the
  label alone; the hint stays attached through aria-describedby.

This branch was successfully deployed

1 active deployment
Preview — 01ef2a64 Deployed Nov 17, 2026 by vercel[bot]
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.

J5: ROI page with a calculator, behind a feature flag

1 participant