Skip to content

fix: prioritize filenames in new-tab file results - #12670

Merged
nwparker merged 8 commits into
mainfrom
neil/sta-3424-truncate-file-paths-to-prioritize-showing-the-actual
Aug 6, 2026
Merged

nwparker merged 8 commits into
mainfrom
neil/sta-3424-truncate-file-paths-to-prioritize-showing-the-actual

Conversation

@nwparker

@nwparker nwparker commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Prioritize the actual filename in new-tab file results, truncating the parent directory instead.
  • Show the complete path in a compact, system-style tooltip anchored at the cursor.
  • Add renderer and Electron coverage for filename ordering, separators, overflow, and tooltip placement.

Fixes STA-3424

@swieder227 this addresses the reported file-name visibility issue.

Visual proof

Before — searching twowayaudio returns four results that are visually identical, because every row truncates in the shared mobile/packages/expo-two-way… prefix. You cannot tell which file is which.

before

After — the filename leads, so all four rows are distinguishable at a glance.

after

Hover — the full path opens at the cursor, the way a system tooltip does.

tooltip

Layout behavior

FilenameFirstPath splits on the last separator and keeps the separator attached to the directory, so /foo renders foo + / and C:\repo\src\x.ts keeps its backslashes — no separator is re-derived from the path shape.

The filename is shrink-0 max-w-full, so the directory yields all of its width before the filename loses a character. When the filename alone overflows the row, the directory is dropped entirely and the tooltip carries the full path. Verified live: scrollWidth === clientWidth at 270px, so the row never spills out of the dropdown.

Why not a native title tooltip

The first pass used title, which would have been the smaller change. Native tooltips do not render anywhere in Orca — verified by hand in a dev build; title on these rows produces nothing on hover. Root-causing that is out of scope here (nothing in createMainWindow.ts explains it: no transparent, no macOS vibrancy since #8482, no Blink feature switches on the main window).

So this uses the Radix Tooltip primitive, restyled to read as a system tooltip: not inverted, no arrow, 11px text, tight padding. Radius and shadow use the documented rounded-md and floating tier from docs/STYLEGUIDE.md:97,101 rather than new values.

Two deliberate deviations from docs/STYLEGUIDE.md worth a reviewer's eye:

  1. The styleguide's default placement is side="top" sideOffset={4}. This anchors to the cursor instead: Radix positions relative to the trigger, so the pointer is expressed as alignOffset/sideOffset from the row's bottom-left corner, leaving it 18px below the cursor. The offsets are re-measured in a layout effect when the tooltip opens, because results stream in and move the row during the open delay.
  2. TooltipContent gains an opt-in showArrow prop (defaults to true, so every existing call site is unchanged). The arrow reads as an app tooltip rather than a system one.

If the design system would rather absorb this as a named variant than as per-call-site classes, say so and I will move it.

Only the filename-first rows get a tooltip. Agent/URL/create-file rows already show their detail in full, and STYLEGUIDE.md:162 rules out labelling a control that has a visible label.

Known limits

  • Once open, the tooltip stays anchored to the row, so scrolling the result list drags it with the row while the cursor stays put. A true system tooltip is screen-fixed. Not fixed here.
  • It is pointer-only: rows are driven by aria-activedescendant, never focused, so Radix's focus-open path never runs and keyboard users get no tooltip. The full path is still in the option's accessible name, though it now reads filename-first.
  • CURSOR_TOOLTIP_GAP = 18 is reasoned from the macOS cursor hotspot; Windows cursor scaling could sit over the label.

Testing

  • pnpm exec vitest run --config config/vitest.config.ts across all 98 tooltip-touching suites — 814 passed.

  • pnpm exec playwright test tests/e2e/tab-create-entry-file-paths.spec.ts … --repeat-each=6 — 6/6 passed. Asserts filename ordering, that the row does not overflow, and that the tooltip really opens carrying the whole path.

    Cursor placement is asserted in unit tests against cursorTooltipOffsets, not in E2E. Asserting pixels through the running app measured it mid-reflow and was genuinely flaky (2/5, then 5/5 failures) — the arithmetic belongs at the unit layer, and --repeat-each is what proved the difference.

  • pnpm run typecheck:web, oxlint — clean.

  • Verified interactively in a dev build over CDP: tooltip opens on hover with the full path, and wraps to two lines for a 117-character path.

The unit tests cover the text layout only; the tooltip is asserted in E2E where it actually opens, rather than by mocking the primitive under test.

Security

No new IPC payloads, filesystem permissions, subprocesses, network sinks, secrets, or dependencies. The tooltip renders a path the row already received.

Readiness

  • SSH/remote: presentation-only renderer change; no transport, reconnect, relay, or provider behavior touched.
  • Crash/retry/growth: no new async loop, retry, cache, listener, timer, or retained collection. The tooltip is pointer-events-none under the app's existing disableHoverableContent provider.
  • Cross-platform: separators are preserved from the input path rather than inferred; Windows backslash paths covered by unit test.
  • Backward compatibility: no persisted state, route, RPC contract, or serialized data changed. showArrow defaults to the previous behavior. No mobile surface touched.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

File action rows now prioritize the basename and display the directory beside it. Filename-prioritized rows expose the complete path through a tooltip. Existing and absolute file actions enable this presentation. Component and end-to-end tests verify rendering, tooltip content, path ordering, root-level paths, and nested file search behavior.

🚥 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
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.
Title check ✅ Passed The title clearly summarizes the primary change: prioritizing filenames in new-tab file results.
Description check ✅ Passed The description covers the user-visible change, visual proof, testing, security, and cross-platform readiness; the separate AI Review Report section is absent.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: bfe5b0e2-c955-48df-8c13-af1d7150285c

📥 Commits

Reviewing files that changed from the base of the PR and between c4d5a53 and 886e25f.

📒 Files selected for processing (4)
  • src/renderer/src/components/tab-bar/TabBarCreateEntry.keyboard.test.tsx
  • src/renderer/src/components/tab-bar/TabBarCreateEntryRow.test.tsx
  • src/renderer/src/components/tab-bar/TabBarCreateEntryRow.tsx
  • tests/e2e/tab-create-entry-file-paths.spec.ts

@nwparker

nwparker commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

@swieder227 Follow-up on the tooltip feedback: the file row now uses the native HTML title tooltip, so the full path appears through the normal system/browser tooltip without Radix overlay chrome.

Commit: ba6ae00

Updated visual proof (filename-first row):

orca-sta3424-native-title.png

The native tooltip itself is OS-rendered and is not included in Chromium screenshots; the Electron E2E asserts the exact title value.

@nwparker

nwparker commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor Author

Follow-up: the full path tooltip is now rendered with Orca’s existing lightweight tooltip primitive and positioned above the result row.\n\nFresh Electron proof:\n\nSTA-3424 file path tooltip\n\nCommit: 487b608

@nwparker
nwparker merged commit ead6b8e into main Aug 6, 2026
90 of 92 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
* fix: prioritize filenames in new-tab file results

* fix: preserve root separator in filename-first paths

* refactor: use native file path tooltips

* fix: position file path tooltips

* fix: use the native OS tooltip for new-tab file paths

Co-authored-by: Orca <[email protected]>

* fix: show new-tab file paths in a system-style tooltip

Co-authored-by: Orca <[email protected]>

* fix: anchor new-tab path tooltip to the cursor

Co-authored-by: Orca <[email protected]>

* fix: tighten cursor tooltip to file rows and design tokens

Co-authored-by: Orca <[email protected]>

---------

Co-authored-by: Orca <[email protected]>
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