Requirements, execution plan, functional design, code summaries, build and test results and the audit log; the reverse-engineering notes and the feature registry are updated. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
5.3 KiB
5.3 KiB
Code Generation Plan: section-heading (unit 1)
This plan is the single source of truth for Code Generation of this unit. Application code goes in web/ of the worktree K:\Development\SlpSoftware\Projects\AndreaSlopFotografie-testimonials-redesign; only the summary (Step 6) goes under aidlc-docs/.
Unit context
- Goal:
SectionHeadingshows its title in uppercase with wide letter-spacing, as in the approved canvas (FR-TR-05). It applies to all eight places that useSectionHeading(AboutBlock,ContactSection,IntroGallery,Pricing,Testimonials,InstagramGrid,AboutIntro,ShootPage) without changing those callers. - Dependencies: none. Unit 2 (testimonials) comes after it and uses the same heading.
- Stories: none (User Stories skipped). Traceability is to requirements: FR-TR-05, assumptions A1 and A2, NFR-TR-01.
- Functional Design: skipped for this unit (a style change without logic). PBT-01 is N/A: there is no logic to give properties.
- Existing files to modify (brownfield, in place, no copies):
web/src/theme.ts,web/src/components/SectionHeading/SectionHeading.tsx,web/src/components/SectionHeading/SectionHeading.test.tsx. - New files: the code summary under
aidlc-docs/features/testimonials-redesign/construction/section-heading/code/.
Design of the change
| Item | Decision |
|---|---|
| New text style | sectionHeading in theme.ts: heading font, textTransform: uppercase, letterSpacing: caps (the existing token, 0.22em), line-height 1.15, size 26 px on phones (base) and 30 px from md. |
| Old text style | sectionTitle stays as it is: five other h2 elements use it directly (CallToAction, PackageBlock, ShootBlock, ShootPage twice, StoryBlocks), and they keep their style (assumption A1). Its comment is corrected, because it no longer belongs to SectionHeading. |
SectionHeading |
The Heading uses textStyle="sectionHeading". No new props, no change to alignment, spacing, eyebrow or lead. The text in the DOM does not change (the case is only CSS), so accessible names and every existing test that looks for the title text keep working. |
| Size on phones | The canvas used 26 px on the phone artboard and 30 px on desktop; FR-TR-05 only says 30 px. This plan follows the canvas: 26 px below md. Requirements are updated to say so (Step 5). |
| Wrapping | Uppercase and letter-spacing make titles wider. The longest title is "Lifestyle fotograaf met een passie voor storytelling" (52 characters, AboutBlock, maximum width 620 px). By my estimate it takes about three lines on desktop and four on a phone. That is checked in Build and Test (assumption A2); this unit does not shorten any text. |
Steps
- Step 1: Theme. In
web/src/theme.tsadd the text stylesectionHeadingnext tosectionTitleand correct the comment ofsectionTitle(no longer used bySectionHeading; still used by the five direct h2 elements). - Step 2: Component. In
web/src/components/SectionHeading/SectionHeading.tsxswitch theHeadingtotextStyle="sectionHeading"and update the component comment (design reference: uppercase, letter-spaced title). - Step 3: Unit tests. In
SectionHeading.test.tsxadd example tests (PBT-10: not a property case, there is no logic):- the h2 keeps its text exactly as given (the accessible name is not uppercased in the DOM), also for a long title;
- the generated CSS rules for the h2 contain
text-transform: uppercaseand the wide letter-spacing (usingcssRulesFor, since jsdom does not compute responsive styles); - the five direct
sectionTitleheadings do not get the new style (a render ofCallToActionorPackageBlockchecks that its h2 has notext-transform: uppercase).
- Step 4: Callers. Search the other tests and the e2e tests for assumptions about the old heading style (
sectionTitle, letter-spacing, text case); adjust only if one fails. - Step 5: Requirements note. In
requirements.mdchange FR-TR-05 to "30 px frommd, 26 px below" and mark A2 with the estimate of the longest title. - Step 6: Code summary. Write
aidlc-docs/features/testimonials-redesign/construction/section-heading/code/code-summary.md(files changed, the decision, extension compliance). - Step 7: Build and test this unit (Step 13.5). In
web/:pnpm exec tsc --noEmit(or the project's type check), lint, and the unit tests ofSectionHeadingand of every component that uses it; then the whole unit-test run (pnpm test) once. Fix failures inside this stage. The prerender build, the e2e tests and Lighthouse are part of the phase-level Build and Test. - Step 8: Progress. Update
aidlc-state.md, check the plan checkboxes and setactive-features.mdto🟢 Construction.
Extension compliance for this unit
- Security Baseline: SECURITY-04 (CSP) compliant by design: a theme text style produces a CSS class, no inline style, no new header. SECURITY-10 N/A: no dependency changes. All other rules N/A (front-end style change).
- Property-Based Testing: PBT-01..09 N/A (no logic, no pure function added). PBT-10: example tests only, because there are no properties to check; the existing property tests of other units are not touched.
Scope and size
One theme entry, one component line, three small test cases, one summary and one requirements line. No new dependencies.