fix(render): keep poster grid on cell renderers; add ascii/ansi256/truecolor modes#94
Merged
Merged
Conversation
…ruecolor modes Two problems with forcing a render mode for the tiled poster rails: 1. Sixel (and kitty/iTerm2) "got messed up": a graphics protocol emits one opaque DCS/escape blob, but the rails are composed as text cells (cards stitched side by side, line by line). Stitching a blob beside other cards injects cell-padding spaces into the middle of the sequence and shreds it. On a sixel-capable terminal auto-probe even picked sixel, so the grid broke with no override. 2. `--mode=ascii` errored as "invalid" though it was listed in help — candy-mosaic had no ascii renderer (only the video lib did), and ascii/ansi are genuinely distinct from half-block, not aliases. Fixes: - `run` resolves posters via MosaicFactory::forPosterGrid(): cell modes (halfblock/quarterblock/ascii/ansi256/truecolor) tile and pass through; null/auto default to half-block (no probing into a graphics protocol); an explicit graphics mode falls back to half-block and prints a notice (single images via `phlix poster` still honour it). - Wire the new candy-mosaic ASCII/ANSI renderers: `ascii` (mono), `ansi256`, `truecolor`; `ansi` and `half` alias half-block (the 24-bit colour-block mode). `quarterblock` now uses the new Mosaic::quarterBlock(). - Help/usage list the real modes, grouped cell vs graphics. PosterLoader keys its cache by protocol(), so every mode caches separately. MosaicFactoryTest covers each mode's protocol, grid pass-through, and the graphics downgrade notice. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to the
--modework, addressing two issues you hit.1. Sixel "got messed up"
The poster rails are composed as text cells (cards stitched side by side, line by line). A graphics protocol (sixel/kitty/iTerm2) emits one opaque DCS/escape blob with no per-row structure — stitching it beside other cards injects cell-padding spaces into the middle of the sequence and shreds it. On a sixel-capable terminal, auto-probe even picked sixel, so the grid broke with no way out.
Fix:
runresolves posters viaMosaicFactory::forPosterGrid():halfblock/quarterblock/ascii/ansi256/truecolor) tile → pass throughnull/autodefault to half-block (no probing into a graphics protocol)phlix poster <img> --mode=sixelstill use sixel — one image emits fine)2.
--mode=asciisaid "invalid" though it was listedcandy-mosaic had no ASCII renderer (only the video lib did), and ascii / ansi are genuinely different from half-block, not aliases. With the new candy-mosaic renderer (sugarcraft#1119) wired in:
halfblock(≡ansi)quarterblockasciiansi256truecolorsixel/kitty/iterm2All five cell modes tile, so they work in the grid. Help/usage now lists the real modes grouped cell vs graphics.
PosterLoaderkeys its cache byprotocol(), so every mode caches separately.MosaicFactoryTestcovers each mode's protocol, grid pass-through, and the graphics downgrade notice. Full suite green (2217);srcPHPStan L9-clean.🤖 Generated with Claude Code