[M4] ASCII art + render: stage/health frames, caption, color path - #14
Merged
Merged
Conversation
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.
Closes #4
Implements M4 — ASCII art + render.
internal/rendernow turns aplant.PlantStateinto a full framed plant, and the root command renders the live plant for your repo instead of the M1 static seedling.What changed
render.Frame(PlantState, Options)— the real render. Picks ASCII art by (stage × health) and appends a caption block:stage,streak,lastcommit (phrased as today / yesterday / N days ago), a days-until-wilt nudge when thirsty/wilting, and the plant's mood line.map[Stage]map[Health]stringtable, upright for healthy and progressively drooping for thirsty → wilting, so condition is visible, not just captioned. Easy to add/edit frames.lipgloss— foliage color by health (green / yellow / red, magenta bloom accent) with a faint caption.Options.Colorgates it.--no-color, theNO_COLORenv var, and any non-TTY stdout (piped/redirected).cmd/root.godecides viago-isatty; lipgloss's own profile detection is a second safety net. Plain output is guaranteed escape-free (tested).render.PromptGlyph— compact one-lineglyph stageprimitive for M6 prompt mode.commit-sproutnow runsgitstat.Read → plant.Compute → render.Frame. Handles not-a-repo and no-commits gracefully. Added--no-color; kept the hidden--activitydebug bridge.Seedling()retained for backward compat (it's the healthy Seed frame; M1 stability test still guards it).State note
M5 (persistence) isn't wired yet, so a zero
plant.Stateis passed for now — the memory floor behaves correctly from a fresh state, and M5 will load the remembered highest stage/streak at this seam.Tests
Snapshot-style, plain-text (deterministic via pinned
Now/LastCommit):Verification (Go 1.23.4, matching CI)
gofmt -l .clean ·go vet ./...clean ·go build ./...ok ·go test ./... -count=1ok--no-color/NO_COLOR=1all plain; forced-TTY emits ANSI;--activitystill works.Also refreshed README step 4 with an "Implemented — M4" note mirroring the M2/M3 annotations.