Skip to content

Add preview package and "preview pack" CLI subcommand#75

Merged
BCook98 merged 1 commit into
mainfrom
add-preview-pack
Jul 4, 2026
Merged

Add preview package and "preview pack" CLI subcommand#75
BCook98 merged 1 commit into
mainfrom
add-preview-pack

Conversation

@BCook98

@BCook98 BCook98 commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Adds the authoring/packing side of the arcade's animated games-screen previews:

  • preview package: Pack compiles a preview/ authoring directory (preview.yaml manifest + plain-text frame files, 46×7 cells, optional ANSI SGR color) into a single self-contained preview.scp bundle; Load parses one back into a playable Animation. Validation enforces the frame-text contract at pack time — SGR-only escapes; C1/invalid-UTF-8/variation-selector/ZWJ/keycap rejection; 1–64 frames; per-frame durations clamped 80–10000 ms; pad-never-truncate; 64 KiB cap. The arcade re-runs identical checks at intake.
  • shellcade-kit preview pack <dir> [-o out.scp] subcommand, so games-repo CI can pack via the existing per-game-pinned go run mechanism.
  • GUIDE.md gains a "Preview loops" authoring section; minor changeset included.

New dep: charmbracelet/x/ansi (display-width measurement identical to the arcade's — packed bundles verified byte-identical against the arcade's packer for two real games).

🤖 Generated with Claude Code

…reen preview loops

Game authors compile a hand-authored games-screen preview loop — a preview/
directory of a preview.yaml manifest plus plain-text frame files — into a
single self-contained preview.scp bundle that ships as a release asset.

- New public `preview` package (Pack/Load + validation + format constants),
  documented for game authors. Pack validates and compiles the authoring
  directory; Load parses a bundle back into a playable Animation. The frame-text
  contract is enforced at pack time (46x7 cells, SGR-only escapes, rejects
  C1/invalid-UTF-8/VS16/ZWJ/keycap hazards, 1-64 frames, per-frame ms clamped
  80-10000, pad-never-truncate, 64 KiB cap). Widths use
  github.com/charmbracelet/x/ansi StringWidth so the packer agrees byte-for-byte
  with the arcade's intake re-validation.
- New `shellcade-kit preview pack <dir> [-o out.scp]` CLI subcommand (dispatch,
  usage line, trailing-flag handling, loud stray-positional rejection).
- GUIDE.md: a "Preview loops" authoring section.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@BCook98 BCook98 changed the title Add preview package and CLI subcommand Add preview package and "preview pack" CLI subcommand Jul 4, 2026
@BCook98 BCook98 merged commit 2966032 into main Jul 4, 2026
6 checks passed
@BCook98 BCook98 deleted the add-preview-pack branch July 4, 2026 10:53
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