Skip to content

fix: clean up sidebar component and improve ANSI width handling#40

Merged
cnjack merged 1 commit intomainfrom
fix/tui-render-issue
Apr 24, 2026
Merged

fix: clean up sidebar component and improve ANSI width handling#40
cnjack merged 1 commit intomainfrom
fix/tui-render-issue

Conversation

@cnjack
Copy link
Copy Markdown
Owner

@cnjack cnjack commented Apr 24, 2026

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Fixed notification handler payload processing to correctly enqueue received commands.
    • Improved paste reference expansion to correctly handle all stored paste IDs.
  • Refactor

    • Enhanced terminal text rendering with Unicode Core mode support for better width calculations.
    • Simplified sidebar truncation and alignment logic.
    • Removed unused UI components and styling.
  • Style

    • Updated chat message assistant label to use component-default styling instead of forced monospace font.

Co-authored-by: Copilot <copilot@github.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 24, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ac82ec11-6258-41b5-b334-ac1cde7d27c7

📥 Commits

Reviewing files that changed from the base of the PR and between bda77f2 and 58342e1.

📒 Files selected for processing (8)
  • go.mod
  • internal/channel/ble/ble_cgo.go
  • internal/tui/input_views.go
  • internal/tui/paste_store.go
  • internal/tui/sidebar_component.go
  • internal/tui/styles.go
  • internal/tui/tui.go
  • web/src/components/ChatMessage.vue

📝 Walkthrough

Walkthrough

The PR refactors terminal text handling to enable BubbleTea's Unicode Core mode for improved width calculations, simplifies string truncation logic, removes unused TUI style definitions, cleans up handler implementations, and adjusts viewport alignment. The go-runewidth dependency moves to indirect.

Changes

Cohort / File(s) Summary
Dependency Management
go.mod
Moved go-runewidth from direct to indirect dependency without version change.
TUI Unicode & Truncation
internal/tui/sidebar_component.go, internal/tui/tui.go
Enabled Unicode Core mode in Model.Init; simplified truncation by delegating to ansi.Truncate instead of manual rune width calculations; adjusted viewport-sidebar join logic to use ansi.StringWidth with right-padding.
TUI Styling Cleanup
internal/tui/input_views.go, internal/tui/styles.go
Removed renderTodoBar() method and 7 unused style variables (landingLogoStyle, landingUnderlineStyle, landingTaglineStyle, sidebarStyle, sidebarItemStyle, titleStyle, todoLabelStyle).
Logic & Handler Updates
internal/tui/paste_store.go, internal/channel/ble/ble_cgo.go
Changed ExpandRefs to unconditionally attempt simple reference replacement; updated BLE notification handler to use ReceivedCommand(cmd) constructor.
Web UI
web/src/components/ChatMessage.vue
Removed inline monospace font style from assistant role label.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 With Unicode Core now guiding the way,
We've trimmed the styles and shortened the day!
Rune-width hops indirectly along,
While ansi.Truncate sings a cleaner song. ✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/tui-render-issue

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cnjack cnjack merged commit fdfec4e into main Apr 24, 2026
1 check was pending
@cnjack cnjack deleted the fix/tui-render-issue branch April 24, 2026 15:35
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