Skip to content

feat(templates): guidance callouts on the DB templates + resolve cross-DB rollups everywhere (TPL-9, TPL-11)#132

Merged
eliotlim merged 3 commits into
mainfrom
feat/template-callouts-rollup-residuals
Jul 12, 2026
Merged

feat(templates): guidance callouts on the DB templates + resolve cross-DB rollups everywhere (TPL-9, TPL-11)#132
eliotlim merged 3 commits into
mainfrom
feat/template-callouts-rollup-residuals

Conversation

@eliotlim

Copy link
Copy Markdown
Owner

Problem

Two gaps this branch closes, both on the database surfaces:

(a) No consistent "what does this show / what do I try" cue. Instantiating a
template dropped the user straight into the database view (board, timeline, gallery,
map, linked DBs) with no orientation — nothing said what the template demonstrates
or what to poke at first.

(b) Cross-DB rollups resolved for display only. A rollup that folds a linked
database's values rendered correctly in the grid, but still showed (or was
unwired entirely) in CSV export, sorts, filters, search, summaries, metric cards,
and colour rules — every non-display surface fell back to the unresolved value.

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

Solution

TPL-9 — a standardized PageTemplate.guidance callout on the 5 database
templates
that lacked in-doc guidance (task-board, reading-list, roadmap,
field-map, product-hq). It renders as one consistent info callout above the
database view: what the template shows, then how to try it. The gallery swaps
in the user's locale via the same field (en/de/ja/zh). The self-guiding templates
(the decks, grocery, team-status, and the compound-growth sample copy — which opens
with its own intro paragraph) are left as-is.

TPL-11 — thread the already-fetched rollupRows / rollupProperties through
every remaining database surface via one optional-param pattern, so cross-DB rollups
resolve everywhere the display path already does. Same-DB behaviour is byte-identical
(Quinn-verified); no new fetch or subscription. No new deps.

Before / After

Behaviour Before After
A guided database template (task board) opens with a "how to use this" callout above the view
board opens cold — no orientation

info callout: "This template shows a task database… Try it:"
…same for the roadmap swimlanes template
timeline opens cold

info callout above the Gantt bands
Cross-DB rollup on a non-display surface (CSV export, sort, filter, search, summary, metric card, colour rule) renders (unresolved) resolves to the same value the grid shows

Test procedure

  • pnpm verify green — sdk 171, ui 977, server 645 unit tests; e2e 251 data-server checks + 40 MCP checks. Exit 0.
  • New unit tests: guidance-set ⇔ template-set equality (5 guided DB templates); cross-DB CSV / filter / sort / summary resolution in databaseFormula.test.ts.
  • Templates Playwright e2e: 11/11 green (incl. compound-growth as a fresh copy, reading-list gallery, product-hq linked DBs).
  • Known-flaky (unrelated): the relations rename-debounce spec occasionally retries.

Operational notes

  • No migrations, no env changes.
  • Gates: code ✅ Quinn; design ✅ Devon (after the compound-growth double-guide fix — it now copies the sample verbatim rather than stacking a near-duplicate callout above sample-intro; field-map "Unplaced" copy and reading-list lead also sharpened per review).
  • Deferred: the guidance register nit (the six read slightly expository) — left as-is; it's internally consistent and defensible.

pnpm verify green (sdk 171 · ui 977 · server 645 · e2e 251 + 40 MCP). Gates: code ✅ Quinn · design ✅ Devon.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KFk2T9k3p7ghCjdzMfkA5w

eliotlim and others added 3 commits July 12, 2026 16:07
Templates without strong in-doc guidance — the five database fixtures
(task-board, reading-list, roadmap, field-map, product-hq) and the
compound-growth sample copy — now open with one consistent leading
info callout: what the template demonstrates, then how to try it.
Database templates carry it on the hosting page's block-doc, above the
view; product-hq guides the Initiatives page only. The gallery passes
the user's locale text (new templates.<id>.guidance keys ×4 locales)
through instantiateTemplate; the SDK bakes canonical English defaults.
The seeded sample document (seed CLI / Insert sample document) is
untouched. Decks and strong-callout templates unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KFk2T9k3p7ghCjdzMfkA5w
…oes (TPL-11)

The rollupRows/rollupProperties display fix left several paths resolving
cross-database rollups against the own schema/rows (exporting '—', or
flashing 0). Now:

- CSV export (rowsToCsv + the context-menu action) resolves rollups and
  dependency names via an optional resolveRows param fed with the same
  rollup rows/properties the cells display.
- count-flash: useDatabase tracks which foreign databases have delivered
  rows and exposes pendingRollups; the table cell, row-properties panel
  and RowChips render the empty placeholder instead of a wrong 0 until
  the referenced database loads. RowChips also gained resolveProperties
  so card/timeline/map rollup chips resolve even when the relation
  column isn't displayed.
- filters/sorts (applyView), quick-search, footer/group summaries, board
  footers, metric cards and colour rules (rowColor) all take the same
  resolution set via new optional trailing params on applyView and
  summarizeColumn — same-database behaviour is unchanged (params default
  to the row set).

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

Devon (design) review fixes on the TPL-9 guidance callouts:

- Drop compound-growth from the guided set. The sample doc it copies already
  opens with its own intro paragraph (sample-intro), so prepending a standardized
  guidance callout double-guided — two near-duplicate leads stacked. The guided
  set is now the 5 database fixtures (task-board, reading-list, roadmap,
  field-map, product-hq); compound-growth joins the self-guiding bucket
  (grocery/pitch-deck/team-status) and copies the sample verbatim.
- field-map EN guidance: replace the jargon "unplaced affordance" with the
  on-screen label "Unplaced" (de/ja/zh already avoided it).
- reading-list EN guidance: lead on the non-obvious (each shelf is a gallery
  group; same books also list in a Table view) instead of restating the gallery
  card; de/ja/zh adjusted to match.

Updates the coupled unit tests (guided-set equality 6->5; compound-growth copies
the sample with no callout; shape assertion no longer pins a fixed "This template
shows" opener). pnpm verify green; templates e2e (11/11) green.

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

vercel Bot commented Jul 12, 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 12, 2026 9:28am

Request Review

@eliotlim eliotlim merged commit 7df14e5 into main Jul 12, 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