Skip to content

Templates: category tabs + new starters with theme presets#16

Merged
avanelsas merged 4 commits intomainfrom
feat/templates-categories
May 1, 2026
Merged

Templates: category tabs + new starters with theme presets#16
avanelsas merged 4 commits intomainfrom
feat/templates-categories

Conversation

@avanelsas
Copy link
Copy Markdown
Owner

Summary

  • Adds category tabs to the Templates pane (:all, :landing, :docs, :dashboard, :blog).
  • Five new starter templates: docs-home, changelog, status-page, blog-post, dashboard-skeleton.
  • Each starter carries a :theme-preset that is applied at instantiation; landing starters pin to the default preset.
  • New add-spacer helper for consistent vertical rhythm across builders.

Test plan

  • clj-kondo --lint src test scripts — 0/0
  • cljfmt check — clean
  • npx shadow-cljs compile test — 594 tests / 1948 assertions, 0 fail
  • npx shadow-cljs release app — 0 warnings
  • Manual: open Templates pane, switch tabs, instantiate one template per category, confirm theme preset takes effect

🤖 Generated with Claude Code

avanelsas and others added 4 commits April 30, 2026 11:40
Adds five new starters (docs-home, changelog, status-page,
blog-post, dashboard-skeleton) and a category dimension that
groups every template into one of four buckets:

- :landing  — the original eight realistic marketing-site scaffolds.
- :docs     — docs-home, changelog, status-page, blog-post.
- :dashboard — dashboard-skeleton.
- :demo     — kinetic-showcase.

The templates panel grows a tab bar above the card list. `:all`
is the default tab and renders every template in declared order;
the four real-category tabs filter to their members. Tab state is
local to the panel via a JS-object closure — transient UI state
with no need to enter state/app-state. Active class hops between
sibling tabs without rebuilding the bar so clicks feel instant.

Two new public helpers carry the data:
- `category-order` / `category-labels` — the tab list and display
  names. Update both in lockstep when adding a category.
- `templates-in-category` — pure filter; `:all` is the pseudo-cat
  that returns the full registry. Tested independently.

Coverage: bareforge.ui.templates-test (9 tests, 122 assertions)
asserts every template carries the required fields, every
category is declared, every category's filter respects its
membership, and every builder thunk produces a non-empty doc.

Test count: 584 → 593. Gates green:
- cljfmt check — clean.
- npx shadow-cljs compile test — 593 tests / 1935 assertions / 0 failures.
- npx shadow-cljs release app — 0 warnings.
- clj-kondo — 0 errors / 0 warnings.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The new docs / dashboard / blog templates landed without explicit
vertical breathing room — sections sat against each other and the
result felt cramped against the existing eight landing templates,
which use spacers liberally between sections.

New private helper `add-spacer` (vertical x-spacer with a CSS-
length size) drops the boilerplate. Section breaks across the
five new templates pick up reasonable rhythm:

- docs-home: 2rem after navbar; 0.75rem heading→subtitle; 2rem
  before grid; 0.5rem inside each card between title and body.
- changelog: 0.5rem heading→subtitle; 2rem before first release;
  0.5rem inside each card between header and body; 1rem between
  releases (omitted after the last so trailing whitespace doesn't
  drift).
- status-page: 1rem after title; 2.5rem after the alert; 0.75rem
  heading→content for both sub-sections; 2.5rem between the
  services grid and the incidents heading.
- blog-post: 0.5rem after the overline; 1.5rem after the headline;
  1.5rem on either side of the divider; 1rem between body
  paragraphs (omitted after the last).
- dashboard-skeleton: 1.5rem after navbar; 1rem heading→stats;
  2rem stats→activity card; 0.5rem inside the activity card.

Reduce paths that append release / paragraph bodies switched from
explicit `(+ N i)` indices to `slot-count` + a per-iteration
last-item check so the trailing-spacer omission stays correct
without manual index bookkeeping.

Gates green; 593 tests still passing, 0 release-build warnings,
0 lint warnings, formatting clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
apply-template! preserves the user's current theme by default —
loading a landing template shouldn't wipe theme tweaks the user
already made. Templates that declare a `:theme-preset` now switch
to that preset instead, so the visual rhythm of the new starters
lands as designed.

Theme assignments across the five new templates pick distinct
presets so the Templates panel doubles as a theme showcase:

- docs-home          → ocean       (calm, friendly trusted-doc feel)
- changelog          → mono-ai     (release-notes / code aesthetic)
- status-page        → forest      ("all systems green" energy)
- blog-post          → warm-mineral (warm reading-friendly tones)
- dashboard-skeleton → aurora      (vibrant data-viz palette)

The eight pre-existing landing templates remain preset-free, so
loading them keeps whatever theme the user has dialled in.

Test coverage: theme-presets-are-real asserts every declared
preset is one of the eight in `theme-editor/presets`. Drift
(typo in a preset name, BareDOM removing a preset) fails loudly.

Test count 593 → 594. Gates green.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The eight original landing templates had no :theme-preset, so loading
one preserved whatever theme the prior document used. Loading a
themed starter (e.g. docs-home → ocean) and then the SaaS hero would
leave the SaaS hero rendered in ocean — drift the user noticed as
"all landing page templates now use ocean".

Pinning each landing template to "default" makes the load
reproducible: the template-load flow honours :theme-preset and
resets to that preset on apply.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@avanelsas avanelsas merged commit 8122983 into main May 1, 2026
1 check passed
@avanelsas avanelsas deleted the feat/templates-categories branch May 1, 2026 09:50
@avanelsas avanelsas mentioned this pull request May 2, 2026
4 tasks
avanelsas added a commit that referenced this pull request May 2, 2026
* Release v0.3.0 — minor release with multi-step actions, State
panel, inline binding chip, templates revamp + Hickey-style
export pipeline refactor

Promotes the [Unreleased] section in CHANGELOG.md to a tagged
[0.3.0] — 2026-05-02 entry, adds the standard ### Verified
block, and refreshes the comparison links at the bottom.
package.json's version bumps 0.2.0 → 0.3.0 to match.

This is a minor (not patch) release because PRs #16-#19, #21
add substantial editor surfaces (multi-step actions, live
State panel, inline binding chip, templates panel revamp with
five new starters, inspector field-as-data foundation), and
PRs #20 / #23 / #24 / #25 land the full Hickey-style refactor
of the export pipeline (clj-form data values for every codegen
path; lower-document as the canonical lowered model every
plugin consumes). PRs #15 and #22 fix three reconciler bugs
along the way. Saved project files are unchanged; every export
target stays at parity.

Verified locally:
- 747 tests / 2243 assertions / 0 failures / 0 errors.
- npx shadow-cljs release app — 0 warnings under Closure Advanced.
- clj-kondo --lint src test scripts — 0 errors, 0 warnings.
- cljfmt check — all files formatted.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* CHANGELOG: tighten v0.3.0 entry

Drop the per-PR detail in favour of a brief summary. Each
bullet is one line / one short paragraph; the inline rationales
and namespace-level notes move out of the changelog (commit
messages and PR descriptions are the canonical record for those).

Net: 165 lines of v0.3.0 entry → 60 lines.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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