Skip to content

feat(ui): refactor progress UI with spectrum springs and modular rendering#46

Merged
flexiondotorg merged 11 commits into
mainfrom
bling
Jun 7, 2026
Merged

feat(ui): refactor progress UI with spectrum springs and modular rendering#46
flexiondotorg merged 11 commits into
mainfrom
bling

Conversation

@flexiondotorg
Copy link
Copy Markdown
Contributor

  • Extract spectrum bar rendering with harmonica spring dynamics into spectrum.go
  • Extract completion summary rendering with lipgloss tables into summary.go
  • Refactor progress model to decouple animation tick from data updates
  • Add help footer and quit key bindings (Bubbletea v2 integration)
  • Enhance theme with go-colorful Lab colour ramps for smooth gradients
  • Improve CLI help layout using lipgloss tables for consistent alignment
  • Add comprehensive test suites for progress, spectrum, summary, help, and theme
  • Add optional --harmonica-caps flag for spring-based bar dynamics

…ering

- Extract spectrum bar rendering with harmonica spring dynamics into
  spectrum.go
- Extract completion summary rendering with lipgloss tables into
  summary.go
- Refactor progress model to decouple animation tick from data updates
- Add help footer and quit key bindings (Bubbletea v2 integration)
- Enhance theme with go-colorful Lab colour ramps for smooth gradients
- Improve CLI help layout using lipgloss tables for consistent alignment
- Add comprehensive test suites for progress, spectrum, summary, help,
  and theme
- Add optional --harmonica-caps flag for spring-based bar dynamics

Signed-off-by: Martin Wimpress <code@wimpress.io>
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 12 files

Confidence score: 4/5

  • This PR looks safe to merge overall, with one moderate UI-state concern rather than a functional or security break.
  • In internal/ui/progress.go, reusing the same animated progress model across phases can render stale analysis progress via View(), which may briefly show misleading progress to users.
  • The reported issue is severity 4/10 with high confidence, so risk appears limited and mostly user-facing (presentation/state reset behavior).
  • Pay close attention to internal/ui/progress.go - ensure phase transitions reset or isolate progress model state before rendering.

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread internal/ui/progress.go Outdated
…elper

- Consolidate fire-gradient progress bar creation (40-wide main, 30-wide
  summary) into shared `newProgressBar` helper
- Recreate progress bar on AnalysisComplete transition to reset fill
  target to 0, preventing animation down from Pass 1's ~100% on first
  Pass 2 percent update
- Preserve width across bar recreation for consistency
- Add TestAnalysisCompleteResetsProgressBar guard test to verify bar
  target resets and width is preserved

Signed-off-by: Martin Wimpress <code@wimpress.io>
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

0 issues found across 2 files (changes from recent commits).

Requires human review: This PR is a substantial refactor of the progress UI with new harmonica spring dynamics, new dependencies, extracted rendering modules, and CLI changes—despite thorough tests, the scope (2000+ lines) and risk of breaking the real-time encoding UI animation or introducing physics bugs warrant a...

Re-trigger cubic

- Define harmonicaGain constant (2.0) to lift spring bars toward CAVA
  path steady-state amplitude
- Apply gain when processing spectrum heights to preserve dynamic range
  vs. flattening peaks
- Add detailed comment explaining leaky integrator compensation and
  soft-knee interaction

Signed-off-by: Martin Wimpress <code@wimpress.io>
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

0 issues found across 1 file (changes from recent commits).

Requires human review: This is a substantial refactor (2022 lines) that modifies core UI animation logic, adds new dependencies, and restructures rendering paths, with changes to the hot loop and output layout that warrant human review to ensure no regressions in the encoding pipeline.

Re-trigger cubic

Replace the optional CAVA-style smoother (gated by --harmonica-caps)
with harmonica spring peak-hold as the universal bar animation system.
Remove CAVA constants and the now-unnecessary CLI flag. Simplify Pass 2
bar dynamics to always use instant peak rise and spring-driven fallback.
Update all documentation to reflect spring-driven bar behaviour.

Signed-off-by: Martin Wimpress <code@wimpress.io>
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

0 issues found across 8 files (changes from recent commits).

Requires human review: This PR replaces the CAVA bar animation algorithm with a new harmonica spring-based system in the core rendering loop, which is a significant behavioral change to the visual output and touches the encoder pipeline, so human review is warranted to validate visual quality, performance, and ensure...

Re-trigger cubic

…s and metrics

- Add boxDesignWidth constant (80 cells) for consistent bordered box
  widths
- Extract boxContentWidth() method to apply shared width across all UI
  cards
- Implement speedHistory tracking for realtime speed sparkline in Speed
  card
- Create new widgets.go module with sparkline() and gaugeCard() helpers
- Refactor audio profile rendering with meter constants and aligned
  metric columns
- Update progress.go with Width() styling for final and rendering
  progress boxes
- Fix spectrum width calculation to respect box content boundaries

Signed-off-by: Martin Wimpress <code@wimpress.io>
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 6 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread internal/ui/widgets.go Outdated
…ring

Remove redundant "Progress: " and "Progress " labels from progress
output; consolidate audio profile rendering to summary card only. Trim
extra newlines from spinner messages to reduce vertical spacing.

Signed-off-by: Martin Wimpress <code@wimpress.io>
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

0 issues found across 5 files (changes from recent commits).

Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.

Re-trigger cubic

- Add Size gauge card (with compact unit glyphs) to rendering progress
  metrics
- Raise spectrum spring frequency from 8.0 to 15.0 for livelier bar
  tracking
- Apply gamma curve to spectrum colours so mid-level bars show warm
  orange
- Resample spectrum bars with exact width mapping (support upsampling
  and downsampling)
- Adjust gauge card widths to fit four metrics plus separators in box
  content area
- Add tests for spectrum column count invariant and preview box width
  alignment

Signed-off-by: Martin Wimpress <code@wimpress.io>
- Pass encoder name through RenderProgress message
- Add EncoderName field to display live FFmpeg encoder during rendering
- Refactor progress row to use writeProgressRow helper for consistent
  right-aligned percentage
- Replace fixed film glyph with animated spinner in frame/source line
- Right-align codec info (video with bracketed encoder, audio) to cards
  row width
- Remove audio duration glyph from rendering summary
- Switch progress bar to fixed design width (78 cells) for stable layout
- Update progress bar width to account for reserved 5-cell percentage
  field
- Add test coverage for progress row alignment and codec line layout

Signed-off-by: Martin Wimpress <code@wimpress.io>
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

0 issues found across 6 files (changes from recent commits).

Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.

Re-trigger cubic

…nished pass 2 box

- Extract codecInfo and writeFrameLine helpers to unify frame line
  rendering
- Add finalCardWidth constant and gaugeCard-based metrics (Time, Speed,
  Size, Duration)
- Move encoder, source duration, and file size from summary into
  finished progress box
- Replace zeroed spectrum with static cards row in final progress
  display
- Remove now-redundant rows from summary output

Signed-off-by: Martin Wimpress <code@wimpress.io>
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

0 issues found across 3 files (changes from recent commits).

Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.

Re-trigger cubic

Strip redundant label text from preview and spectrum rendering to reduce
visual clutter.

Signed-off-by: Martin Wimpress <code@wimpress.io>
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

0 issues found across 2 files (changes from recent commits).

Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.

Re-trigger cubic

Change blockClamp to accept block array length as parameter, enabling
reuse across spectrum and sparkline rendering without duplication.

Signed-off-by: Martin Wimpress <code@wimpress.io>
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

0 issues found across 2 files (changes from recent commits).

Auto-approved: Input is already valid JSON and matches the schema; no changes are required.

Re-trigger cubic

@flexiondotorg flexiondotorg merged commit 691a2b7 into main Jun 7, 2026
16 checks passed
@flexiondotorg flexiondotorg deleted the bling branch June 7, 2026 15:24
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.

1 participant