Skip to content

feat(templates): gallery IA — category chips + Interactive/Databases sections#124

Merged
eliotlim merged 4 commits into
mainfrom
feat/template-gallery-ia
Jul 11, 2026
Merged

feat(templates): gallery IA — category chips + Interactive/Databases sections#124
eliotlim merged 4 commits into
mainfrom
feat/template-gallery-ia

Conversation

@eliotlim

Copy link
Copy Markdown
Owner

Problem

The template gallery gave zero signal about what each template demonstrates before you inserted it. Every card sat in one flat, uncategorised grid — a document that's secretly a live slide deck looked identical to a plain database, so the only way to find out was to create the page and poke around. Nothing told the reader "this one is interactive", "this one presents as slides", or "this one is a database".

Epic: Templates that showcase OpenBook — interactive + slides (IA 2026-07). Closes TPL-1, TPL-2, TPL-10.

Solution

  • Add tags: TemplateTag[] ('interactive' | 'slides' | 'database') to PageTemplate in packages/sdk/src/templates.ts.
  • Render a row of category chips (Interactive / Slides / Database) on each gallery card.
  • Group cards into "Interactive documents" and "Databases" sections, inside a scrollport, so the gallery reads as a shaped menu rather than a wall.
  • Fix project-intake's tags: it is authored as a 4-slide present deck (top-level dividers + notes), so splitSlides() renders it as a real deck — it now correctly carries both interactive and slides (was interactive only).
  • Housekeeping: reword two stale "five showcases / two fixtures" copies to the canonical three block-doc showcases / four database fixtures; add the missing map command-palette keyword for field-map; make the scrollport padding symmetric (-m-1 p-1) so top/bottom focus rings clear on short viewports.

No new dependencies.

Before / After

Behaviour Before After
Template gallery: signal about what each card demonstrates
Flat, uncategorised grid — no chips, no sections. A live slide deck looks the same as a database.

Two sections ("Interactive documents" / "Databases") with category chips on every card. Project intake now shows both Interactive + Slides.
project-intake classification Tagged interactive only, despite being a 4-slide deck Tagged interactive + slides (matches splitSlides())
Command palette keyword coverage 6 of 7 templates had a keyword (field-map omitted) All 7 covered (map added)

Test procedure

  • pnpm verifygreen (exit 0): build:libs; typecheck all packages; lint all packages; unit tests sdk 171 / ui 950 / server 645; e2e MCP suite 40/40 checks.
  • packages/ui/src/lib/__tests__/templates.test.ts15/15 passing (incl. the reworded "three showcases / four fixtures" case).
  • The gallery @visual snapshot (templates.spec.ts) changes intentionally — cards now carry chips and sit under section headers. The Chromatic baseline will need accepting.

Operational notes

  • No migrations, no env changes — templates are instantiated client-side through the normal data APIs.
  • Deferred (Devon nit, owner's call): the lone "Database" chip is redundant under the "Databases" header. It could later be suppressed there, or replaced with view-shape tags (Board / Gallery / Timeline / Map) that actually add signal. Left as-is for now.

pnpm verify green · gates cleared: code review ✓ (Quinn), design review ✓ (Devon, after the intake-slides fix).

🤖 Generated with Claude Code

https://claude.ai/code/session_01KFk2T9k3p7ghCjdzMfkA5w

eliotlim and others added 4 commits July 11, 2026 21:53
Add a `tags` field (`interactive`/`slides`/`database`) to PageTemplate,
classify the 7 built-in templates, and render them as chips on each
gallery card so the reader knows what a template demonstrates before
inserting it. Also correct the stale "five showcases" doc comment (there
are three block-doc artifacts and four databases).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KFk2T9k3p7ghCjdzMfkA5w
…abases

Split the flat card grid into tag-derived sections with headers, and let
the dialog body scroll so the sections fit on smaller viewports. Card DOM
order is preserved, so keyboard navigation still flows across every card.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KFk2T9k3p7ghCjdzMfkA5w
The template-gallery command searched for a "meeting planner" template
that doesn't exist. Point the palette keywords at the real block-doc
templates instead (grocery, savings, intake).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KFk2T9k3p7ghCjdzMfkA5w
- project-intake is authored as a 4-slide present deck (top-level dividers
  + notes), so splitSlides() renders it as a real deck. Add the missing
  `slides` tag so the gallery surfaces the Slides chip.
- Reword two stale "five showcases / two fixtures" copies to match the
  TPL-1 canonical wording (three block-doc showcases / four database
  fixtures): e2e header comment + unit-test description.
- Add the missing `map` keyword for field-map in the command palette.
- Make the gallery scrollport padding symmetric (-m-1 p-1) so top/bottom
  cards' focus rings clear on short viewports.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KFk2T9k3p7ghCjdzMfkA5w
@vercel

vercel Bot commented Jul 11, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
app.book.pub Ready Ready Preview, Comment Jul 11, 2026 2:36pm

Request Review

@eliotlim eliotlim merged commit aadecea into main Jul 11, 2026
10 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