decouple plan view styling from nabat - #175
Merged
Merged
Conversation
- add view-owned styling roles and a Styler interface - replace the theme option with an optional styler - add role goldens for human output styling
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Summary
internal/plan/viewnow owns its styling vocabulary: six roles (RoleTitle,RolePrimary,RoleDiffAdded,RoleDiffRemoved,RoleDiffModified,RoleDiffContext) and a one-methodStylerinterface. The package no longer imports Nabat or Charm.Options.Themeis replaced by an optionalOptions.Styler. Nil renders plain text, andWriteJSONignores it.RoleDiffRemoved, not an error, and an update heading isRoleDiffModified, 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 plancutover, the Nabat adapter ininternal/cmd/plan, and removal of the legacy planner. The legacy formatters underinternal/planstill importnabat.dev/theme.Test plan
*.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.WriteHumanwrites the string the styler returns.go build ./...,go test ./... -race,go vet,golangci-lint run, and pre-commit all passgo list -deps ./internal/plan/viewlists nonabat.devor Charm packagesLabels
kind/choreskip-changelogChecklist