Skip to content

decouple plan view styling from nabat - #175

Merged
atkrad merged 1 commit into
mainfrom
decouple-view-styling
Sep 29, 2026
Merged

atkrad merged 1 commit into
mainfrom
decouple-view-styling

Conversation

@atkrad

@atkrad atkrad commented Sep 29, 2026

Copy link
Copy Markdown
Member

Summary

  • internal/plan/view now owns its styling vocabulary: six roles (RoleTitle, RolePrimary, RoleDiffAdded, RoleDiffRemoved, RoleDiffModified, RoleDiffContext) and a one-method Styler interface. The package no longer imports Nabat or Charm.
  • Options.Theme is replaced by an optional Options.Styler. Nil renders plain text, and WriteJSON ignores it.
  • Diff intent is no longer mapped onto status colors. A deleted line is RoleDiffRemoved, not an error, and an update heading is RoleDiffModified, not a warning. The Nabat mapping belongs to the CLI adapter in a later PR.

Plain Human output is byte-identical to main. The old zero theme quietly replaced tabs with 4 spaces inside Lip Gloss, so the renderer now does that itself before calling the styler. A test pins this behavior.

Not in this PR: the deployah plan cutover, the Nabat adapter in internal/cmd/plan, and removal of the legacy planner. The legacy formatters under internal/plan still import nabat.dev/theme.

Test plan

  • Unit tests added/updated
    • Role goldens (*.roles.golden, style_*.golden) record the role for every styled line. Each golden's text column must match the non-blank lines of the plain output.
    • A test checks that WriteHuman writes the string the styler returns.
    • A tab-expansion test covers both plain and styled output.
    • The existing Human and JSON goldens are unchanged.
  • go build ./..., go test ./... -race, go vet, golangci-lint run, and pre-commit all pass
  • go list -deps ./internal/plan/view lists no nabat.dev or Charm packages

Labels

  • kind/chore
  • skip-changelog

Checklist

  • Title is short and imperative (matches commit style)
  • No secrets or local-only paths in the diff

- add view-owned styling roles and a Styler interface
- replace the theme option with an optional styler
- add role goldens for human output styling
@atkrad atkrad added kind/chore Cleanup, deps, CI, or refactor with no user-facing change skip-changelog Exclude this PR from release notes labels Sep 29, 2026
@github-actions github-actions Bot added the area/deploy Deploy and plan session flow label Sep 29, 2026
@atkrad atkrad self-assigned this Sep 29, 2026
@codecov

codecov Bot commented Sep 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.12195% with 2 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
internal/plan/view/human.go 95.12% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@atkrad
atkrad merged commit 7cc8496 into main Sep 29, 2026
17 checks passed
@atkrad
atkrad deleted the decouple-view-styling branch September 29, 2026 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/deploy Deploy and plan session flow kind/chore Cleanup, deps, CI, or refactor with no user-facing change skip-changelog Exclude this PR from release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant