Adds the Instagram section to the homepage
Shows the handle as a link to the profile and six square photos from edge to edge (2, 3 or 6 per row), each linking to the profile in a new tab. The photos are ones the page already loads, so the section adds no downloads; the API will later fill it with the real feed. Without a valid https link to Instagram the section is left out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
- **Feature Slug**: homepage-sections
|
||||
- **Project Type**: Brownfield
|
||||
- **Start Date**: 2026-10-19T19:19:38Z
|
||||
- **Current Stage**: CONSTRUCTION - Unit 5 Contact - Code Generation (awaiting approval)
|
||||
- **Current Stage**: CONSTRUCTION - Unit 6 Instagram - Code Generation Part 1 (awaiting plan approval)
|
||||
- **Branch**: feature/homepage-sections
|
||||
|
||||
## Workspace State
|
||||
@@ -66,7 +66,7 @@
|
||||
- [ ] NFR Requirements - SKIP
|
||||
- [ ] NFR Design - SKIP
|
||||
- [ ] Infrastructure Design - SKIP
|
||||
- [ ] Code Generation - EXECUTE (per unit) — Unit 1 Lifestyle fotografie ✅, Unit 2 Over mij ✅ (desktop review deferred by user), Unit 3 Prijzen ✅, Unit 4 Lieve woorden ✅
|
||||
- [ ] Code Generation - EXECUTE (per unit) — Unit 1 Lifestyle fotografie ✅, Unit 2 Over mij ✅ (desktop review deferred by user), Unit 3 Prijzen ✅, Unit 4 Lieve woorden ✅, Unit 5 Contact ✅
|
||||
- [ ] Build and Test - EXECUTE
|
||||
|
||||
### 🟡 OPERATIONS PHASE
|
||||
@@ -74,8 +74,8 @@
|
||||
|
||||
## Current Status
|
||||
- **Lifecycle Phase**: CONSTRUCTION
|
||||
- **Current Stage**: Unit 5 Contact — Code Generation complete, awaiting approval (pushed, test deploy running)
|
||||
- **Next Stage**: Unit 5 Contact — Code Generation
|
||||
- **Current Stage**: Unit 6 Instagram — Code Generation plan awaiting approval
|
||||
- **Next Stage**: Unit 6 Instagram — Code Generation Part 2, then Build and Test
|
||||
|
||||
## Reverse Engineering Status
|
||||
- [x] Reverse Engineering - Artifacts refreshed on 2026-10-19T19:19:38Z at commit 38c5c3e (approved 2026-10-19T19:31:00Z)
|
||||
|
||||
@@ -740,3 +740,111 @@ De foto mag nog iets kleiner? 75% van huidige groote maken is denk ik goed. Het
|
||||
**Context**: CONSTRUCTION - Unit 5 bug fixes (awaiting approval of unit 5)
|
||||
|
||||
---
|
||||
|
||||
## Test Deploy Result (unit 5 incl. scroll fixes)
|
||||
|
||||
**Timestamp**: 2026-10-21T02:00:00Z
|
||||
|
||||
**User Input**: (none — CI run finished)
|
||||
|
||||
**AI Response**: "CI run 556 (0b00b78, deploy_test=true) completed: check, deploy-test and lighthouse success, deploy-production skipped. The Lighthouse failure of run 555 did not recur (runner issue). test.andreaslop.nl serves the Contact section."
|
||||
|
||||
**Context**: Test environment updated with unit 5 and the scroll fixes
|
||||
|
||||
---
|
||||
|
||||
## Unit 5 Contact — Change Request: Section Heading Size
|
||||
|
||||
**Timestamp**: 2026-10-21T20:10:48Z
|
||||
|
||||
**User Input**: "ik wil verder met d eopenstaande feature in aidlc. Ik had in ieder geval al een opmerking over de <h2>-tags. Die zijn wat groot. Kunnen die een grootte krijgen wat vertaald naar 30 pixels? Ze zijn nu in iede rgeval wat te groot en nu zijn ze computed 40px"
|
||||
|
||||
**AI Response**: "Resumed homepage-sections (unit 5 awaiting approval). The section h2s use textStyle sectionTitle (1.85rem / 2.125rem / 2.5rem = 40px at xl, from the design's --fs-h2). Changed it to a flat 1.875rem (30px) at every width; mobile was already 29.6px so a single size is simplest. Applies to all SectionHeading h2s on the homepage; footer h2s (eyebrow) and h1/h3 unchanged. Design static CSS left as is."
|
||||
|
||||
**Context**: CONSTRUCTION - Unit 5 change request (typography)
|
||||
|
||||
---
|
||||
|
||||
## Unit 5 Contact — Change Request: Price Card Heading Size
|
||||
|
||||
**Timestamp**: 2026-10-21T20:21:27Z
|
||||
|
||||
**User Input**: "de maten voor de prijskaarten mogen ietsje kleiner. Ze zijn nu bijna even groot als de h2's"
|
||||
|
||||
**AI Response**: "Price card h3 (package name) reduced from 1.75rem (28px) to 1.5rem (24px). The price itself stays 2.25rem (36px), larger than the 30px h2 — asked the owner whether that should shrink too."
|
||||
|
||||
**Context**: CONSTRUCTION - Unit 5 change request (typography)
|
||||
|
||||
---
|
||||
|
||||
## Unit 5 Contact — Change Request: Testimonial Quote Size
|
||||
|
||||
**Timestamp**: 2026-10-21T20:23:58Z
|
||||
|
||||
**User Input**: "De tekst van de lieve woorden. De blockquote is een beetje groot. zou je die ook wat kleiner kunnen maken?"
|
||||
|
||||
**AI Response**: "Testimonial blockquote reduced from clamp(1.35rem, 2.2vw, 1.75rem) (21.6–28px) to clamp(1.15rem, 1.7vw, 1.375rem) (18.4–22px). The carousel placeholder renders the longest slide itself, so its height follows automatically."
|
||||
|
||||
**Context**: CONSTRUCTION - Unit 5 change request (typography)
|
||||
|
||||
---
|
||||
|
||||
## Unit 5 Contact — Approval
|
||||
|
||||
**Timestamp**: 2026-10-21T20:36:20Z
|
||||
|
||||
**User Input**: "top het werkt. okee. dan kan je nu verder met de volgende unit"
|
||||
|
||||
**AI Response**: "Unit 5 approved (incl. the review typography changes: section h2 30px, price card h3 24px, testimonial quote 18.4–22px; price amount size question left open). Moving to Unit 6 Instagram."
|
||||
|
||||
**Context**: CONSTRUCTION - Unit 5 Code Generation approved
|
||||
|
||||
---
|
||||
|
||||
## Unit 6 Instagram — Code Generation Plan
|
||||
|
||||
**Timestamp**: 2026-10-21T20:36:20Z
|
||||
|
||||
**User Input**: (none — AI-initiated)
|
||||
|
||||
**AI Response**: "Created construction/plans/instagram-code-generation-plan.md (11 steps): content type and data reusing six already-bundled photos, HomeSection width='full' for the design's full-bleed grid, InstagramGrid (handle link, list of six square tiles 2/3/6 columns, accessible names alt + hint, hover/focus with reduced motion), route renders it only with a valid https Instagram link via visibleSocials, tests, pnpm check, LAYOUT.md check, summary, commit (typography changes in a separate commit first). Prompt: approve plan or request changes."
|
||||
|
||||
**Context**: CONSTRUCTION - Unit 6 Code Generation Part 1 (awaiting plan approval)
|
||||
|
||||
---
|
||||
|
||||
## Unit 6 Instagram — Plan Approval
|
||||
|
||||
**Timestamp**: 2026-10-21T20:40:08Z
|
||||
|
||||
**User Input**: "approve plan"
|
||||
|
||||
**AI Response**: "Plan approved. Starting Code Generation Part 2 (commit at the end, not pushed)."
|
||||
|
||||
**Context**: CONSTRUCTION - Unit 6 Code Generation Part 2 (start)
|
||||
|
||||
---
|
||||
|
||||
## Unit 6 Instagram — Code Generation (Lighthouse gate pending)
|
||||
|
||||
**Timestamp**: 2026-10-21T21:01:47Z
|
||||
|
||||
**User Input**: (none — AI-initiated)
|
||||
|
||||
**AI Response**: "Steps 1–7, 9, 10 done. pnpm check: lint, format, 244 tests, build, audits green; Lighthouse home mobile 0.73 (budget 0.8), /contact 0.84 in the first run. Benchmark index was halved (1889 vs ~4200). A/B with the unit 5 build (git stash of web/, 3 runs each): both 0.68–0.84, TBT 190–600 ms, no difference; machine under load (game and a Vite dev server). Visual check in headless Chrome: 6/3/2 columns, full-bleed, h2 30px, no extra image requests. Not committed; asked the owner whether to rerun the gate on a quiet machine first."
|
||||
|
||||
**Context**: CONSTRUCTION - Unit 6 Code Generation, Step 8 Lighthouse pending
|
||||
|
||||
---
|
||||
|
||||
## Unit 6 Instagram — Lighthouse Rerun
|
||||
|
||||
**Timestamp**: 2026-10-21T22:26:33Z
|
||||
|
||||
**User Input**: "ik heb rocket league afgesloten. Ik zie in de browser bij performance ook ineens maar een score van 44 en 51 op desktop. De rest is in beide gevallen 100. Op mobiel is dat 35 en 33 terwijl de andere onderdelen 100 zijn."
|
||||
|
||||
**AI Response**: "The browser scores come from the Vite dev server (port 5173): measured it at desktop 0.55 / mobile 0.36 with 137 unbundled requests, so not representative. Rebuilt and reran pnpm lighthouse on the production build: passed — home mobile 0.81 (TBT 230 ms), desktop 1.0, other pages 0.93–0.94 / 1.0, a11y/BP/SEO 1.0. Step 8 ticked; committing as in the approved plan (Step 11), not pushed."
|
||||
|
||||
**Context**: CONSTRUCTION - Unit 6 Code Generation, Step 8 complete
|
||||
|
||||
---
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
# Code Summary — Unit 6: Instagram
|
||||
|
||||
Plan: [instagram-code-generation-plan.md](../../plans/instagram-code-generation-plan.md)
|
||||
|
||||
## Files
|
||||
|
||||
| File | Change |
|
||||
|---|---|
|
||||
| `web/src/content/types.ts` | `HomeContent.instagram: { title; handle; photos: ContentImage[] }` |
|
||||
| `web/src/content/homeContent.ts` | Intro photos moved to a shared `introPhotos` constant; `instagram` content reuses them plus the two review photos (`testimonials`), so one photo keeps one alt text and the section adds no image downloads |
|
||||
| `web/src/components/HomeSection/HomeSection.tsx` + test | `width="full"`: no `Container`, for edge-to-edge content |
|
||||
| `web/src/components/SectionHeading/SectionHeading.tsx` | `lead` accepts a `ReactNode` (the handle link) |
|
||||
| `web/src/components/home/InstagramGrid/InstagramGrid.tsx` + test | New section: centred heading with the handle as external link, full-bleed list of square tiles (2 / 3 from `md` / 6 from `xl`, 2px gap), each an external link named by the photo's alt plus "(Instagram, opent in nieuw tabblad)"; hover and keyboard focus zoom 1.06 and fade to 85%, fade only under reduced motion; focused tile lifted above its neighbours so the ring is not covered |
|
||||
| `web/src/routes/index.tsx` | Renders `InstagramGrid` last, only when `visibleSocials` yields an Instagram link (https) |
|
||||
| `web/src/app.test.tsx` | Instagram added to the page-order check; section absent when the link is missing or not https (`siteContent.socials` overridable through a hoisted mock) |
|
||||
|
||||
`LAYOUT.md` already lists Instagram as the last homepage block: unchanged.
|
||||
|
||||
## Verification
|
||||
|
||||
- Lint, Prettier, typecheck/build, dependency audit: ✅
|
||||
- Tests: 244 passed (53 files); new: 3 InstagramGrid, 1 HomeSection, 3 app (order + two absent cases)
|
||||
- Visual (headless Chrome, preview build): 6 columns at 1440px, 3 at 1024px, 2 at 390px; grid as wide as the viewport; h2 30px; the page requests the same 15 images as before (no new ones)
|
||||
- Lighthouse (`pnpm lighthouse`, production build): ✅ homepage mobile 0.81 (TBT 230 ms, LCP 3.8 s), desktop 1.0; other pages mobile 0.93–0.94, desktop 1.0; accessibility, best practices and SEO 1.0 everywhere.
|
||||
- A first run failed (home mobile 0.73, /contact 0.84) while the machine was under load (a game and a Vite dev server). Back-to-back runs of the unit 5 build and this build both scattered between 0.68 and 0.84, with no difference between them; with the game closed the gate passed. Scores measured in the browser against the Vite dev server (desktop 0.55, mobile 0.36, 137 unbundled requests) say nothing about the production site.
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
# Code Generation Plan — Unit 6: Instagram
|
||||
|
||||
**This plan is the single source of truth for Code Generation of unit 6.**
|
||||
|
||||
## Unit context
|
||||
- **Requirements**: FR-HP-10, FR-HP-11 (reveal, reused), FR-HP-12, NFR-HP-01/02/03/05/06; security NFR on external links
|
||||
- **Design**: [unit-of-work.md](../../inception/application-design/unit-of-work.md) unit 6; [component-methods.md](../../inception/application-design/component-methods.md) (`HomeContent.instagram`, `InstagramGrid` props); design reference `design/andreaslop-static/index.html` (Instagram section: `.section--tight`, centred `.section__head`, handle as `.lead` with `.link-underline`) and `style.css` §17 (`.instagram__grid`, `.instagram__tile`) plus the 1100px (3 columns) and 680px (2 columns) breakpoints
|
||||
- **Depends on**: unit 1 (`HomeSection` incl. `spacing="tight"`, `SectionHeading`, `Reveal`, `DeferredImage`), unit 2 (`underline` link variant), the existing `visibleSocials` helper (BR-SOC-01) and the footer's external-link pattern
|
||||
- **Functional Design**: skipped (presentational). **PBT-01**: N/A, no new business logic; picking the Instagram link reuses `visibleSocials`, which already has tests. Example-based tests (PBT-10).
|
||||
- Conventions as in the earlier units: English comments and test names, Dutch visitor text, `data-testid`, theme tokens, deferred images.
|
||||
|
||||
## Decisions taken in this plan
|
||||
- **Full-bleed grid**: in the design the tile grid sits outside `.container` and runs from edge to edge, while the heading stays in the content column. `HomeSection` gets a `width="full"` option (no `Container`), and `InstagramGrid` puts its heading in its own `Container`.
|
||||
- **Images, no new files**: the six tiles reuse photos that the homepage already bundles and loads (`intro-1` to `intro-4`, `review-newbornshoot`, `review-trouwshoot`). The browser fetches them only once, so the section adds no image bytes. They show as squares (`object-fit: cover`). Andrea can replace them later, and the API feature replaces them with the real feed.
|
||||
- **Accessible names**: each tile is a link to the profile. Its name is the photo's alt text plus a hidden "(Instagram, opent in nieuw tabblad)". Six links with the same name "Instagramfoto", as in the design, would tell a screen reader user nothing.
|
||||
- **Hidden without a valid link**: the route picks the Instagram entry from `visibleSocials(siteContent.socials)`. Without one, the section is not rendered at all, because the handle and every tile would have nowhere to link to.
|
||||
- **Hover**: as in the design, the photo scales to 1.06 and drops to 85% opacity on hover and on keyboard focus. Under reduced motion it changes opacity only, without scaling. Focus gets the theme's visible focus ring.
|
||||
|
||||
## Steps
|
||||
|
||||
### Content
|
||||
- [x] **Step 1** — `content/types.ts`: extend `HomeContent` with `instagram: { title: string; handle: string; photos: ContentImage[] }`.
|
||||
- [x] **Step 2** — `content/homeContent.ts`: title "Instagram", handle "@andreaslopfotografie", the six reused photos with their existing alt texts (shared constants where the intro gallery already defines them, so the texts do not drift apart).
|
||||
|
||||
### Shared pieces
|
||||
- [x] **Step 3** — `HomeSection`: `width` gains `'full'` (children rendered without `Container`). Test for the full-width variant.
|
||||
|
||||
### The section
|
||||
- [x] **Step 4** — `components/home/InstagramGrid/InstagramGrid.tsx`: `HomeSection` with `spacing="tight"`, `width="full"`; a `Container` with a `Reveal` around the centred `SectionHeading` (h2 "Instagram") and below it the handle as a `lead`-sized external link (`underline` variant, `target="_blank"`, `rel="noopener noreferrer"`, hidden "(opent in nieuw tabblad)"), `data-testid="instagram-handle-link"`. Below it a `Reveal` with the grid: plain `ul`/`li` (a list of six), 2 columns, 3 from `md`, 6 from `xl` (the design's 680/1100px steps mapped onto the theme breakpoints), 2px gap; each tile is an external link (`data-testid="instagram-tile-{n}"`) with a square `DeferredImage` on a `paper.deep` background, hover and focus as decided above.
|
||||
- [x] **Step 5** — `components/home/InstagramGrid/InstagramGrid.test.tsx`: region named by the h2; handle link with href, `target`, `rel` and the hidden hint; six tiles, each linking to the profile with `target`/`rel` and a name made of the alt text plus the hint; zero photos still renders heading and handle; axe clean.
|
||||
- [x] **Step 6** — `routes/index.tsx`: find the Instagram link in `visibleSocials(siteContent.socials)` and render `InstagramGrid` after `ContactSection` only when it exists.
|
||||
- [x] **Step 7** — `app.test.tsx`: add "Instagram" (named by its h2) as the last section in the page-order check; a test that the section is absent when there is no valid Instagram link (mocked `siteContent`, as the earlier unit tests do for the contact form).
|
||||
|
||||
### Verification and wrap-up
|
||||
- [x] **Step 8** — `pnpm check` (incl. Lighthouse); fix and rerun until green. Visual check at desktop width (6 columns, full-bleed), at 1024px (3 columns) and at an emulated 390px phone (2 columns); confirm in the network panel that no extra image requests appear.
|
||||
- [x] **Step 9** — `LAYOUT.md`: check the homepage diagram against the finished section order (following `.ai/layout-conventions.md`), update it only if it differs.
|
||||
- [x] **Step 10** — `construction/instagram/code/code-summary.md`.
|
||||
- [ ] **Step 11** — Commit on `feature/homepage-sections` ("Adds the Instagram section to the homepage" + attribution), together with the typography changes from the unit 5 review in a separate commit before it. Not pushed unless the owner asks.
|
||||
|
||||
## Requirement traceability
|
||||
| Requirement | Steps |
|
||||
|---|---|
|
||||
| FR-HP-10 | 1, 2, 4–7 |
|
||||
| FR-HP-11 | 4 |
|
||||
| FR-HP-12 | 2 |
|
||||
| NFR-HP-01 (accessibility) | 4, 5, 8 |
|
||||
| NFR-HP-02 (design fidelity) | 3, 4, 8 |
|
||||
| NFR-HP-03 (tests) | 3, 5, 7, 8 |
|
||||
| NFR-HP-05 (performance) | 2, 4, 8 |
|
||||
| NFR-HP-06 (API-ready content) | 1, 2 |
|
||||
| External links (security NFR) | 4–6 |
|
||||
|
||||
## Extension compliance (planned)
|
||||
- **Security**: no new dependencies or external resources (no embed, no third-party script, no request to Instagram); external links use `noopener noreferrer`; only `https:` links are rendered (BR-SOC-01 via `visibleSocials`). Other rules N/A.
|
||||
- **PBT**: PBT-01 N/A (no new logic); PBT-10 example-based tests present.
|
||||
|
||||
### Note on Step 8
|
||||
- Everything except the Lighthouse performance gate is green. The homepage mobile score scattered between 0.68 and 0.84 for both the unit 5 build and this build in back-to-back runs (machine under load), so the gate was rerun on a quiet machine: passed (home mobile 0.81, desktop 1.0).
|
||||
Reference in New Issue
Block a user