Skip to content

W2: Editorial layer + Svelte islands + 3 issues ported#8

Merged
sunilp merged 33 commits into
masterfrom
astro-redesign-w2
May 13, 2026
Merged

W2: Editorial layer + Svelte islands + 3 issues ported#8
sunilp merged 33 commits into
masterfrom
astro-redesign-w2

Conversation

@sunilp
Copy link
Copy Markdown
Owner

@sunilp sunilp commented May 13, 2026

Summary

Week 2 of the mkdocs → Astro 5 migration. Builds on W1 (PR #7) which scaffolded the site + new homepage + manifesto. This PR:

  • Ports the 3 existing editorial issues to MDX: FN-001 (multi-agent papers), FN-002 (eval rubric failure buckets), R-001 (Strands on AgentCore Runtime). Each now uses Content Collections with typed Zod frontmatter and renders via dedicated layouts.
  • Builds FieldNoteLayout and RecipeLayout: magazine treatment for Field Notes (banner + dek + body + sources + 3-col footer + auto cross-link "Cited by"), verified-stamp treatment for Recipes (versions + prerequisites + run-it CTA + 6 inline Callout blocks + Shiki-highlighted code).
  • Ships 4 Svelte 5 islands using runes API ($state, $props, $derived, $effect): TraceViewer, EvalRubric, ArchitectureToggle, TraceReplay.
  • Wires TraceReplay into the homepage with 3 pre-recorded agent sessions stored as static JSON in public/trace-replay/. Chip picker UI → loads selected session → replays response token-by-token with brick-red blinking cursor and final cost display. No live agent invocation, no proxy server, zero runtime cost.
  • Adds magazine grid indexes at /field-notes/ and /recipes/ with cadence pills, sorted by date desc.
  • Dynamic WhatsNewStrip: replaces W1's hard-coded 3 cards with Content Collection loading (top 3 by date across fieldNotes + recipes + labs).
  • Pagefind integration: post-build static search index (1176 words indexed across 7 pages). CLI UI deferred to W3.
  • Cross-links reverse-index wired into FieldNoteLayout: "Cited by" section renders automatically as W3+ content references W2 issues.
  • Ports banner + illustration + logo + OG default assets from docs/assets/ to public/assets/.

What's NOT in this PR (intentional)

  • mkdocs docs/, mkdocs.yml, and .github/workflows/deploy.yml are untouched. Live site continues to serve via mkdocs.
  • 4 evidence pages, 7 projects, the first Lab Report — all W3.
  • 13 chapters + 5 Foundations — W4.
  • Cmd+K Pagefind command palette UI — W3.
  • Live agent invocation. TraceReplay is pre-recorded; live agent path documented in spec but deferred.

Test Plan

  • pnpm install && pnpm test — expect 11/11 passing (3 new content-helpers + 8 existing)
  • pnpm astro check — expect 0 errors, 0 warnings
  • pnpm build — expect 7 pages built + 5 redirect stubs + Pagefind index in dist/pagefind/
  • pnpm dev and visit:
    • http://localhost:4321/agentic-ai/ — homepage, dynamic WhatsNewStrip shows FN-001, FN-002, R-001 cards, TraceReplay band at bottom with 3 chips
    • Click a TraceReplay chip — response streams in token-by-token, brick-red cursor blinks, cost displays when done
    • http://localhost:4321/agentic-ai/field-notes/ — magazine grid with both FN cards
    • /field-notes/001-multi-agent-papers-nobody-cites/ — full FN: banner with parallax, meta strip, kinetic heading, italic dek, body with pullquote + figures, sources list, 3-col footer
    • /field-notes/002-eval-rubric-failure-buckets/ — full FN with same anatomy
    • /recipes/ — magazine grid with R-001 card
    • /recipes/001-strands-on-agentcore-runtime/ — full Recipe: verified stamp, prerequisites with brick-red bullets, dark "Run it locally" CTA, Shiki-highlighted code blocks, Callout boxes (5 gotchas + 1 tip + 1 warning)
  • DevTools emulate prefers-reduced-motion: reduce — confirm banner parallax stops, hero kinetic fade-in is instant, TraceReplay cursor doesn't blink
  • Firefox: confirm banner parallax falls back gracefully (no @scroll-timeline support), Houdini stamp still renders via SVG fallback
  • Click links between homepage and Field Notes/Recipes — View Transitions cross-fade smoothly
  • Lighthouse on /field-notes/001-multi-agent-papers-nobody-cites/ — expect ≥ 95 on Performance, Accessibility, SEO

Summary by CodeRabbit

  • New Features

    • Interactive trace replay with model response playback and metrics
    • Evaluative rubric scorer component for AI assessment
    • Architecture A/B comparison toggle
    • Dynamic "What's New" strip and several reusable UI components (banner, callouts, footer, prerequisites, CTA, sources, verified stamp)
  • New Content

    • Field Notes section with multiple articles
    • Recipes section with step‑by‑step guides
    • Sample trace data and manifest for demos
  • Chores

    • Build now includes site indexing
    • Added page indexing tool as a dev dependency

Review Change Stack

sunilp added 26 commits May 13, 2026 16:53
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 13, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 00b837f4-5627-42f7-b978-ff3032cab090

📥 Commits

Reviewing files that changed from the base of the PR and between 3a9c614 and 30d1b17.

📒 Files selected for processing (7)
  • src/components/islands/ArchitectureToggle.svelte
  • src/components/islands/EvalRubric.svelte
  • src/components/islands/TraceReplay.svelte
  • src/components/islands/TraceViewer.svelte
  • src/components/universal/Callout.astro
  • src/components/universal/Footer3Col.astro
  • src/layouts/FieldNoteLayout.astro
🚧 Files skipped from review as they are similar to previous changes (7)
  • src/components/islands/ArchitectureToggle.svelte
  • src/layouts/FieldNoteLayout.astro
  • src/components/universal/Callout.astro
  • src/components/islands/EvalRubric.svelte
  • src/components/universal/Footer3Col.astro
  • src/components/islands/TraceReplay.svelte
  • src/components/islands/TraceViewer.svelte

📝 Walkthrough

Walkthrough

Adds pagefind to the build, creates Astro and Svelte component libraries, implements field-notes and recipes content with layouts and routing, introduces trace-replay JSON sessions and an interactive replay island, and updates the homepage to surface dynamic content.

Changes

Content, Components, and Trace Replay

Layer / File(s) Summary
Build pipeline and pagefind integration
package.json
Build script now runs pagefind --site dist after astro build, and pagefind@^1.5.2 is added to devDependencies.
Universal Astro component library
src/components/universal/Banner.astro, src/components/universal/Callout.astro, src/components/universal/Footer3Col.astro, src/components/universal/Prerequisites.astro, src/components/universal/RunItCTA.astro, src/components/universal/Sources.astro, src/components/universal/VerifiedStamp.astro
Seven reusable components for content pages: Banner (scroll parallax), Callout (typed callouts), Footer3Col (3-column navigation), Prerequisites (bulleted lists), RunItCTA (repo links), Sources (citations), and VerifiedStamp (date/version metadata).
Interactive Svelte 5 component library
src/components/islands/ArchitectureToggle.svelte, src/components/islands/EvalRubric.svelte, src/components/islands/TraceViewer.svelte, src/components/islands/TraceReplay.svelte
Interactive islands: ArchitectureToggle (A/B comparison with animation), EvalRubric (rubric scorecard with criterion details), TraceViewer (expandable trace step viewer), and TraceReplay (manifest-driven response replay).
Content system foundation
src/lib/content-helpers.ts, src/lib/content-helpers.test.ts, src/layouts/FieldNoteLayout.astro, src/layouts/RecipeLayout.astro, src/pages/field-notes/index.astro, src/pages/field-notes/[...slug].astro, src/pages/recipes/index.astro, src/pages/recipes/[...slug].astro
Helper function for mapping Astro entries with cross-link support (plus tests), layout components for field notes and recipes with metadata/reverse-links, and dynamic/index routes for both collections with sorting and card grids.
Field notes content
src/content/fieldNotes/001-multi-agent-papers-nobody-cites.mdx, src/content/fieldNotes/002-eval-rubric-failure-buckets.mdx
Two published field notes: "Multi-agent papers nobody cites" analyzing bounded-agent failure research, and "Eval rubric failure buckets" describing bucket-based evaluation strategies.
Recipes content
src/content/recipes/001-strands-on-agentcore-runtime.mdx
Step-by-step recipe for deploying Strands agents on AWS Bedrock AgentCore Runtime, including installation, configuration, deployment, invocation, gotchas, and verification.
Trace replay infrastructure
public/trace-replay/manifest.json, public/trace-replay/should-i-use-an-agent.json, public/trace-replay/how-do-i-evaluate-an-agent.json, public/trace-replay/multi-agent-got-worse.json
Trace-replay manifest defining three selectable chips; three complete session payloads with queries, responses, token/cost metrics, and reasoning traces.
TraceReplay component and homepage integration
src/components/islands/TraceReplay.svelte, src/pages/index.astro
Interactive component that loads manifest, renders selectable chips, fetches and incrementally replays response text, displays usage metrics; integrated into homepage with client:visible.
Homepage dynamic content
src/components/homepage/WhatsNewStrip.astro
Refactored to dynamically load and display the three most recent items from fieldNotes, recipes, and labs collections, sorted by date, with empty-state messaging.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes


Possibly related PRs

  • sunilp/agentic-ai#7: Modifies the same src/components/homepage/WhatsNewStrip.astro component, transitioning from hard-coded card entries to dynamic collection-based loading.

Poem

🐰 A warren of new traces and notes,
Components in Svelte that toggle and float,
Field notes and recipes, nested with care,
Parallax banners and rubrics laid bare,
The site learns to replay what AI thinks—
All indexed, all measured, in beautiful links!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is partially related to the changeset but overly broad. It mentions 'Editorial layer + Svelte islands + 3 issues ported' which are real components of the change, but doesn't clearly convey the main purpose (Astro 5 migration Week 2 with content collections, layouts, and interactive components). Consider a more specific title like 'Week 2: Add Field Notes/Recipes content collections with layouts and Svelte islands' to better convey the primary architectural changes and scope of this migration phase.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch astro-redesign-w2

Warning

Review ran into problems

🔥 Problems

Stopped waiting for pipeline failures after 30000ms. One of your pipelines takes longer than our 30000ms fetch window to run, so review may not consider pipeline-failure results for inline comments if any failures occurred after the fetch window. Increase the timeout if you want to wait longer or run a @coderabbit review after the pipeline has finished.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

🧹 Nitpick comments (2)
src/components/islands/ArchitectureToggle.svelte (1)

22-49: ⚡ Quick win

Complete the ARIA tabs pattern (or remove tab roles).

This uses tablist/tab roles but misses associated tabpanel wiring and roving focus semantics, which can cause inconsistent keyboard and screen-reader behavior.

Proposed accessibility-focused adjustment
 <figure class="arch-toggle">
   <div class="arch-toggle__tabs" role="tablist" aria-label="Architecture comparison">
     <button
+      id="arch-tab-a"
+      type="button"
       role="tab"
+      tabindex={active === 'a' ? 0 : -1}
+      aria-controls="arch-panel"
       aria-selected={active === 'a'}
       class="arch-toggle__tab"
       class:arch-toggle__tab--active={active === 'a'}
       onclick={() => (active = 'a')}
     >
       {a.label}
     </button>
     <button
+      id="arch-tab-b"
+      type="button"
       role="tab"
+      tabindex={active === 'b' ? 0 : -1}
+      aria-controls="arch-panel"
       aria-selected={active === 'b'}
       class="arch-toggle__tab"
       class:arch-toggle__tab--active={active === 'b'}
       onclick={() => (active = 'b')}
     >
       {b.label}
     </button>
   </div>
-  <div class="arch-toggle__viewport">
+  <div
+    id="arch-panel"
+    role="tabpanel"
+    aria-labelledby={active === 'a' ? 'arch-tab-a' : 'arch-tab-b'}
+    class="arch-toggle__viewport"
+  >
     {`#key` active}
       <img class="arch-toggle__img" src={current.src} alt={current.alt} />
     {/key}
   </div>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/islands/ArchitectureToggle.svelte` around lines 22 - 49, The
component currently uses role="tablist" and role="tab" without tabpanel linkage
or keyboard roving — either implement the full ARIA Tabs pattern or remove the
tab roles: add unique ids to each tab button (e.g., the two buttons where
onclick sets active), add a corresponding container for the image/figcaption
with role="tabpanel" and aria-labelledby pointing to the active tab's id (use
the existing current variable to render the panel), ensure tab buttons manage
focus/keyboard (ArrowLeft/ArrowRight/Home/End) and update aria-selected and
tabindex (0 for active, -1 for others) when active changes, or alternatively
remove role="tablist" and role="tab" attributes to avoid exposing a broken tabs
pattern.
src/pages/recipes/index.astro (1)

33-36: ⚡ Quick win

Use import.meta.env.BASE_URL for dynamic path construction instead of hard-coded /agentic-ai prefix.

Lines 33 and 35 will break if the base config in astro.config.mjs changes. Replace with:

  • href={${import.meta.env.BASE_URL}recipes/${e.id}/}
  • src={${import.meta.env.BASE_URL}assets/banners/${e.data.id}.png}

This removes the coupling and makes the component portable across environments.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/pages/recipes/index.astro` around lines 33 - 36, The links and image
paths in the recipes listing use a hard-coded "/agentic-ai" prefix which will
break if astro.config.mjs base changes; update the href and src construction for
the anchor and img in src/pages/recipes/index.astro (the anchor using e.id and
the img using e.data.id and alt using e.data.title) to prepend
import.meta.env.BASE_URL instead of "/agentic-ai" so the paths become base-aware
and portable across environments.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/islands/ArchitectureToggle.svelte`:
- Around line 23-24: The tab buttons in ArchitectureToggle.svelte are missing an
explicit type and may act as form submit buttons; update both button elements
(the ones with role="tab" around the toggles) to include type="button" so they
do not trigger form submission—locate the two <button role="tab"> elements (the
one near the first toggle and the one around line ~32) and add type="button" to
each.

In `@src/components/islands/EvalRubric.svelte`:
- Line 56: The width calculation for the score bar in EvalRubric.svelte uses
(dim.score / dim.maxScore) * 100 and can produce Infinity/NaN when dim.maxScore
is 0 or negative; update the logic that renders the eval-rubric__bar-fill style
so it first checks dim.maxScore > 0, computes percentage = clamp((dim.score /
dim.maxScore) * 100, 0, 100) when valid, and falls back to 0% when dim.maxScore
is <= 0 (also ensure dim.score is coerced to a number before division).

In `@src/components/islands/TraceReplay.svelte`:
- Line 29: The code currently ignores a custom manifestUrl by building session
fetch paths against a hardcoded "/agentic-ai/trace-replay/" base; update the
session URL construction to resolve relative to the manifestUrl prop instead
(use the manifestUrl value passed into TraceReplay.svelte). Locate where session
fetches are built (references to manifestUrl and the session base path string or
the function that fetches sessions) and replace concatenation with a proper URL
resolution such as new URL(sessionPath, manifestUrl).toString() so all session
URLs are derived from the provided manifestUrl rather than the hardcoded path.

In `@src/components/islands/TraceViewer.svelte`:
- Line 8: The component expects loadedTrace.steps but incoming JSON uses trace;
update TraceViewer.svelte to normalize both shapes before rendering by mapping
either loadedTrace.trace or loadedTrace.steps into a single canonical array
(e.g., normalizedSteps) used throughout the component (references: loadedTrace,
steps, any iteration on loadedTrace.steps); perform this normalization as soon
as the prop is received or in onMount (or a helper function like normalizeTrace)
so all uses (including the loop around line 66 and code at 22-29) read from the
canonical normalizedSteps array instead of loadedTrace.steps.

In `@src/components/universal/Callout.astro`:
- Around line 10-21: The Callout component assumes Astro.props.type is valid;
normalize and validate it before use by defining the allowed keys (gotcha, warn,
tip) and mapping incoming type to one of them, e.g. sanitize the incoming type
string and if it isn't in the set fallback to 'tip'; then compute displayLabel
using defaultLabels[normalizedType] (with a fallback) and use normalizedType for
the modifier class (`callout--${normalizedType}`) so unknown or misspelled types
won't produce undefined labels or invalid classes.

In `@src/components/universal/Footer3Col.astro`:
- Around line 37-40: The "Read next" column (the div with class footer-3col__col
that contains the label and link) is rendered even when readNext is undefined,
producing an empty column; change the template in Footer3Col.astro to render
that entire div only when readNext is truthy (i.e., wrap or gate the whole
column containing the footer-3col__label and anchor with a conditional that
checks readNext so the label and link are omitted when readNext is missing).

In `@src/layouts/FieldNoteLayout.astro`:
- Around line 59-64: The "Cited by" list currently renders plain text; wrap each
entry in a navigable anchor that links to the referenced resource using its
collection and id (the items come from links.referencedBy and links.citedBy in
FieldNoteLayout.astro). Update the map that iterates over
[...links.referencedBy, ...links.citedBy] to return an anchor element per item
(instead of plain text) with accessible link text showing collection/id and an
href constructed from the item's collection and id so users can click through to
the citing content.

---

Nitpick comments:
In `@src/components/islands/ArchitectureToggle.svelte`:
- Around line 22-49: The component currently uses role="tablist" and role="tab"
without tabpanel linkage or keyboard roving — either implement the full ARIA
Tabs pattern or remove the tab roles: add unique ids to each tab button (e.g.,
the two buttons where onclick sets active), add a corresponding container for
the image/figcaption with role="tabpanel" and aria-labelledby pointing to the
active tab's id (use the existing current variable to render the panel), ensure
tab buttons manage focus/keyboard (ArrowLeft/ArrowRight/Home/End) and update
aria-selected and tabindex (0 for active, -1 for others) when active changes, or
alternatively remove role="tablist" and role="tab" attributes to avoid exposing
a broken tabs pattern.

In `@src/pages/recipes/index.astro`:
- Around line 33-36: The links and image paths in the recipes listing use a
hard-coded "/agentic-ai" prefix which will break if astro.config.mjs base
changes; update the href and src construction for the anchor and img in
src/pages/recipes/index.astro (the anchor using e.id and the img using e.data.id
and alt using e.data.title) to prepend import.meta.env.BASE_URL instead of
"/agentic-ai" so the paths become base-aware and portable across environments.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4dd23cfb-f787-4c6c-806a-1b40f6e98f4c

📥 Commits

Reviewing files that changed from the base of the PR and between eb36318 and 3a9c614.

⛔ Files ignored due to path filters (9)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • public/assets/banners/fn-001.png is excluded by !**/*.png
  • public/assets/banners/fn-002.png is excluded by !**/*.png
  • public/assets/banners/r-001.png is excluded by !**/*.png
  • public/assets/illustrations/fn-001.png is excluded by !**/*.png
  • public/assets/illustrations/fn-002.png is excluded by !**/*.png
  • public/assets/illustrations/r-001.png is excluded by !**/*.png
  • public/assets/images/logo.svg is excluded by !**/*.svg
  • public/og-default.png is excluded by !**/*.png
📒 Files selected for processing (29)
  • package.json
  • public/trace-replay/how-do-i-evaluate-an-agent.json
  • public/trace-replay/manifest.json
  • public/trace-replay/multi-agent-got-worse.json
  • public/trace-replay/should-i-use-an-agent.json
  • src/components/homepage/WhatsNewStrip.astro
  • src/components/islands/ArchitectureToggle.svelte
  • src/components/islands/EvalRubric.svelte
  • src/components/islands/TraceReplay.svelte
  • src/components/islands/TraceViewer.svelte
  • src/components/universal/Banner.astro
  • src/components/universal/Callout.astro
  • src/components/universal/Footer3Col.astro
  • src/components/universal/Prerequisites.astro
  • src/components/universal/RunItCTA.astro
  • src/components/universal/Sources.astro
  • src/components/universal/VerifiedStamp.astro
  • src/content/fieldNotes/001-multi-agent-papers-nobody-cites.mdx
  • src/content/fieldNotes/002-eval-rubric-failure-buckets.mdx
  • src/content/recipes/001-strands-on-agentcore-runtime.mdx
  • src/layouts/FieldNoteLayout.astro
  • src/layouts/RecipeLayout.astro
  • src/lib/content-helpers.test.ts
  • src/lib/content-helpers.ts
  • src/pages/field-notes/[...slug].astro
  • src/pages/field-notes/index.astro
  • src/pages/index.astro
  • src/pages/recipes/[...slug].astro
  • src/pages/recipes/index.astro

Comment thread src/components/islands/ArchitectureToggle.svelte
Comment thread src/components/islands/EvalRubric.svelte Outdated
Comment thread src/components/islands/TraceReplay.svelte
Comment thread src/components/islands/TraceViewer.svelte
Comment thread src/components/universal/Callout.astro
Comment thread src/components/universal/Footer3Col.astro Outdated
Comment thread src/layouts/FieldNoteLayout.astro
@sunilp sunilp merged commit d10f304 into master May 13, 2026
3 checks passed
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.

1 participant