Skip to content

Bubbletea v1 to v2 migration - #1076

Open
NishchayRajput wants to merge 6 commits into
goharbor:mainfrom
NishchayRajput:feat/bubble-tea-migration
Open

Bubbletea v1 to v2 migration#1076
NishchayRajput wants to merge 6 commits into
goharbor:mainfrom
NishchayRajput:feat/bubble-tea-migration

Conversation

@NishchayRajput

Copy link
Copy Markdown
Contributor

Description

Briefly describe what this pull request does and why the change is needed.
The goal is to preserve current Harbor CLI behavior while aligning the codebase with the Charm v2 ecosystem.
The migration affects four main areas:

  1. Dependency and import path migration
  2. Bubble Tea model contract changes
  3. Bubble Tea and Bubbles behavior changes in shared base views
  4. Huh form migration to the v2 API and v2 Lip Gloss types

Type of Change

Please select the relevant type.

  • Bug fix
  • New feature
  • Refactor
  • Documentation update
  • Chore / maintenance

Changes

Signed-off-by: Nishchay Rajput <nishchayr@iitbhilai.ac.in>
Signed-off-by: Nishchay Rajput <nishchayr@iitbhilai.ac.in>
Signed-off-by: Nishchay Rajput <nishchayr@iitbhilai.ac.in>
Signed-off-by: Nishchay Rajput <nishchayr@iitbhilai.ac.in>
Signed-off-by: Nishchay Rajput <nishchayr@iitbhilai.ac.in>
@codecov

codecov Bot commented Aug 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 126 lines in your changes missing coverage. Please review.
✅ Project coverage is 9.58%. Comparing base (60ad0bd) to head (a58d6cf).
⚠️ Report is 197 commits behind head on main.

Files with missing lines Patch % Lines
pkg/views/base/multiselect/model.go 0.00% 17 Missing ⚠️
pkg/views/base/selection/model.go 0.00% 9 Missing ⚠️
cmd/harbor/root/robot/update.go 0.00% 6 Missing ⚠️
pkg/views/base/tablegrid/model.go 0.00% 6 Missing ⚠️
pkg/views/base/tablelist/model.go 0.00% 6 Missing ⚠️
pkg/views/project/select/view.go 0.00% 4 Missing ⚠️
pkg/views/robot/select/view.go 0.00% 4 Missing ⚠️
cmd/harbor/root/robot/create.go 0.00% 3 Missing ⚠️
pkg/views/scanner/metadata/view.go 0.00% 3 Missing ⚠️
pkg/views/artifact/select/view.go 0.00% 2 Missing ⚠️
... and 47 more
Additional details and impacted files
@@            Coverage Diff            @@
##             main   #1076      +/-   ##
=========================================
- Coverage   10.99%   9.58%   -1.41%     
=========================================
  Files         173     322     +149     
  Lines        8671   16165    +7494     
=========================================
+ Hits          953    1549     +596     
- Misses       7612   14481    +6869     
- Partials      106     135      +29     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Nishchay Rajput <nishchayr@iitbhilai.ac.in>
@qcserestipy
qcserestipy self-requested a review August 11, 2026 13:09
@qcserestipy

Copy link
Copy Markdown
Collaborator

@NishchayRajput Thank you for taking this on. The mechanical migration looks consistent, and moving alt screen into the view state is exactly how v2 intends it.

Testing against the demo Harbor instance surfaced two regressions, both in shared base views (so two fixes cover all call sites). Both have the same root cause: v2 clips to the terminal cell buffer, while v1 flushed the final frame regardless of size.

  1. tablegrid renders blank (robot create permission grid): tablegrid.New never sets table.WithWidth(...). In bubbles v2 the table's viewport defaults to width 0 and renders "". Fix: compute the width from the columns and pass table.WithWidth(tableWidth), same as tablelist/model.go already does.

  2. tablelist cuts tall tables and leaks escape codes (project list etc., 44 files): these views quit in Init(), so v2 clips the frame to terminal height, and the startup terminal queries (DECRQM) land in the shell as garbage (2026;2$y...). Fix: skip tea.NewProgram for these print-once views and use the pattern this PR already applies in info.go:

    fmt.Println(m.View().Content)

For verification, one command per base class covers everything: project list, artifact list, robot create, login. selection already looks correct.

Follow-up material, fine to defer: pkg/views/base/multiselect is now dead code, and tablegrid could scroll instead of clip via WindowSizeMsg.

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