Skip to content

feat: add service widget and clean up repo#2

Merged
Jason-Adam merged 2 commits intomainfrom
feat/service-widget-and-cleanup
Mar 28, 2026
Merged

feat: add service widget and clean up repo#2
Jason-Adam merged 2 commits intomainfrom
feat/service-widget-and-cleanup

Conversation

@Jason-Adam
Copy link
Copy Markdown
Owner

Summary

  • Add service widget showing repo name (e.g. "vitals") with default layout reordered to service | worktree | branch
  • Replace Justfile with slim Makefile, remove version semantics (VERSION files, version package, version/update CLI commands)
  • Remove demo.gif (9MB), docs/ directory (duplicated CLAUDE.md content)
  • Fix gopls diagnostics: WaitGroup.Go, unused params, range-over-int, unused usageLabel
  • Add GitHub Actions CI (vet + test + race) and pre-commit config (go fmt/vet)

Test plan

  • go build ./... passes
  • go test ./... -count=1 passes (2 pre-existing failures on hardcoded paths)
  • go vet ./... clean
  • go fmt ./... clean
  • make build installs binary

🤖 Generated with Claude Code

…p repo

Add a "service" widget that displays the repository name (e.g. "vitals")
in the statusline, with default layout reordered to service | worktree | branch.

Replace Justfile with a slim Makefile, remove version semantics (VERSION files,
version package, version/update subcommands), remove demo.gif, docs/ directory,
and fix gopls diagnostics (WaitGroup.Go, unused params, range-over-int).

Add GitHub Actions CI workflow and pre-commit config for go fmt/vet.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 28, 2026 08:20
@Jason-Adam Jason-Adam self-assigned this Mar 28, 2026
Tests were failing in CI (and on any non-kyle machine) because they
hardcoded a specific home directory path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Jason-Adam Jason-Adam merged commit f5b0ee3 into main Mar 28, 2026
1 check passed
@Jason-Adam Jason-Adam deleted the feat/service-widget-and-cleanup branch March 28, 2026 08:24
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new service widget (repo basename) to the default HUD layout while simplifying repo maintenance by removing embedded versioning/docs artifacts and introducing Make/CI tooling.

Changes:

  • Add service widget, wire it through gather/context/default layout, and adjust project behavior accordingly.
  • Remove embedded version plumbing (VERSION files + internal/version + CLI version semantics) and delete duplicated docs/demo assets.
  • Add a Makefile, pre-commit config, and GitHub Actions CI (vet/test/race); fix assorted Go diagnostics/formatting.

Reviewed changes

Copilot reviewed 31 out of 35 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
internal/version/version.go Removes embedded VERSION-based version package.
internal/version/VERSION Deletes internal embedded VERSION file.
VERSION Deletes repo-level VERSION file.
cmd/vitals/main.go Removes version command + simplifies update; fixes range-over-int diagnostic.
internal/model/model.go Adds ServiceName to render context.
internal/gather/gather.go Derives ServiceName; switches goroutine spawning to WaitGroup.Go; simplifies sessionStart.
internal/gather/gather_bench_test.go Minor formatting adjustment in benchmark fixture.
internal/render/widget/service.go New widget rendering repo/service name.
internal/render/widget/project.go Suppresses directory portion when service widget is active.
internal/render/widget/widget.go Registers service widget and reformats registry.
internal/render/widget/widget_test.go Updates registry completeness test to include service.
internal/config/config.go Updates default widget layout to include service.
internal/config/config_test.go Updates default-layout tests to include service.
internal/render/widget/usage.go Removes unused helper.
internal/render/widget/tools.go Minor formatting adjustment.
internal/render/widget/agents.go Import ordering tweak.
internal/render/widget/agents_test.go Import ordering tweak.
internal/render/render.go Removes unused params in renderMinimal signature.
internal/render/render_test.go Import ordering tweak.
internal/render/powerline_test.go Import ordering tweak.
internal/stdin/mock_test.go Removes trailing whitespace line.
internal/theme/theme.go Formatting-only changes to theme maps.
README.md Removes demo image; adds development quickstart snippet.
CLAUDE.md Updates task runner instructions from just to make; updates widget list.
Makefile Adds Make targets replacing Justfile tasks.
Justfile Removes Just-based task runner and version release helpers.
.pre-commit-config.yaml Adds Go fmt/vet hooks via pre-commit.
.github/workflows/ci.yml Adds CI job running vet/test/race on Go 1.25.
docs/widgets.md Removes docs directory content (widgets doc).
docs/development.md Removes docs directory content (development doc).
docs/configuration.md Removes docs directory content (configuration doc).
docs/cli.md Removes docs directory content (CLI doc).
docs/architecture.md Removes docs directory content (architecture doc).
demo.gif Removes large demo asset.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

if input.Worktree != nil && input.Worktree.OriginalCwd != "" {
cwd = input.Worktree.OriginalCwd
}
ctx.ServiceName = filepath.Base(cwd)
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ServiceName is derived here, but there’s no accompanying gather-stage test coverage to ensure it’s populated correctly (including the worktree OriginalCwd case) and only when the widget is active. Adding a focused test in internal/gather would prevent regressions in the default layout behavior.

Suggested change
ctx.ServiceName = filepath.Base(cwd)
if cwd != "" {
ctx.ServiceName = filepath.Base(cwd)
}

Copilot uses AI. Check for mistakes.
Comment on lines +23 to +26
run: go test ./... -count=1

- name: Test (race)
run: go test -race ./... -count=1
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow runs go test ./... (and -race) but the current test suite includes at least one environment-dependent test that will fail on GitHub runners (e.g. internal/gather/gather_test.go uses /Users/kyle/Code/my-projects/vitals and expects it to be a real git repo). This will cause CI to fail for every PR until those tests are rewritten to use a temp git repo fixture (or skipped/guarded appropriately).

Suggested change
run: go test ./... -count=1
- name: Test (race)
run: go test -race ./... -count=1
run: go list ./... | grep -v '/internal/gather' | xargs go test -count=1
- name: Test (race)
run: go list ./... | grep -v '/internal/gather' | xargs go test -race -count=1

Copilot uses AI. Check for mistakes.
Comment on lines 41 to +46
"model": {Fg: "87", Bg: ""}, // cyan
"context": {Fg: "42", Bg: ""}, // green (normal usage)
"directory": {Fg: "110", Bg: ""},
"git": {Fg: "87", Bg: ""}, // cyan
"project": {Fg: "75", Bg: ""}, // blue
"duration": {Fg: "244", Bg: ""},
"tools": {Fg: "75", Bg: ""},
"agents": {Fg: "114", Bg: ""},
"todos": {Fg: "220", Bg: ""},
"cost": {Fg: "87", Bg: ""},
"project": {Fg: "75", Bg: ""}, // blue
"duration": {Fg: "244", Bg: ""},
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A new service widget is now part of the default layout, but none of the built-in themes define colors for the service key. In powerline mode this will fall back to DefaultPowerlineBg (236) and can break the “distinct background per segment” goal described in the theme comments. Add a service entry (fg and, for powerline themes, a distinct bg) to each built-in theme map.

Copilot uses AI. Check for mistakes.
Comment on lines +22 to +24
// When the service widget is active or we're in a worktree, the directory
// name is handled elsewhere — just show branch info.
if ctx.WorktreeName != "" || ctx.ServiceName != "" {
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function-level doc comment still states that only worktrees suppress the directory portion, but the implementation now also suppresses it when ServiceName is set (service widget active). Please update the doc comment above Project to reflect the new behavior so callers/tests aren’t misled.

Copilot uses AI. Check for mistakes.
Comment on lines +8 to +21
// Service renders the repository name (e.g. "vitals") so the user always
// knows which project they are working in. Returns empty when the name
// is not available.
func Service(ctx *model.RenderContext, cfg *config.Config) WidgetResult {
if ctx.ServiceName == "" {
return WidgetResult{}
}
icons := IconsFor(cfg.Style.Icons)
plain := icons.Folder + " " + ctx.ServiceName
return WidgetResult{
Text: dirStyle.Render(plain),
PlainText: plain,
FgColor: "13",
}
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new service widget introduces user-visible behavior (repo basename formatting and icon prefix) but doesn’t appear to have direct unit tests. Consider adding widget-level tests (similar to other widgets in this package) to assert: empty when ServiceName is empty, correct PlainText/Text when set, and behavior across icon modes.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants