Skip to content

[plan] Migrate charmbracelet/bubbles to v2 in pkg/console #21516

@github-actions

Description

@github-actions

Objective

Migrate pkg/console/ from charmbracelet/bubbles v1 to v2 (charm.land/bubbles/v2), fixing the 3 known breaking changes.

Context

charmbracelet/bubbles v2.0.0 was released 2026-02-24 and has a new import path. The project currently uses v1.0.0 across 3 files in pkg/console/. This is part of the Charm v2 ecosystem upgrade (alongside bubbletea and lipgloss v2).

Source: Discussion #21351 — Go Fan report on charmbracelet/bubbles.

Approach

  1. Update go.mod / go.sum to use charm.land/bubbles/v2 (new module path)
  2. Update all import paths in pkg/console/ from github.com/charmbracelet/bubbles/... to charm.land/bubbles/v2/...
  3. Fix the 3 breaking changes (see below)
  4. Run make fmt && make test-unit to validate

Breaking Changes to Fix

1. pkg/console/progress.goWithScaledGradient renamed (≈line 53)

// v1 (current)
prog := progress.New(
    progress.WithScaledGradient("#BD93F9", "#8BE9FD"),
    progress.WithWidth(40),
)

// v2 fix — use image/color.Color values
import "image/color"
// ...
prog := progress.New(
    progress.WithColors(color.RGBA{...}, color.RGBA{...}),
    progress.WithScaled(true),
    progress.WithWidth(40),
)

2. pkg/console/progress.goEmptyColor field type change (≈line 58)

// v1 (current) — string assignment
prog.EmptyColor = "#6272A4"

// v2 fix — requires image/color.Color
prog.EmptyColor = color.RGBA{98, 114, 164, 255}  // #6272A4 as RGBA

3. pkg/console/list.goFilterPrompt/FilterCursor consolidated (≈lines 166–170)

// v1 (current)
l.Styles.FilterPrompt = lipgloss.NewStyle().Foreground(styles.ColorInfo)
l.Styles.FilterCursor = lipgloss.NewStyle().Foreground(styles.ColorSuccess)

// v2 fix — consult UPGRADE_GUIDE_V2.md; these are now part of Styles.Filter (a textinput.Styles)
// See: https://github.com/charmbracelet/bubbles/blob/main/UPGRADE_GUIDE_V2.md

Files to Modify

  • go.mod — update import path
  • go.sum — updated automatically via go mod tidy
  • pkg/console/progress.go — 2 breaking changes
  • pkg/console/list.go — 1 breaking change
  • pkg/console/spinner.go — update import path (no API changes expected)

Notes

  • Check if bubbletea and lipgloss v2 are already on v2 in go.mod; the Charm v2 ecosystem components should ideally be upgraded together
  • Consult the Bubbles v2 Upgrade Guide for exact migration steps for each component
  • All components are TTY-gated; non-TTY fallbacks should remain unchanged

Acceptance Criteria

  • go.mod uses charm.land/bubbles/v2
  • All 3 breaking changes fixed
  • make fmt && make test-unit pass
  • Spinner, progress bar, and list still function correctly in TTY environments

Generated by Plan Command for issue #discussion #21351 ·

  • expires on Mar 20, 2026, 2:47 AM UTC

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions