Skip to content

feat(tui): restyle board press CTA as a bordered chip#184

Merged
bobakemamian merged 1 commit into
mainfrom
tui/press-button-chip
Jun 22, 2026
Merged

feat(tui): restyle board press CTA as a bordered chip#184
bobakemamian merged 1 commit into
mainfrom
tui/press-button-chip

Conversation

@bobakemamian

@bobakemamian bobakemamian commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

What

Restyles the board's primary press call-to-action from a flat, borderless white pill to a bordered chip (no background fill), so it matches the pinned-card border treatment and reads as a real button.

Before / after (golden snapshot):

-     press
+  ┌─────────┐
+  │  press  │
+  └─────────┘

Why

  • The chip border matches the pinned-card treatment, making the CTA read as an actual button.
  • The border + background-fill combo is deliberately avoided — it previously produced a visible render gap where the border met the fill on some terminals.

Changes

  • styles.go: ActionPrimary → primary-foreground + NormalBorder() (no bg fill), padding 0,2. ActionPrimaryDisabled → muted border instead of a chip background.
  • board.go: footerHeight 1 → 3 (border adds top/bottom rows); press width recomputed as label + padding + border.
  • Regenerated the 7 affected board/footer golden snapshots.

Testing

  • go build
  • go test ./... ✅ (full suite green, including regenerated TUI snapshots)
  • go vet ./internal/tui/...

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • Style
    • Updated primary action buttons from flat pill to bordered style with adjusted spacing and visual definition
    • Redesigned the press button to display within a bordered box, improving interface visual clarity
    • Adjusted footer region sizing and layout parameters to properly accommodate the new bordered button styling across all TUI screens

Swap the board's primary "press" call-to-action from a flat,
borderless white pill to a bordered chip (no background fill) so it
matches the pinned-card border treatment and reads as a real button.
Avoid the border + background-fill combo, which previously produced a
visible render gap where the border met the fill on some terminals.

Layout updated to match: footerHeight 1->3 (border adds top/bottom
rows) and the press width recomputed as label + padding + border.
ActionPrimaryDisabled gets a muted border instead of a chip fill.

Regenerate the 7 affected board/footer golden snapshots.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

ActionPrimary and ActionPrimaryDisabled styles in BuildStyles() are converted from flat filled pills to bordered lipgloss styles. computeLayout in board.go adjusts footerHeight to 3 and recalculates the pressW/pressX hitbox for the new border dimensions. Seven golden TUI snapshots are regenerated to match the bordered chip rendering.

Changes

Bordered press chip

Layer / File(s) Summary
ActionPrimary bordered style definitions
internal/tui/styles.go
ActionPrimary now uses c.primary foreground with BorderForeground and padding(0,2) instead of a hex-color background fill; ActionPrimaryDisabled uses NormalBorder() with c.muted border foreground and padding(0,2) instead of Background(c.chipBg) and padding(0,3).
Footer height and pressW hitbox sizing
internal/tui/board.go
footerHeight changed from 1 to 3 rows and pressW recalculated using the bordered padding+border model, updating the pressX0/pressX1 click region in computeLayout.
Golden snapshot updates
internal/tui/testdata/board_*.golden, internal/tui/testdata/logs_tailing.golden
All affected snapshots replace the single-line "press" hint with a three-line bordered ASCII box matching the new chip rendering.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 A border appeared where flatness once lay,
Three rows tall now, hooray hooray!
The pill grew its frame,
The hitbox reclaimed,
And golden files captured the day! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(tui): restyle board press CTA as a bordered chip' accurately and concisely summarizes the main change: converting the press button from a flat pill to a bordered chip design.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 tui/press-button-chip

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
internal/tui/board.go (1)

904-905: ⚡ Quick win

Derive press hitbox width from rendered style instead of hardcoding constants.

pressW := 5 + 4 + 2 duplicates style assumptions (label length, padding, border). If ActionPrimary padding/border or label text changes, click hit-testing can drift from what users see.

Suggested change
-	// Press chip width = label("press" = 5) + padding(4) + border(2).
-	pressW := 5 + 4 + 2
+	// Keep hitbox in sync with the rendered chip style.
+	pressW := lipgloss.Width(m.styles.ActionPrimary.Render("press"))
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/tui/board.go` around lines 904 - 905, The pressW variable is
hardcoded with magic number constants (5 + 4 + 2) that duplicate style
assumptions about label length, padding, and border from the ActionPrimary
style. Instead of hardcoding these values, derive the pressW width from the
actual rendered style by calculating it from the ActionPrimary component's
dimensions after rendering or by extracting the width from the style
configuration directly. This ensures hit-testing remains synchronized with the
actual visual appearance of the element.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@internal/tui/board.go`:
- Around line 904-905: The pressW variable is hardcoded with magic number
constants (5 + 4 + 2) that duplicate style assumptions about label length,
padding, and border from the ActionPrimary style. Instead of hardcoding these
values, derive the pressW width from the actual rendered style by calculating it
from the ActionPrimary component's dimensions after rendering or by extracting
the width from the style configuration directly. This ensures hit-testing
remains synchronized with the actual visual appearance of the element.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 46a565b7-ef18-4a59-8a53-65edd3d4077b

📥 Commits

Reviewing files that changed from the base of the PR and between 78792a4 and b6851e5.

📒 Files selected for processing (9)
  • internal/tui/board.go
  • internal/tui/styles.go
  • internal/tui/testdata/board_argform_open.golden
  • internal/tui/testdata/board_empty.golden
  • internal/tui/testdata/board_logs_pane_empty.golden
  • internal/tui/testdata/board_pinned_active.golden
  • internal/tui/testdata/board_pinned_row_focused.golden
  • internal/tui/testdata/board_populated_cursor_on_list_1.golden
  • internal/tui/testdata/logs_tailing.golden

@bobakemamian bobakemamian merged commit c986e02 into main Jun 22, 2026
16 of 17 checks passed
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