Skip to content

fix(app): simplify titlebar worktree badge - #390

Merged
Astro-Han merged 3 commits into
devfrom
pawwork/titlebar-worktree-hover-limit
May 2, 2026
Merged

fix(app): simplify titlebar worktree badge#390
Astro-Han merged 3 commits into
devfrom
pawwork/titlebar-worktree-hover-limit

Conversation

@Astro-Han

@Astro-Han Astro-Han commented May 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • Show only the worktree name in the titlebar worktree badge.
  • Move branch and directory details into a structured three-row hover tooltip.
  • Keep the badge compact with a higher 280px cap and add focused regression coverage.

Why

The titlebar previously combined worktree name and branch in one badge, which repeated information and caused long names to truncate too early. The badge now keeps the titlebar scannable while the tooltip carries the full context.

Related Issue

No linked issue. Reported from local product review.

Human Review Status

Pending. A human should make the final merge decision after reviewing the final diff and verification evidence.

Review Focus

  • Whether the tooltip information order, Worktree / Branch / Location, matches the intended titlebar hierarchy.
  • Whether 280px is the right cap now that the visible badge only shows the worktree name.

Risk Notes

Low. This is a small titlebar UI change with no data, permissions, desktop shell, packaging, updater, signing, or migration impact.

How To Verify

Focused tests: 2 passed, 0 failed for pawwork-worktree-badge.test.tsx
Typecheck: tsgo -b completed successfully in packages/app
Final diff review: only worktree badge component and its focused test changed

Screenshots or Recordings

Not captured in this session. Visible change is covered by focused component tests; manual UI review is still recommended before merge.

Checklist

  • Human review status is stated above as pending, approved, or not required
  • I linked the related issue, or stated why there is no issue
  • This PR has type, scope, and priority labels, or I requested maintainer labeling
  • I described the review focus and any meaningful risks
  • I listed the relevant verification steps and the key result for each
  • I did not introduce unrelated refactors, dependencies, generated files, or file changes beyond the stated scope
  • I manually checked visible UI or copy changes when needed, with screenshots or recordings
  • I considered macOS and Windows impact for desktop, packaging, updater, signing, paths, shell, or permissions changes
  • I called out docs, release notes, dependencies, permissions, credentials, deletion behavior, generated content, or local file changes when relevant
  • I reviewed the final diff for unrelated changes and suspicious dependency changes
  • I am targeting dev, and my PR title and commit messages use Conventional Commits in English

Summary by CodeRabbit

  • New Features

    • Worktree badge now includes a tooltip showing structured rows: Worktree, Branch, Location (with fallbacks).
  • Improvements

    • Badge label selection now prefers the worktree name, then branch/directory, for clearer identification.
    • Button styling tightened for a more compact display and improved tooltip placement/visibility.
  • Tests

    • Updated tests confirm compact label rendering and verify tooltip structure, content, and placement.

@coderabbitai

coderabbitai Bot commented May 2, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: eb67d202-bab8-4b64-b8a2-1740a085454b

📥 Commits

Reviewing files that changed from the base of the PR and between 883afc8 and 1ecd352.

📒 Files selected for processing (2)
  • packages/app/src/pages/layout/pawwork-worktree-badge.test.tsx
  • packages/app/src/pages/layout/pawwork-worktree-badge.tsx

📝 Walkthrough

Walkthrough

PawworkWorktreeBadge replaces title-attribute hover text with a Tooltip wrapper, adds a WorktreeTooltipRow helper, chooses label via name || branch || directory || "Worktree", updates button max-width styling, and updates tests to mock Tooltip and assert the structured tooltip and visible label.

Changes

Worktree Badge Tooltip Upgrade

Layer / File(s) Summary
Data / Helper
packages/app/src/pages/layout/pawwork-worktree-badge.tsx
Adds WorktreeTooltipRow helper that renders a labeled row and defaults missing values to "Not available"; supports emphasis styling for the Worktree row.
Core Implementation
packages/app/src/pages/layout/pawwork-worktree-badge.tsx
Replaces title-based label with label() selection (`name
Wiring / Presentation
packages/app/src/pages/layout/pawwork-worktree-badge.tsx
Wraps Button with Tooltip (uses placement="bottom"), removes title prop from the button, and updates button classes to include the new max-w constraint for compact label rendering.
Tests / Mocking
packages/app/src/pages/layout/pawwork-worktree-badge.test.tsx
Adds mock for @opencode-ai/ui/tooltip exposing Tooltip and TooltipKeybind stubs. Updates tests to assert visible span text is only the worktree name, button.props.title is undefined, button classes include max-w-[280px], tooltip placement === "bottom", tooltip class/styling, and that tooltip.props.value is a div with data-component="pawwork-worktree-tooltip" containing ordered rows: Worktree, Branch, Location. Adds a test for empty name fallback showing Not available without duplication.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰 A badge that once hid text inside a title,
Now pops a panel tidy and gentle;
Worktree, Branch, Location in a neat little file,
No duplicate fallbacks, no accidental recital,
I hop and I nudge — the tooltip's quite genteel!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: simplifying the titlebar worktree badge by removing the combined name+branch display and moving details to a tooltip.
Description check ✅ Passed The description follows the template structure with all required sections completed: Summary, Why, Related Issue, Human Review Status, Review Focus, Risk Notes, How To Verify, Screenshots/Recordings, and Checklist.
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 pawwork/titlebar-worktree-hover-limit

Review rate limit: 8/10 reviews remaining, refill in 10 minutes and 6 seconds.

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

@Astro-Han Astro-Han added bug Something isn't working app Application behavior and product flows ui Design system and user interface P3 Low priority labels May 2, 2026

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request replaces the native title attribute on the PawworkWorktreeBadge with a custom Tooltip component, providing a structured view of worktree details like name, branch, and location. It also increases the badge's maximum width and updates the test suite. Feedback suggests using the direct worktree name in the tooltip to avoid redundancy and adding layout classes to the tooltip trigger to ensure proper shrinking in the titlebar.

Comment thread packages/app/src/pages/layout/pawwork-worktree-badge.tsx Outdated
Comment thread packages/app/src/pages/layout/pawwork-worktree-badge.tsx Outdated
@Astro-Han
Astro-Han merged commit 6176efc into dev May 2, 2026
27 checks passed
@Astro-Han
Astro-Han deleted the pawwork/titlebar-worktree-hover-limit branch May 2, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app Application behavior and product flows bug Something isn't working P3 Low priority ui Design system and user interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant