Skip to content

fix(desktop): restore styled tooltips on right sidebar file tree buttons and rows - #438

Open
hashbender wants to merge 1 commit into
mainfrom
mirror/pr-56520
Open

fix(desktop): restore styled tooltips on right sidebar file tree buttons and rows#438
hashbender wants to merge 1 commit into
mainfrom
mirror/pr-56520

Conversation

@hashbender

Copy link
Copy Markdown
Owner

What does this PR do?

Fixes the Refresh and Collapse All buttons in the right sidebar's file tree header, and each file/folder row in the file tree itself, showing plain browser-native tooltips instead of the app's styled dark tooltip.

This restores work from NousResearch#51315 ("replace native title tooltips with styled Tip component"), which wrapped these buttons in <Tip>. NousResearch#49037 rewrote FilesystemTab as part of the Projects feature, and its merge reintroduced the native title= attributes, reverting the tooltip fix from NousResearch#51315. NousResearch#49037 also removed the Open Folder button from that same file — its PR description states the freeform folder picker was retired in favor of project/worktree-based workspace switching, so that change is intentional and out of scope here. Only the two remaining buttons need the tooltip restored.

Additionally, ProjectTree (./files/tree.tsx) rendered each file/folder row with a native title={node.data.id} showing the full path, which had the same plain-tooltip regression. This wasn't touched by NousResearch#51315 originally, so it's addressed here with the same fix.

Related Issue

Fixes #

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

How to Test

  1. Launch the desktop app with a workspace/project open (so the file tree renders)
  2. Open the right sidebar and hover over the Refresh button — verify a styled dark tooltip appears
  3. Hover over the Collapse All button — verify a styled dark tooltip appears
  4. Hover over any file or folder row in the tree — verify a styled dark tooltip with the full path appears (instead of the native browser tooltip), positioned to the left so it doesn't overflow the sidebar
  5. Verify drag-and-drop of a file row still works (e.g. dragging a file into the chat attach zone)
  6. Verify the tree still scrolls/renders correctly with the tooltip wrapper (no row height/layout regressions from virtualization)

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: Windows 11

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

For New Skills

N/A

Screenshots / Logs

right_sidebar right_sidebar 2

Mirror-of: NousResearch#56520
NousResearch#56520

@tenki-reviewer

tenki-reviewer Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Complete

Files Reviewed: 2
Findings: 1

By Severity:

  • 🟢 Low: 1

A minor accessibility regression in the desktop app's right sidebar: the refresh button loses its tooltip during loading states after migrating from native title attribute to Radix UI <Tip>, because Radix TooltipTrigger does not activate on disabled elements.

Files Reviewed (2 files)
apps/desktop/src/app/right-sidebar/files/tree.tsx
apps/desktop/src/app/right-sidebar/index.tsx

@tenki-reviewer tenki-reviewer 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.

Risk: 🟢 Low (18/100) — 1 low finding · 203 LOC across 2 files


Summary

PR #438 migrates tooltips in the desktop app's right sidebar header from native HTML title attributes to Radix UI <Tip> wrappers. The migration is correct for most cases, but introduces a minor accessibility regression for the refresh button during loading states.

Findings

Disabled refresh button loses tooltip after title→Tip migration

  • File: apps/desktop/src/app/right-sidebar/index.tsx (lines 155–166)
  • Severity: low | Confidence: 85%
  • Root cause: Radix UI's TooltipTrigger component does not activate on disabled HTML elements (documented limitation). When loading=true, the refresh <Button> is disabled, yet it becomes visually visible via CSS group-hover rules that restore pointer-events-auto and opacity. A sighted user hovering over the visible-but-disabled button sees no tooltip, whereas the old native title={r.refreshTree} attribute worked regardless of disabled state.
  • Screen reader users are unaffectedaria-label is preserved.
  • Fix: Wrap the disabled button in a <span> element when loading is true, so the tooltip trigger targets the span wrapper rather than the disabled button directly. Alternatively, restore the native title attribute as a fallback alongside <Tip>.

Comment on lines +155 to +166
<Tip label={r.refreshTree} side="left">
<Button
aria-label={r.refreshTree}
className={HEADER_ACTION_LABEL_REVEAL}
disabled={loading}
onClick={onRefresh}
size="icon-xs"
variant="ghost"
>
<Codicon name="refresh" size="0.8125rem" spinning={loading} />
</Button>
</Tip>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Disabled refresh button loses tooltip after title->Tip migration (bug)

The refresh button in the right sidebar header (index.tsx:155-166) is wrapped in instead of using a native title attribute. When loading=true, the button is disabled. Radix UI's TooltipTrigger does not activate on disabled elements (documented Radix limitation). The button is still visually revealed via CSS group-hover (HEADER_ACTION_LABEL_REVEAL restores pointer-events-auto and opacity), creating a state where a visible disabled button shows no tooltip -- the old title={r.refreshTree} worked in this state. The collapse button at lines 167-178 has a similar pattern but is pointer-events-none opacity-0 when disabled, so the gap is moot there. Screen reader users are unaffected because aria-label is preserved.

💡 Suggestion: Per Radix documentation, disabled elements need a wrapper for the tooltip trigger. Wrap the in a when loading is true and apply the to the span; when not loading, wrap the button directly as before. Alternatively, add the native title back as a fallback alongside .

📋 Prompt for AI Agents

In apps/desktop/src/app/right-sidebar/index.tsx, lines 155-166, the refresh button is wrapped in a component. Radix UI TooltipTrigger does not activate on disabled elements. When the button is disabled (loading=true), the tooltip will not appear. Fix by conditionally wrapping the button in a when disabled so the tooltip trigger targets the span instead of the disabled button. For example: store the button JSX in a variable, and conditionally render {button} when loading, or {button} when not loading.

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