Conversation
There was a problem hiding this comment.
Pull request overview
Migrates the TUI/CLI rendering stack to Charm’s v2 module paths (charm.land/*/v2), updates the UI layer to Bubble Tea v2’s KeyPressMsg + declarative tea.View, replaces the color system with v2-native color.Color resolution, and adds terminal OS-focus-aware adaptive polling to reduce background network activity.
Changes:
- Upgrade Bubble Tea/Bubbles/Lip Gloss imports to
charm.land/*/v2and update key/paste handling to v2 message types (KeyPressMsg,PasteMsg). - Replace
lipgloss.AdaptiveColorwith a resolvedcolor.Colortheme model usinglipgloss.LightDark(...), with runtime background detection (BackgroundColorMsg/HasDarkBackground). - Implement terminal focus-aware polling (4× interval when blurred) and poll generation tokens to prevent overlapping timer chains.
Reviewed changes
Copilot reviewed 102 out of 103 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| internal/tui/workspace/workspace_test.go | Updates workspace tests for v2 key messages, tea.View, and adds focus/polling/background detection coverage. |
| internal/tui/workspace/workspace.go | Migrates Workspace to Bubble Tea v2 (tea.View, KeyPressMsg), adds background-color handling, focus propagation, and window-title plumbing. |
| internal/tui/workspace/widget/util.go | Switches lipgloss import to v2 module path. |
| internal/tui/workspace/widget/split.go | Switches lipgloss import to v2 module path. |
| internal/tui/workspace/widget/preview.go | Switches lipgloss import to v2 module path. |
| internal/tui/workspace/widget/list_test.go | Updates list widget tests to KeyPressMsg and v2 imports. |
| internal/tui/workspace/widget/list.go | Migrates list widget input handling to KeyPressMsg and v2 imports. |
| internal/tui/workspace/widget/kanban_test.go | Uses lipgloss.Width for ANSI-aware width assertions under v2. |
| internal/tui/workspace/widget/kanban.go | Converts kanban column colors to resolved color.Color via lipgloss.LightDark. |
| internal/tui/workspace/widget/composer_test.go | Updates composer tests for KeyPressMsg. |
| internal/tui/workspace/widget/composer.go | Migrates composer to v2 inputs and updates sizing APIs (e.g., SetWidth). |
| internal/tui/workspace/views/todos_test.go | Updates Todos view tests for KeyPressMsg. |
| internal/tui/workspace/views/todos.go | Migrates Todos view to return workspace.View and handle KeyPressMsg. |
| internal/tui/workspace/views/timeline_test.go | Adds tests for poll generation token behavior. |
| internal/tui/workspace/views/timeline.go | Adds pollGen and gates PollMsg handling by generation; reschedules on terminal focus. |
| internal/tui/workspace/views/search_test.go | Updates Search view tests for v2 textinput APIs + KeyPressMsg. |
| internal/tui/workspace/views/search.go | Migrates Search view to v2 inputs and return type; updates textinput sizing API usage. |
| internal/tui/workspace/views/schedule_test.go | Updates Schedule tests for KeyPressMsg. |
| internal/tui/workspace/views/schedule.go | Migrates Schedule view to v2 inputs and return type. |
| internal/tui/workspace/views/pulse.go | Migrates Pulse view to v2 inputs and return type. |
| internal/tui/workspace/views/projects_test.go | Updates Projects tests for KeyPressMsg. |
| internal/tui/workspace/views/projects.go | Migrates Projects view key handling to KeyPressMsg and workspace.View. |
| internal/tui/workspace/views/pings.go | Migrates Pings view to v2 inputs and return type. |
| internal/tui/workspace/views/people.go | Migrates People view to v2 inputs and return type. |
| internal/tui/workspace/views/mystuff.go | Migrates MyStuff view to v2 inputs and return type. |
| internal/tui/workspace/views/messages_test.go | Updates Messages tests for KeyPressMsg. |
| internal/tui/workspace/views/messages.go | Migrates Messages view to v2 inputs and return type. |
| internal/tui/workspace/views/home_test.go | Updates Home view tests for KeyPressMsg. |
| internal/tui/workspace/views/home.go | Migrates Home view to v2 inputs and return type. |
| internal/tui/workspace/views/hints.go | Switches bubbles/key import to v2 module path. |
| internal/tui/workspace/views/hey_test.go | Adds poll generation token tests; updates keys to KeyPressMsg. |
| internal/tui/workspace/views/hey.go | Adds pollGen gating and rescheduling on terminal focus; migrates to v2 messages. |
| internal/tui/workspace/views/forwards.go | Migrates Forwards view to v2 inputs and return type. |
| internal/tui/workspace/views/docsfiles_test.go | Updates DocsFiles tests for KeyPressMsg. |
| internal/tui/workspace/views/docsfiles.go | Migrates DocsFiles to v2 inputs/return type; updates escape/backspace handling and blink cmd. |
| internal/tui/workspace/views/dock_test.go | Updates Dock tests for KeyPressMsg. |
| internal/tui/workspace/views/dock.go | Migrates Dock view to v2 inputs and return type. |
| internal/tui/workspace/views/detail_test.go | Updates Detail tests for KeyPressMsg. |
| internal/tui/workspace/views/detail.go | Migrates Detail to v2 inputs/return type and switches paste handling to tea.PasteMsg. |
| internal/tui/workspace/views/compose_test.go | Updates Compose tests for v2 KeyPressMsg and textinput width API. |
| internal/tui/workspace/views/compose.go | Migrates Compose to v2 inputs/return type and paste handling with tea.PasteMsg. |
| internal/tui/workspace/views/checkins_test.go | Updates Checkins tests for KeyPressMsg. |
| internal/tui/workspace/views/checkins.go | Migrates Checkins view to v2 inputs and return type. |
| internal/tui/workspace/views/cards_test.go | Updates Cards tests for KeyPressMsg. |
| internal/tui/workspace/views/cards.go | Migrates Cards view to v2 inputs/return type. |
| internal/tui/workspace/views/campfire_test.go | Updates viewport construction and adds poll generation token tests. |
| internal/tui/workspace/views/campfire.go | Migrates Campfire to v2 viewport API, KeyPressMsg, PasteMsg, and poll generation gating. |
| internal/tui/workspace/views/assignments_test.go | Updates Assignments tests for KeyPressMsg. |
| internal/tui/workspace/views/assignments.go | Migrates Assignments view to v2 inputs and return type. |
| internal/tui/workspace/views/activity_test.go | Adds poll generation token tests and terminal focus bump coverage. |
| internal/tui/workspace/views/activity.go | Adds pollGen gating and rescheduling on terminal focus; migrates to v2 inputs/return type. |
| internal/tui/workspace/view.go | Redefines workspace View interface (decoupled from tea.Model) for v2 semantics. |
| internal/tui/workspace/session.go | Adds dark-background state + thread-safe theme reload; updates Hub construction API. |
| internal/tui/workspace/router_test.go | Updates mock view to the new workspace.View interface. |
| internal/tui/workspace/msg.go | Adds TerminalFocusMsg for focus-triggered poll rescheduling. |
| internal/tui/workspace/keymap.go | Switches bubbles/key import to v2 module path. |
| internal/tui/workspace/data/realm.go | Persists terminal-focused state and applies it to newly registered pools. |
| internal/tui/workspace/data/pool_test.go | Adds coverage for terminal-focused polling interval behavior. |
| internal/tui/workspace/data/pool.go | Adds terminal focus state to polling interval computation and exposes SetTerminalFocused. |
| internal/tui/workspace/data/poller.go | Removes old Poller implementation; extends PollMsg with Gen for view-side gating. |
| internal/tui/workspace/data/mutation_test.go | Switches bubbletea import to v2 module path. |
| internal/tui/workspace/data/mutation.go | Switches bubbletea import to v2 module path. |
| internal/tui/workspace/data/keyed_pool_test.go | Adds coverage for fanning out terminal focus to keyed sub-pools. |
| internal/tui/workspace/data/keyed_pool.go | Implements SetTerminalFocused fan-out for keyed pools. |
| internal/tui/workspace/data/hub_test.go | Updates Hub construction API and adds terminal focus propagation tests. |
| internal/tui/workspace/data/hub.go | Removes Poller dependency; adds terminal focus propagation across realms/pools. |
| internal/tui/workspace/chrome/toast.go | Switches imports to v2 module paths. |
| internal/tui/workspace/chrome/title.go | Replaces v1 window-title cmd with internal WindowTitleMsg to drive tea.View.WindowTitle. |
| internal/tui/workspace/chrome/statusbar_test.go | Switches imports to v2 module paths. |
| internal/tui/workspace/chrome/statusbar.go | Switches imports to v2 module paths. |
| internal/tui/workspace/chrome/quickjump_test.go | Updates for v2 textinput width API. |
| internal/tui/workspace/chrome/quickjump.go | Migrates quickjump key handling to KeyPressMsg and v2 APIs. |
| internal/tui/workspace/chrome/palette_test.go | Updates tests for KeyPressMsg. |
| internal/tui/workspace/chrome/palette.go | Migrates palette key handling to KeyPressMsg and v2 APIs. |
| internal/tui/workspace/chrome/metrics_panel.go | Switches lipgloss import to v2 module path. |
| internal/tui/workspace/chrome/help_test.go | Updates tests for KeyPressMsg and ctrl-mod key representation. |
| internal/tui/workspace/chrome/help.go | Migrates help overlay Update signature to KeyPressMsg. |
| internal/tui/workspace/chrome/breadcrumb_test.go | Switches lipgloss import to v2 module path. |
| internal/tui/workspace/chrome/breadcrumb.go | Switches bubbletea/lipgloss imports to v2 module paths. |
| internal/tui/workspace/chrome/account_switcher_test.go | Updates tests for KeyPressMsg. |
| internal/tui/workspace/chrome/account_switcher.go | Migrates digit-key selection to KeyPressMsg.Text and v2 imports. |
| internal/tui/workspace/boostpicker.go | Migrates boost picker to KeyPressMsg and v2 textinput width API. |
| internal/tui/workspace/actions_test.go | Switches bubbletea import to v2 module path. |
| internal/tui/workspace/actions.go | Switches bubbletea import to v2 module path. |
| internal/tui/theme_test.go | Updates theme tests for resolved color.Color values and new dark-detection API. |
| internal/tui/theme.go | Introduces DetectDark() and makes theme resolution background-aware. |
| internal/tui/styles.go | Changes Theme fields to color.Color and resolves colors at construction time. |
| internal/tui/spinner.go | Migrates spinner model to tea.View and KeyPressMsg; updates color types. |
| internal/tui/resolve/comment_thread.go | Switches lipgloss import to v2 module path. |
| internal/tui/picker_test.go | Updates picker tests for KeyPressMsg. |
| internal/tui/picker.go | Migrates picker models to return tea.View and sets view flags instead of program options. |
| internal/tui/paginated_picker.go | Migrates paginated picker to tea.View / KeyPressMsg and removes program alt-screen option. |
| internal/presenter/render.go | Switches lipgloss import to v2 and uses resolved theme colors directly. |
| internal/presenter/present.go | Resolves theme using DetectDark() instead of implicit adaptive colors. |
| internal/output/render.go | Switches lipgloss imports to v2 and resolves theme via DetectDark(). |
| internal/commands/wizard.go | Resolves theme using DetectDark() for interactive wizard styling. |
| internal/commands/tui.go | Removes program options; relies on tea.View flags from Workspace for alt screen/mouse/focus. |
| internal/commands/timeline.go | Migrates to v2 bubbletea, returns tea.View, and relies on view flags for alt screen. |
| internal/commands/doctor.go | Switches lipgloss import to v2 module path. |
| internal/commands/commands.go | Switches lipgloss import to v2 module path and adjusts muted style. |
| internal/commands/auth.go | Resolves theme using DetectDark() for renderer creation. |
| go.sum | Adds charm.land v2 module checksums and dependency updates. |
| go.mod | Adds charm.land v2 module requirements; demotes old charmbracelet modules to indirect. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Three Charm libraries upgraded simultaneously: - charm.land/bubbletea/v2 - charm.land/lipgloss/v2 - charm.land/bubbles/v2 Key changes: Import paths: github.com/charmbracelet/* → charm.land/*/v2 View interface: workspace.View no longer embeds tea.Model. Update() returns (View, tea.Cmd) instead of (tea.Model, tea.Cmd). Only top-level models (Workspace, spinnerModel, picker, watchModel) return tea.View from View(). Declarative View: Alt screen, mouse mode, and window title move from tea.NewProgram() options to tea.View struct fields set in View(). KeyMsg → KeyPressMsg: All key handling uses tea.KeyPressMsg with msg.Code instead of msg.Type, and msg.Text instead of msg.Runes. Paste handling uses separate tea.PasteMsg. Color system: lipgloss.AdaptiveColor replaced with v2-native lipgloss.LightDark(dark). Theme fields are now color.Color, resolved at construction time. Background detection uses tea.BackgroundColorMsg at runtime (TUI) or lipgloss.HasDarkBackground (CLI). lipgloss.TerminalColor removed — all color references use color.Color.
When the terminal window loses OS focus, poll intervals are extended 4× to reduce unnecessary background network activity. On refocus, polls reschedule immediately at normal intervals. Architecture: - Pool gains terminalFocused field with 4× multiplier in pollInterval() - Pooler interface extended with SetTerminalFocused(bool) - Realm, KeyedPool, Hub propagate terminal focus to all registered pools - Hub persists state so newly created realms/pools inherit it Workspace wiring: - View().ReportFocus = true enables tea.FocusMsg / tea.BlurMsg - tea.FocusMsg: Hub.SetTerminalFocused(true) + forward TerminalFocusMsg to current view and sidebar (epoch-stamped) - tea.BlurMsg: Hub.SetTerminalFocused(false) Poll generation tokens prevent parallel timer chains: - Each polling view tracks pollGen uint64 - schedulePoll() increments gen and embeds it in PollMsg - PollMsg handler checks msg.Gen == v.pollGen, drops stale ticks Removes legacy Poller type (replaced by Pool-integrated polling). Session mutex protects hasDarkBG for thread-safe background detection (SetDarkBackground + ReloadTheme).
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 797cce30af
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
KeyedPool.SetTerminalFocused() updated existing pools but didn't persist the state. New sub-pools created via Get() after a blur event started with terminalFocused=true, resuming foreground-rate polling while the terminal was still unfocused. Add terminalFocused field to KeyedPool, persist it in SetTerminalFocused(), and apply it to newly created sub-pools in Get().
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 102 out of 103 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
bubbletea,lipgloss, andbubblesto their v2 modules oncharm.land. Import paths, key handling (KeyPressMsg), declarativeView(), paste handling, and the color system all updated.lipgloss.AdaptiveColorwithlipgloss.LightDark(dark). Theme fields are nowcolor.Color, resolved at construction time. Background detection usestea.BackgroundColorMsgat runtime (TUI) orlipgloss.HasDarkBackground()(CLI).96 files changed across two atomic commits:
Migrate to Bubble Tea v2 with v2-native color system— mechanical migration + color cutoverAdd terminal focus-aware adaptive polling (M1.1)— new v2 feature adoptionTest plan
make checkpasses (fmt, vet, lint, unit tests, e2e tests, tidy, provenance)TestSession_DarkBackgroundThreadSafety)basecamp tui— alt screen, keys, paste, toast, boost picker, navigationbasecamp timeline watch— alt screen, polling, quit