Skip to content

feat(tui): add tiered ASCII pictures that fill free space - #98

Merged
m1ngsama merged 15 commits into
mainfrom
feat/pictorial-art
Oct 28, 2026
Merged

m1ngsama merged 15 commits into
mainfrom
feat/pictorial-art

Conversation

@m1ngsama

@m1ngsama m1ngsama commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Prompt's pages leave most of a large window empty. This adds ASCII pictures that fill the space, gain detail as the window grows, and degrade with the terminal's capabilities. The base is #97 and should move to main once #97 and #92 merge.

Decision for review: src/core/pixel-art-fine.ts and the new "Picture Detail" setting add an opt-in tier of Unicode blocks (off by default). Drop both if Prompt should stay ASCII-only.

Tiers. Pictures use the finest tier the terminal supports:

Tier When Drawing
Fine truecolor, Unicode, and Settings → Picture Detail → Fine blocks and Braille with smooth colour
Color colour on ASCII characters in colour; a faint background tint only in truecolor
Tone no colour or NO_COLOR ASCII characters whose density follows brightness

LANG=C stays ASCII. Nothing is drawn below 30 columns by 7 rows, so a full 80×24 page is unchanged.

Pictures

  • Home, Schedule, Docs: a landscape spans the width below the content when 8 or more rows are free, and sits beside it otherwise. Home shows a seascape that follows the local time, with the moon at its real phase. Schedule shows ridges with one trail tick per week. Docs shows a growing bookcase with a cat.
  • Home (beside), About: a shaded moon at today's phase and a banded gas giant. Each cell's brightness comes from the sphere's surface normal, not from a bitmap. The fine tier draws them as smooth half blocks.
  • Empty states: a crescent moon among stars for no events, and a magnifier for no search results, both six rows tall.
  • Home on a day without classes: a cup of tea with drifting steam, in the 16 to 29 columns beside the content where the full landscape does not fit.
  • Loading: a small planet with a moon circling it, one step per frame, on Home, Schedule, Docs, and Events. Reduced-motion terminals see a still frame.
  • Load errors on Events and Docs: a transmitter with dim waves and a red cross beside the message. The hint, and any URL in it, stays on its own full-width line.
  • Settings: the emblem at the largest size that fits. Events: the next event's icon beside the heatmap, and an icon beside each event title in the details view.

Algorithms. Cells are matched against measured glyph coverage, and brightness error is diffused to neighbouring cells in serpentine Floyd–Steinberg order, as in the libcaca study, so gradients mix densities instead of banding. Flat areas choose only among density-ramp glyphs (.:-=+*#%@), so the mixing reads as shading, not noise. Planets are lit by their surface normals, as in donut.c, with normals bumped by fractal and Worley noise height fields; the textures turn over time while loading.

scripts/generate-art.mjs regenerates the static bitmaps and shaded emblems; scripts/generate-glyphs.mjs measures the ink coverage of each ASCII character. Landscapes are generated at runtime and cached per window size and five-minute step. The package grows from 130,040 to about 154,000 bytes compressed, with no new dependencies.

Validation: npm run check (1,161 tests, package check, audit with zero vulnerabilities). Checked in a pseudoterminal at 80×24, 110×28, 150×42, with and without LANG=C and NO_COLOR. The fine tier was checked on the About page only.

@m1ngsama
m1ngsama force-pushed the feat/home-and-heatmap-details branch from aaf9e35 to 57947d6 Compare October 28, 2026 11:42
@m1ngsama
m1ngsama changed the base branch from feat/home-and-heatmap-details to main October 28, 2026 11:45
@m1ngsama m1ngsama changed the title feat(tui): add shaded and block-colour pictures feat(tui): add tiered ASCII pictures that fill free space Oct 28, 2026
@m1ngsama
m1ngsama merged commit 2e620bb into main Oct 28, 2026
4 checks passed
@m1ngsama m1ngsama mentioned this pull request Oct 28, 2026
@m1ngsama
m1ngsama deleted the feat/pictorial-art branch October 28, 2026 13:08
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