Skip to content

feat: zero-book launch, candlelit design system, and full audit fixes - #9

Merged
Sagargupta16 merged 6 commits into
mainfrom
feat/zero-book-launch
Jul 16, 2026
Merged

Sagargupta16 merged 6 commits into
mainfrom
feat/zero-book-launch

Conversation

@Sagargupta16

Copy link
Copy Markdown
Owner

Summary

Zero-book launch: the three placeholder seed books are removed, the shelves open honestly empty with crafted states, and every finding from the full repo audit is fixed. UI patterns were studied in detail from the kalchar, portfolio-react, and ledger-sync siblings and adapted to the candlelit identity.

Design system (new)

  • Tiered OKLCH tokens with a warm-ink elevation ladder (--shadow-hairline, --shadow-e1..e4) -- no raw black shadows
  • Ambient candlelight backdrop: dot lattice + drifting radial glow + vignette (fixed, decorative, inert)
  • SVG paper-grain turbulence layer (no image asset)
  • Tilted-plate hero ("Chapter One is being written") and per-shelf ghost-spine empty states
  • "How this library works" colophon; flame favicon matching the masthead

Audit fixes

  • [hidden] always computes to display:none (panels no longer render open; blank Continue card gone)
  • Reading progress: saved position read before any write, persistence gated on real engagement, debounced storage, short chapters count as 100%
  • Chapter shortcuts no longer hijack focused links/buttons/controls; all modifiers respected
  • Reader script moved inside the document (was emitted after </html>)
  • No horizontal overflow at 320px (minmax(min(100%, NNrem), 1fr))
  • Full prefers-reduced-motion support; the anti-reduced-motion house rule is reversed
  • Skip link, fieldset/legend prefs, accessible names for text-size + TTS controls, no empty pager landmark
  • Schema: integer orders, https/relative-only media URLs, universe required for fanfic; astro/zod import clears all 22 deprecation hints
  • markdown.processor: satteri({ features: { smartPunctuation: false } }) replaces deprecated smartypants
  • Book/Chapter JSON-LD, article:published_time, excerpt meta descriptions, RSS item descriptions
  • Inline JSON escapes < (script-breakout hardening)
  • Git writing history: one batched git log per build instead of per-chapter processes
  • LF policy via .gitattributes (also resolved 30 phantom line-ending diffs), Prettier endOfLine: lf
  • CI quality gate (least-privilege, frozen lockfile, format/verify/check/build/e2e); deploy workflow job-scoped and pnpm pinned
  • pnpm verify:content cross-file invariants
  • Docs: truthful README/CLAUDE/.impeccable, CHANGELOG v0.2.0 (plus retroactive 0.1.0), skill contradictions fixed (revise-chapter publishing bypass, outline-book filename)

Testing

  • pnpm format:check, pnpm verify:content, pnpm check (0 errors / 0 warnings / 0 hints), pnpm build -- all green on the committed state
  • Playwright suite (desktop / Pixel 7 / 320px against the production build): 30 passed
  • Reader regression tests verified green against a temporary fixture book (progress survives reload, panels collapsed, arrow keys guarded, theme persists), fixture removed before commit; the suite self-activates when the first real chapter lands
  • Visual review at 390px and 1440px in light and dark themes

Blocked / notes

  • Pushed over SSH: the stored OAuth/gh tokens lack the workflow scope needed to add .github/workflows/ci.yml over https
  • Browser XSLT deprecation for the styled RSS page is upstream; the feed itself is standard RSS and unaffected

Adds .gitattributes (adapted from kalchar) so text files are always LF,
pins Prettier endOfLine to lf, and renormalizes every tracked file once.
This also clears the 30 phantom line-ending-only diffs that sat in
.claude/skills and makes `prettier --check .` pass cross-platform.
Removes the three placeholder seed books and the sample chapter; the
library now opens genuinely empty and reads as intent, not absence.

Design system (patterns studied from kalchar and portfolio-react):
- tiered OKLCH tokens with a warm-ink elevation ladder
  (--shadow-hairline, --shadow-e1..e4) replacing raw shadows
- ambient candlelight backdrop: dot lattice, drifting radial glow,
  edge vignette (fixed, decorative, pointer-events none)
- SVG paper-grain turbulence layer, no image asset
- tilted-plate hero ("Chapter One is being written") and crafted
  per-shelf empty states with ghost book spines
- "How this library works" colophon
- skip-to-content link + sticky-header scroll padding
- [hidden] { display: none !important } so native hidden always beats
  component display rules (fixes always-open panels and the blank
  continue-reading card)
- grid tracks via minmax(min(100%, NNrem), 1fr) -- no horizontal
  overflow at 320px
- every animation now has a prefers-reduced-motion path; the
  anti-reduced-motion house rule in .impeccable.md is reversed
- favicon replaced with the masthead flame mark

src/content/books/README.md documents the authoring contract so the
empty collection stays ready for the first real book.
Progress (previously destroyed on load):
- saved position is read before anything writes; persistence only
  starts after real engagement (scroll or 3s dwell), so a quick
  load/reload never clobbers it
- storage writes debounced (250ms) plus pagehide/visibilitychange
  flush, instead of synchronous JSON on every animation frame
- chapters shorter than the viewport count as 100% read

Keyboard/swipe navigation:
- arrows / h,l no longer fire from focused links, buttons, or form
  controls, and respect Alt/Shift as well as Ctrl/Meta

Accessibility and structure:
- reader script moved inside the layout (was emitted after </html>)
- prefs panel uses fieldset/legend; text-size buttons get real
  accessible names (Small/Default/Large/Extra large text)
- TTS toggle drops its stale fixed aria-label so Pause/Resume is the
  accessible name
- pager nav renders only when a prev/next chapter exists (no empty
  landmark on single-chapter books)
- resume scroll honors prefers-reduced-motion
- chapter pages emit Chapter JSON-LD, article:published_time, and an
  excerpt-based meta description; book pages emit Book JSON-LD
Schema (src/content.config.ts):
- z imported from astro/zod (clears all deprecation hints)
- order must be a positive integer
- pdfUrl/audioUrl/cover restricted to https:// or site-relative
- fanfic books must declare `universe`

Cross-file invariants (scripts/verify-content.mjs, pnpm verify:content):
- orphan chapters, duplicate orders, NN- prefix mismatch, future or
  missing publishedOn

Markdown: markdown.processor = satteri({ features: { smartPunctuation:
false } }) replaces the deprecated smartypants flag; the house dash
rule is preserved.

RSS: items now carry excerpt descriptions.

Writing history: one `git log --name-only` pass per build, cached,
instead of one child process per chapter. --follow is dropped, so a
renamed chapter restarts its visible history -- acceptable for the
public writing log.
CI (.github/workflows/ci.yml): least-privilege permissions, frozen
lockfile install, format check, content invariants, astro check,
build, and browser smoke tests on every PR and push to main.

Deploy workflow: job-scoped permissions (build is read-only; only the
deploy job gets pages/id-token) and pnpm pinned to 11.10.0 instead of
pnpm@latest. package.json gains the packageManager field.

Tests (desktop / Pixel 7 / 320px projects, run against the production
build via astro preview):
- site.spec.ts: shell rendering, crafted empty states, hidden
  continue-card actually display:none, zero horizontal overflow, skip
  link, inert decorative layers, RSS/sitemap/404, reduced-motion
  freeze
- reader.spec.ts: collapsed panels, progress surviving reload,
  arrow keys on focused controls, theme persistence. These skip
  cleanly at zero chapters and were verified green against a
  temporary fixture book before it was removed.
- CHANGELOG.md added with 0.2.0 (this release) and 0.1.0 (all
  previously unversioned merged work, PRs #1-#8)
- README and CLAUDE.md rewritten to describe the actual product:
  client-side reader platform, zero-book launch, real test commands,
  satteri markdown gotcha
- frontend-quality skill: reduced-motion path is now mandatory
  (was explicitly forbidden), zero-client-JS claim corrected
- revise-chapter can no longer set publishedOn -- publishing stays
  behind the publish-chapter gates
- outline-book names _outline.md consistently
@Sagargupta16
Sagargupta16 merged commit df677e3 into main Jul 16, 2026
2 checks passed
@Sagargupta16
Sagargupta16 deleted the feat/zero-book-launch branch July 16, 2026 01:18
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