DDD-004: Implement home page post-index block (#20)#21
Merged
Conversation
Defines the complete design contract for the home page post index: reverse-chronological post list with type badge, title, description, date, and tags per entry. All tokens map to existing CSS custom properties. Status: Proposal. Resolves #5 Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Ben Peter <bp@ben-peter.com>
Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Ben Peter <bp@ben-peter.com>
Create post-index EDS block that fetches /query-index.json and renders a reverse-chronological post list on the home page. Includes helix-query.yaml for content indexing, auto-block wiring in scripts.js, .sr-only utility, and documentation updates. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Ben Peter <bp@ben-peter.com>
Prevent double-multiplication of millisecond timestamps by adding num < 1e10 guard. Add console.warn for empty results and clarifying comments per code review. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Ben Peter <bp@ben-peter.com>
Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Ben Peter <bp@ben-peter.com>
|
Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
|
Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Ben Peter <bp@ben-peter.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Nefario Report: Implement DDD-004 Home Post Index
Summary
Built the
post-indexEDS block that fetches/query-index.jsonand renders a reverse-chronological post list on the home page. Createdhelix-query.yamlfor content indexing,blocks/post-index/post-index.cssandpost-index.jsfor the block, auto-block wiring inscripts.js,.sr-onlyutility class instyles.css, and documentation updates tocontent-model.mdand DDD-004 status.Original Prompt
Implement DDD-004: Build post-index block for the home page (#20). Create helix-query.yaml, post-index block (CSS + JS), auto-block wiring in scripts.js, .sr-only utility, and documentation updates per the design contract in docs/design-decisions/DDD-004-home-post-index.md.
Key Design Decisions
parseDate boundary guard (num < 1e10)
The original implementation used
num > 0to detect Unix timestamps, which would incorrectly double-multiply millisecond timestamps (producing dates in year ~57,000). Code review caught this — addednum < 1e10to distinguish 10-digit second timestamps from 13-digit millisecond timestamps. Excel serial number handling was intentionally omitted (indistinguishable from Unix timestamps per margo ADVISE)..sr-only in styles.css (eager) not lazy-styles.css
Frontend-minion recommended lazy-styles.css. Accessibility-minion recommended styles.css. Resolution: styles.css wins — zero rendering cost, prevents FOUC if any future eager-loaded block needs it, eliminates timing dependency. Implementation uses modern
clip-path: inset(50%)instead of deprecatedclip: rect(0,0,0,0)per stylelint.Path validation for open redirect prevention
Security advisory:
entry.path.startsWith('/')guard added to prevent open redirect if query-index.json is poisoned with external URLs. Low-probability risk for a static site, but zero-cost defensive measure.Tag links render as 404s until DDD-007
Tags are rendered as links (
/tags/{slug}) from day one even though tag pages don't exist yet. Accepted trade-off: the 404 page has a "Go home" link, and retroactively adding links after DDD-007 would require a code change.Phases
Agent Contributions
Planning (Phase 2)
Review (Phase 3.5)
Code Review (Phase 5)
Execution
Task 1: Create helix-query.yaml + .sr-only utility class
helix-query.yaml(new, +25 lines),styles/styles.css(modified, +13 lines)clip-path: inset(50%)(modern) instead ofclip: rect(0,0,0,0)(deprecated) per stylelintTask 2: Create post-index block (CSS + JS)
blocks/post-index/post-index.css(new, +101 lines),blocks/post-index/post-index.js(new, +206 lines)Task 3: Wire auto-block in scripts.js + test content
scripts/scripts.js(modified, +14 lines),drafts/(4 HTML files + query-index.json mock)drafts/added to .gitignore; mock includes edge-case entry with missing fieldsTask 4: Update content model docs + DDD-004 status
docs/content-model.md(modified, +23 lines),docs/design-decisions/DDD-004-home-post-index.md(modified)Verification
Code review passed (1 BLOCK finding auto-fixed: parseDate boundary guard). Lint passes clean (ESLint + Stylelint). No unit test infrastructure. Documentation handled in execution.
Test Plan
npx -y @adobe/aem-cli up --no-open --forward-browser-logs --html-folder draftshttp://localhost:3000/renders post-index block with 3 test entries in reverse-chronological order/tags/{slug}https://nefario-ddd-004-home-post-index--grounded--benpeter.aem.page/Session Resources
Skills Invoked
/nefario— orchestrationCompaction
2 compaction events (Phase 3 and Phase 3.5 checkpoints).
Working Files
Companion directory:
docs/history/nefario-reports/2026-03-13-155422-implement-ddd-004-home-post-index/Resolves #20
Test URLs: