Conversation
A review of mossaic from the outside: install it, run it, read what it
prints. Five things it got wrong, all of them on the paths somebody meets
in the first minute.
The one shipped template warned on every year. `--template dragon`
printed `note: 6 cell(s) fell outside 2027 and were dropped` for 2025
through 2029, and all six were blank margin — Canvas::place counted every
cell that fell outside the year rather than every cell that would have
been drawn. The flagship path, warning about nothing, teaching people
that notes here are noise. It now counts only lit cells.
Counts did not read as English. Twenty-nine of them: `1 template(s)`,
`6 cell(s)`, `59 day(s)` — the first line of `--list-templates` and the
markdown the GitHub Action posts to a pull request. `plural` takes both
forms rather than appending an `s`, so verbs agree too: "1 day is short",
"2 days are short", and the number's own formatting stays at the call
site where the widths and separators live.
`mossaic-art --help` was thirty flags in one flat list, with a paragraph
of colour theory inside `--background`. Grouped now — what to draw, where
it goes, tracking, making the commits, output — with usage and seven
examples first. The colour theory moved to docs/ART.md, which had room
for it already. 93 lines against 113, and no flag dropped.
A missing `--file` in a script blamed the terminal. The chart claims the
terminal before it reads the calendar, so a typo'd path in CI came back
as `needs an interactive terminal`: true, and no help in finding the
typo. Only that case changed — with a terminal the error is still shown
*in* the chart with `r` to retry, which is the better answer, and the
first attempt at this broke that.
`--font` told everyone who ran it to edit `src/art.rs`.
The catalogue was a catalogue of one, which is what `--template NAME`
offered. Three more: wave, pulse, invader — 51 columns each, so no lit
day lands in a partial week, and `{0, 2, 4}` each, the only three shades
that are all clearly distinct.
That last part is why two gates come with them, and they matter now that
#57 invites contributed art. `every_template_reads_clearly` measures the
closest pair of shades in every template: art using 2 and 3 looks
two-toned in the file, because the digits differ, and reads as one flat
colour on github.com. `no_template_overhangs_the_year` fails a template
that loses a lit day off either end of any year. Both were run against
art planted to break them, and both did.
Also: the description never said mossaic was a terminal program, and the
action refs in the docs had been pinned at v0.6.0 for two releases.
213 tests, fmt, clippy and rustdoc clean.
Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com>
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.
What & why
A review of mossaic from the outside — install, run, read what it prints — and
the fixes for what that found. Everything here is on a path somebody meets in
the first minute of using it.
The one shipped template warned on every year
2025 through 2029, every one. And all six cells were blank margin —
dragon.artis0at both ends of all seven rows, so nothing was lost.Canvas::placecounted every cell that fell outside the year rather than everycell that would have been drawn. It now counts only lit ones, so the note
appears when a shade is genuinely lost and stays quiet otherwise.
Counts did not read as English
Twenty-nine of them —
1 template(s),6 cell(s),59 day(s)— on the firstline of
--list-templatesand in the markdown the GitHub Action posts to a pullrequest.
pluraltakes both forms rather than appending ans, so verbs agreetoo (1 day is short, 2 days are short) and the number's own formatting —
widths, thousands separators — stays at the call site where it belongs.
--helpwas thirty flags in a flat listWith a paragraph of colour theory inside
--background. Now grouped: what todraw, where it goes, tracking, making the commits, output — usage and
seven examples first. The colour theory moved to
docs/ART.md, which alreadyhad room to say it properly. 93 lines against 113, and no flag was dropped.
A missing
--filein a script blamed the terminalTrue, and no help in finding the typo. Only that case changed — with a terminal
the error is still shown in the chart with
rto retry, which is the betteranswer. My first attempt pre-checked the path and broke that; the existing PTY
test caught it, and the fix now sits at the point where the terminal is refused.
--fonttold its readers to editsrc/art.rsA note meant for contributors, printed to everyone who ran it.
And the catalogue is now a catalogue
--template NAMEoffered exactly one NAME. Three more ship: wave (one cleansine across the year), pulse (a heartbeat trace) and invader. Each is 51
columns, so no lit day lands in a partial week, and each is drawn in
{0, 2, 4}— the only three of GitHub's greens that are all clearly distinct.
Two gates come with them, which matter now that #57 invites contributed art:
every_template_reads_clearlymeasures the closest pair of shades in everytemplate. Art using
2and3looks obviously two-toned in the.artfile,because the digits differ — and reads as one flat colour on github.com. Only
measuring catches it.
no_template_overhangs_the_yearfails a template that loses a lit day offeither end of any year.
Both were run against art planted to break them:
Also
descriptionnever mentioned that mossaic is a terminal program, which ishow it is found on crates.io.
tuireplacescontributionsin the keywords —contribution-artalready covers that ground.action@v0.6.0refs indocs/andaction/had been stale for tworeleases.
RELEASING.md§2b exists to catch this; it was not run.Verification
cargo fmt --check,clippy --all-targets --all-features -D warningsandRUSTDOCFLAGS=-D warnings cargo docall clean.tests/chart_cli.rsfor the chart with no terminal —including the one that would have failed before this change.
--list-templatesPTY test now readsfull_text(): the catalogueoutgrew one screenful, and "did this reach the terminal" is the question it
was actually asking.
Checklist
cargo fmt --allandcargo clippy --workspace --all-targets --all-featuresare cleanCHANGELOG.mdupdated — released as[0.6.3]