[PR #13441] fix(tui): show filename first in search dropdown for long paths #14669

Open
opened 2026-02-16 18:19:26 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/13441

State: open
Merged: No


What does this PR do?

Fixes #13054

Long file paths in the @ autocomplete dropdown were getting middle-truncated (src/comp…ponent.tsx), which makes it hard to tell files apart in deep directory structures.

Now it shows the filename first, then the directory — like VS Code does: MyComponent.tsx — src/components/deep/…. The most useful bit (the filename) is always visible on the left.

Added a truncatePath helper to Locale that splits on the last /, puts the filename first with a separator, and left-truncates the directory if it doesn't fit.

How did you verify your code works?

Ran bun typecheck (passes) and bun turbo test (passes, one pre-existing Bedrock timeout unrelated to this change). Checked formatting with bunx prettier --check on both changed files.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/13441 **State:** open **Merged:** No --- ### What does this PR do? Fixes #13054 Long file paths in the `@` autocomplete dropdown were getting middle-truncated (`src/comp…ponent.tsx`), which makes it hard to tell files apart in deep directory structures. Now it shows the filename first, then the directory — like VS Code does: `MyComponent.tsx — src/components/deep/…`. The most useful bit (the filename) is always visible on the left. Added a `truncatePath` helper to `Locale` that splits on the last `/`, puts the filename first with a ` — ` separator, and left-truncates the directory if it doesn't fit. ### How did you verify your code works? Ran `bun typecheck` (passes) and `bun turbo test` (passes, one pre-existing Bedrock timeout unrelated to this change). Checked formatting with `bunx prettier --check` on both changed files.
yindo added the pull-request label 2026-02-16 18:19:26 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14669