8000 Implement "Paper & Ink" printer UI theme with animated paper roll by jmahmood · Pull Request #29 · jmahmood/CardBrick · GitHub
[go: up one dir, main page]

Skip to content

Implement "Paper & Ink" printer UI theme with animated paper roll - #29

Merged
jmahmood merged 8 commits into
masterfrom
claude/cardbrick-ui-theme-design-gzwut9
Jul 8, 2026
Merged

jmahmood merged 8 commits into
masterfrom
claude/cardbrick-ui-theme-design-gzwut9

Conversation

@jmahmood
@jmahmood jmahmood commented Jul 8, 2026
Copy link
Copy Markdown
Owner

Summary

Redesigns the entire visual theme from a dark modern interface to a "Paper & Ink" metaphor where the screen is a printer with an unlimited paper spool. Content is "printed" with animated line feeds, page feeds past perforations, and rewind animations for undo. Introduces the PaperRoll class to manage the printing animation system.

Key Changes

  • New PaperRoll class (paperroll.py): Manages a one-dimensional spool of pre-rendered content with eased animations. Supports:

    • Line feeds (individual content items)
    • Page feeds (new cards with perforation marks)
    • Rewind operations (undo that rolls back past perforations)
    • Interrupt-safe animations (any input snaps to completion)
    • Reduced motion support (instant snaps instead of animations)
    • Memory-bounded spool (old content pruned while keeping recent pages rewindable)
  • Color palette overhaul: Replaced dark theme with warm paper tones:

    • Background: warm paper (242, 237, 227) instead of dark (24, 26, 30)
    • Text: ink (43, 45, 58) instead of light (235, 235, 228)
    • Accent: vermillion stamp red (217, 83, 74) instead of blue
    • Added printer chrome colors: tractor-feed strips, sprocket holes, chassis bar
  • Review screen refactored: Content is now pre-rendered and fed to the roll instead of drawn every frame:

    • Card content (front, back, vocab phases) printed when revealed
    • Ratings stamped onto cards before page feed
    • Menu overlay rendered as a paper slip on top
    • Only chrome (sprocket strips, chassis hints) drawn each frame
  • Child start screen: Now uses animated paper roll with a printed "job ticket" showing the day's practice goals, deck/category info, and sprint status

  • Menu system updated: Deck and category selection screens use new _menu_row() helper with consistent styling

  • New helper methods:

    • _new_roll(): Creates a PaperRoll instance
    • _paper(): Fills background with paper color and draws sprocket strips
    • _draw_roll(): Renders the visible portion of the roll
    • _page_header(): Prints a page title and subtitle
    • _menu_row(): Renders a menu item with selection highlight
    • _stub_surface(): Creates a receipt-style header with left/right text
    • _rule_surface(): Renders a horizontal divider line
    • _stamp_surface(): Creates an ink-stamp effect for ratings
    • _render_highlight_line(): Renders text with word highlighting (for vocab examples)
  • Settings: Added reduced_motion setting to disable animations

  • Tests: Comprehensive headless tests for PaperRoll geometry and animation logic

Implementation Details

  • The printer metaphor is enforced throughout: all content flows through the roll, animations are interruptible (golden rule: never make the child wait), and the visual design uses printer-specific elements (tractor-feed strips, perforations, chassis bar)
  • Content is rendered once when printed, not every frame, improving performance
  • The spool uses eased animations (35% per tick at 30 FPS) for smooth, natural-feeling feeds
  • Undo rewinds the spool backwards past the perforation, then the restored card reprints where it was
  • Memory is bounded by pruning old items while keeping recent pages rewindable for undo

https://claude.ai/code/session_018GvLQKKGsRbsYdcrTZfGQ4

claude and others added 8 commits July 8, 2026 14:07
The whole UI is rebuilt around one metaphor: the screen is a printer
with an unlimited tractor-feed paper spool. Cards are printed — each
line of content is a line feed, each new card a page feed past a
dashed perforation, and undo visibly rewinds the roll. Ratings stamp
the card in ink before it feeds away, the session summary prints as a
till receipt with dot leaders and a stamped headline, the child start
screen is the day's job ticket, and the calendar becomes printed month
sheets that page-feed on month change.

- new cardbrick/paperroll.py: headless-testable spool geometry — a
  deque of pre-rendered line surfaces, eased scroll offset, staggered
  line-feed release, page bookkeeping for rewind, and pruning so the
  "unlimited" roll never grows unbounded. Cheaper than the old code,
  which re-rendered every text surface every frame.
- Paper & Ink palette (warm paper, ink, pencil, one vermillion accent)
  under the existing constant names; sprocket strips whose punched
  holes ride with the roll; button hints move onto a dark chassis bar.
- menus/parent screens: selection is a vermillion margin marker plus
  ink underline instead of the "> " colour-swap cursor.
- golden rule: every feed is interruptible — any input snaps it to its
  end state first — and a new reduced_motion setting disables feeds.
- tests/test_paperroll.py covers feed/stagger/finish/rewind/prune.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018GvLQKKGsRbsYdcrTZfGQ4
# Conflicts:
#	cardbrick-py/cardbrick/app.py
- Ignore .DS_Store files throughout the repo
- Ignore local .apkg deck files under cardbrick-py
- Ignore local cardbrick-py/mise.toml tool config
@jmahmood
jmahmood merged commit c1a8160 into master Jul 8, 2026
3 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.

2 participants

0