Skip to content

fix: make the answer audible, shareable and fast - #36

Merged
devRMA merged 4 commits into
feat/design-systemfrom
fix/standards
Nov 20, 2026
Merged

devRMA merged 4 commits into
feat/design-systemfrom
fix/standards

Conversation

@devRMA

@devRMA devRMA commented Sep 14, 2026

Copy link
Copy Markdown
Owner

5 of 6 — stacked. Base: feat/design-system (#35).

Accessibility, SEO and Core Web Vitals, with the numbers measured rather than assumed.

A screen reader could not hear the calculation

The one number this app exists to produce was unreachable. The progress ring carries the running day and sits inside aria-hidden because it is decorative — and nothing beside it announced the value. A screen reader user got the form and never the answer.

A polite live region now carries the state in words, at minute granularity: "Faltam 7h 48m para o fim da jornada", "Hora extra de 1h 0m". Announcing the second tick would mean sixty interruptions a minute, which is worse than silence. "Trabalhado até agora" announces only while the journey is actually running.

The <h1> was the fixed word "WorkLoad" while each page's real subject sat in an <h2> — the document outline named the brand, not the page. The accessible name is the route's own heading now; the visual design is unchanged, pixel for pixel.

Lighthouse found a contrast failure that reading the code could not

The cookie banner's secondary button measured 3.66:1. bg-chrome is 72% white and the banner sits over the emerald hero, so the effective colour depended on whatever happened to be behind it. A consent card cannot have its legibility decided by the background. It is opaque now, and the blur that justified the translucency went with it.

accessibility 0.96 → 1.00, both routes, both presets.

The calculator was shipping hidden at opacity: 0

AnimatePresence wrapped the panel with initial={{ opacity: 0, y: 12 }}, and Motion serializes that initial state during SSR — so the HTML arrived with the whole calculator invisible and nothing painted until the JS loaded and the animation finished. LCP 5.6s, 5.1s of it render delay, for an entrance animation nobody could see: activeView is fixed per route, so the first paint is never a transition.

initial={false} keeps the animation where it means something — the client-side switch between tabs.

LCP 5.6s → 2.8s. Mobile performance 0.80 → 0.96.

Shareable

Both routes declared twitter:card=summary_large_image and neither shipped an image, so every share promised a card and rendered a blank one. Images are generated at build time from the route's own content, not checked in as PNGs that rot. Twitter needs its own file at the root — the twitter block in layout.tsx sits in the same segment as the root opengraph-image and blocks the fallback for / while /custo-da-hora inherits it correctly.

The structured data was one generic WebApplication duplicated across both routes, describing neither. Each route declares its own node plus the breadcrumb trail it actually has. No FAQPage — marking one up without FAQ content on the page is a penalty, and writing labor-law FAQ text is the content-writer's and the labor-law-analyst's work, not a side effect of an SEO pass.

sitemap.lastModified said "now" on every request, which tells a crawler the page changed every time it looked — exactly as useful as saying nothing.

Budgets that can fail

The old config ran only /, only desktop, and accepted almost any regression (performance was a warning at 0.70) while Playwright already tested mobile. Both routes are collected now, mobile by default and desktop via LH_PRESET, and every threshold is an error set just below the worst score actually measured.

measured (worst) budget
performance 0.96 0.93
accessibility 1.00 0.98
best-practices 1.00 0.98
seo 1.00 0.98

Two independent 1s intervals also ticked in parallel because two consumers each called useCurrentTime. One module-level interval with a subscriber set serves both, and they get the same Date rather than two a few milliseconds apart. The hook's signature did not change.

Verified

biome check · tsc --noEmit · 471 unit tests · production build · Playwright 43/43 · lhci autorun mobile and desktop — all clean.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
workload Ready Ready Preview Nov 20, 2026 8:26am UTC

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

devRMA and others added 3 commits September 14, 2026 17:18
The one number the app exists to produce was unreachable. The progress ring
carries the running day and sits inside aria-hidden because it is decorative,
and nothing beside it announced the value — so a screen reader user got the
form and never the answer.

A polite live region now carries the state in words, at minute granularity:
"Faltam 7h 48m para o fim da jornada", "Hora extra de 1h 0m". Announcing the
second tick would mean sixty interruptions a minute, which is worse than
silence. The "Trabalhado até agora" row announces only while the journey is
actually running.

The h1 was the fixed word "WorkLoad" while each page's real subject sat in an
h2 — so the document outline named the brand and not the page. The accessible
name is now the route's own heading; the visual design is unchanged.

Lighthouse found a contrast failure that reading the code could not: the
cookie banner's secondary button measured 3.66:1, because bg-chrome is 72%
white and the banner sits over the emerald hero, so the effective colour
depended on what happened to be behind it. A consent card cannot have its
legibility decided by the background. It is opaque now, and the blur that
justified the translucency went with it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Both routes declared twitter:card=summary_large_image and neither shipped an
image, so every share promised a card and rendered a blank one. The images are
generated at build time from the route's own content rather than checked in as
PNGs that would drift the first time the product changed. Twitter needs its own
file at the root: the twitter block in layout.tsx sits in the same segment as
the root opengraph-image and blocks the fallback for / while /custo-da-hora
inherits it correctly.

The structured data was one generic WebApplication duplicated across both
routes, which describes neither. Each route now declares its own node plus the
breadcrumb trail it actually has.

No FAQPage: marking one up without FAQ content on the page is a penalty, and
writing labor-law FAQ text is the content-writer's and the labor-law-analyst's
work, not a side effect of an SEO pass.

sitemap.lastModified said "now" on every request, which tells a crawler the
page changed every time it looked and is exactly as useful as saying nothing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
AnimatePresence wrapped the panel with initial={{ opacity: 0, y: 12 }}, and
Motion serializes that initial state during SSR — so the HTML arrived with the
whole calculator invisible and nothing painted until the JS loaded and the
animation finished. LCP was 5.6s, 5.1s of it render delay, for an entrance
animation that could not be seen anyway: activeView is fixed per route, so the
first paint is never a transition. initial={false} keeps the animation where it
means something, on the client-side switch between tabs.

LCP 5.6s -> 2.8s, mobile performance 0.80 -> 0.96.

Two independent 1s intervals ticked in parallel because two consumers each
called useCurrentTime. One module-level interval with a subscriber set now
serves both, and they get the same Date rather than two a few milliseconds
apart. The hook's signature did not change.

The Lighthouse budgets accepted almost any regression — performance was a
warning at 0.70 — and only ran the desktop preset while Playwright already
tested mobile. Both routes are collected now, mobile by default and desktop
via LH_PRESET, and every threshold is an error set just below the worst score
actually measured: 0.93 / 0.98 / 0.98 / 0.98 against measured 0.96 / 1.00 /
1.00 / 1.00.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: GPT-6.2-sol <noreply@openai.com>
@devRMA devRMA self-assigned this Nov 20, 2026
@devRMA
devRMA merged commit 00cc57e into main Nov 20, 2026
4 of 6 checks passed
@devRMA
devRMA deleted the fix/standards branch November 20, 2026 20:29
devRMA added a commit that referenced this pull request Nov 20, 2026
Co-Authored-By: GPT-6.2-sol <noreply@openai.com>

This branch was successfully deployed

1 active deployment
Preview — aec53021 Deployed Nov 20, 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.

2 participants