Skip to content

Improve repo picker readability for long saved-repo paths - #9451

Merged
moirahuang merged 4 commits into
warpdotdev:masterfrom
saucy-tech:gh9439-repo-picker-paths
May 8, 2026
Merged

moirahuang merged 4 commits into
warpdotdev:masterfrom
saucy-tech:gh9439-repo-picker-paths

Conversation

@saucy-tech

@saucy-tech saucy-tech commented Apr 29, 2026 •

Copy link
Copy Markdown
Contributor

Description

Fixes #9439.

Screenshot 2026-05-01 at 8 47 55 PM

The tab config type = "repo" picker renders saved repos as raw, single-line entries. When several saved repos live deep inside paths like ~/Library/Mobile Documents/iCloud~md~obsidian/Documents/..., the visible portion of two different rows can be byte-for-byte identical, so the user can't reliably pick the right one.

Per @moirahuang and @alokedesai's preferred direction (#9439 comment, PR review), this is a left-clip + ~ substitution + tooltip approach — no soft-wrap, no schema changes:

  1. ~ substitution for the home directory in the displayed label, via warp_util::path::user_friendly_path — the same helper already used in tab_configs/action_sidecar.rs and tab_configs/session_config_rendering.rs. The dropdown action and the cached self.selected continue to carry the raw absolute path so launched sessions resolve correctly.
  2. Left-truncation with a leading … (crate::util::truncation::truncate_from_beginning) at a 40-character cap. The trailing repo name — the most distinctive part of the path — stays visible in every row.
  3. Hover tooltip with the full absolute path via the existing MenuItemFields::with_tooltip, exposed through a new with_tooltip builder on DropdownItem. Even after ~ substitution and left-clip the user can recover the original path.
  4. Action-based preselection. RepoPicker::refresh_items now calls the existing public FilterableDropdown::set_selected_by_action(RepoPickerAction::Select(raw)) instead of set_selected_by_name(display). If two raw paths happen to share the same trailing 40 characters, preselection still picks the correct backing repo. RepoPickerAction already derives PartialEq, so this is a small swap with no new public dropdown API.

The new with_tooltip builder on DropdownItem is opt-in (defaults to None), so other FilterableDropdown consumers are unaffected.

Out of scope (left for follow-ups)

  • User-defined nicknames / aliases. The issue body flags this as a saved-repo metadata change rather than picker UX.
  • Soft-wrap to two lines. Considered earlier in this PR; reverted per maintainer review in favor of the left-clip approach.
  • Mid-path elision. Left-clip supersedes this for the picker rows.

Testing

cargo fmt --check -p warp, cargo check -p warp, and cargo clippy -p warp --all-targets are all clean locally.

Manual smoke verified locally with deeply-nested iCloud paths — see follow-up comment for screenshot. Short paths render unchanged with ~ substitution; long paths left-clip with a leading … so the trailing repo name stays visible; full absolute path appears on hover.

The change leans on already-tested primitives:

  • warp_util::path::user_friendly_path has unit tests in crates/warp_util/src/path_test.rs.
  • crate::util::truncation::truncate_from_beginning is the same helper used elsewhere in the app.
  • FilterableDropdown::set_selected_by_action and MenuItemFields::with_tooltip are existing primitives.

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

Changelog Entries for Stable

CHANGELOG-IMPROVEMENT: Tab config repo picker now abbreviates the home directory to ~, left-truncates long paths so the trailing repo name stays visible, and surfaces the full absolute path on hover so deeply nested saved repos stay distinguishable.

Saved repos with long shared parent paths (e.g. iCloud, Google Drive) collapse into visually identical truncated rows in the tab-config type="repo" picker, making it impossible to tell them apart at the moment of selection. See warpdotdev#9439.

Three coordinated display-only changes:

* Display labels run through warp_util::path::user_friendly_path so the home directory is abbreviated to `~`. The action and the cached self.selected continue to carry the raw absolute path so launched sessions resolve correctly. Pattern mirrors the existing usage in tab_configs/action_sidecar.rs and tab_configs/session_config_rendering.rs.
* DropdownItem gains optional tooltip and max_lines builder methods, threading through to MenuItemFields::with_tooltip and MenuItemFields::new_multiline at the menu primitive layer. Other FilterableDropdown call sites are unaffected (both fields default to None).
* Repo picker rows opt in to a 2-line soft-wrap and a tooltip that surfaces the full untruncated absolute path, so even after `~` substitution the user can recover the original on hover.

Co-Authored-By: Oz <oz-agent@warp.dev>
@cla-bot

cla-bot Bot commented Apr 29, 2026

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @saucy-tech on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment @cla-bot check to trigger another check.

@adrisys

adrisys commented Apr 29, 2026

Copy link
Copy Markdown

@oz-agent

@warp-for-oss

warp-for-oss Bot commented Apr 29, 2026 •

Copy link
Copy Markdown
Contributor

@adrisys

I ran into an unexpected error while working on this.

You can view the conversation on Warp.

Powered by Oz

@saucy-tech

Copy link
Copy Markdown
Contributor Author

@cla-bot check

@cla-bot cla-bot Bot added the cla-signed label Apr 29, 2026
@cla-bot

cla-bot Bot commented Apr 29, 2026

Copy link
Copy Markdown

The cla-bot has been summoned, and re-checked this pull request!

@saucy-tech
saucy-tech marked this pull request as ready for review April 29, 2026 17:40
@warp-for-oss

warp-for-oss Bot commented Apr 29, 2026 •

Copy link
Copy Markdown
Contributor

@saucy-tech

I'm starting a first review of this pull request.

I reviewed this pull request and requested human review from: @alokedesai. I left feedback as a comment so a maintainer can approve.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

I completed the review and posted feedback on this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

I completed the review and posted feedback on this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

I completed the review and posted feedback on this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

I completed the review and posted feedback on this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

I completed the review and posted feedback on this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

You can view the conversation on Warp.

I completed the review and posted feedback on this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@warp-for-oss warp-for-oss 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.

Overview

This PR updates the tab config repo picker display so saved repo paths use a home-directory ~ abbreviation, wrap long rows to two lines, and expose the raw absolute path in a tooltip while preserving raw paths in selection actions.

Concerns

  • No blocking correctness, security, or error-handling concerns found in the changed diff.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@warp-for-oss
warp-for-oss Bot requested a review from alokedesai April 29, 2026 17:44
@alokedesai

Copy link
Copy Markdown
Member

Hey @saucy-tech, thanks so much for the PR! I think this is a great start, but I think we should go with this solution instead: #9439 (comment)

I think the main change should be that we don't soft wrap and instead clip from the left instead of clip from the right. Once that change is made, this PR should be good to go!

@bholmesdev asked to use @moirahuang's suggestion (left-clip instead of
soft-wrap) while keeping the `~` substitution and full-path tooltip.
This commit makes that swap:

* Repo picker rows now left-truncate with a leading `…` when the
  `~`-abbreviated path exceeds `MAX_REPO_DISPLAY_LEN`, so the trailing
  repo name — the most distinctive part of the path — stays visible.
* `DropdownItem::with_max_lines` and the multiline plumbing through
  `MenuItemFields::new_multiline` are removed; rows render as a single
  clipped line again.
* `RepoPicker::selected_value` no longer falls back to the dropdown's
  `selected_item_label` (which would now be the formatted display
  string). `refresh_items` already mirrors the raw path into
  `self.selected`, so the fallback is unnecessary.

`~` substitution and the hover tooltip are unchanged.

Co-Authored-By: Claude <noreply@anthropic.com>
warp-for-oss[bot]
warp-for-oss Bot previously requested changes Apr 30, 2026

@warp-for-oss warp-for-oss 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.

Overview

This PR changes the tab config repo picker to display friendlier saved-repo paths and adds tooltip support to dropdown items.

Concerns

  • The picker now truncates the label before constructing each DropdownItem, but FilterableDropdown filters only against display_text, so users can no longer search for path segments that were elided and the intended two-line soft-wrap behavior is not implemented.
  • Preselection now looks up rows by formatted display text, which can collide after ~ substitution/truncation and select the wrong underlying repo action.
  • Supplemental security pass found no security-specific issues.

Verdict

Found: 0 critical, 2 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread app/src/tab_configs/repo_picker.rs Outdated
warp-for-oss[bot]
warp-for-oss Bot previously requested changes Apr 30, 2026

@warp-for-oss warp-for-oss 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.

Overview

This PR abbreviates and truncates saved repo paths in the tab config repo picker, adds tooltip/filter metadata to dropdown items, and switches filtering to use the richer match text.

Concerns

  • The picker now selects preselected repos by the clipped display label. When two saved repos truncate to the same visible label, the highlighted/default menu item can point at a different raw path than self.selected, and pressing Enter can switch to the wrong repo.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

warp-for-oss[bot]
warp-for-oss Bot previously requested changes Apr 30, 2026

@warp-for-oss warp-for-oss 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.

Overview

This PR abbreviates and truncates repo picker labels, adds tooltip/filter metadata to dropdown items, and filters against the expanded match text.

Concerns

  • The repo picker now supplies lossy/truncated labels, but the filterable dropdown still preserves and restores selection by label, so colliding displayed labels can cause keyboard selection to jump to a different repo action.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment on lines +625 to +628
let item_matches_filter = item
.filter_match_text()
.to_lowercase()
.contains(&filter_query);

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.

⚠️ [IMPORTANT] Filtering now uses richer match text, but selection preservation below still keys on display_text and calls set_selected_by_name; because the repo picker now passes a truncated label, duplicate labels can make filtering select/submit the wrong repo action. Preserve the current row by action or another unique key instead of the rendered label.

@saucy-tech

Copy link
Copy Markdown
Contributor Author

Hey @alokedesai made the change you asked for in 69e19c0! Oz has flagged a few follow-ups since; how would you like me to handle them?

@captainsafia captainsafia added the external-contributor Indicates that a PR has been opened by someone outside the Warp team. label Apr 30, 2026 — with Warp Agent Staging
@alokedesai

Copy link
Copy Markdown
Member

Mind addressing the comments and rerunning oz-review? once it's approved i'll take a look

@cla-bot

cla-bot Bot commented Apr 30, 2026

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @claude on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment @cla-bot check to trigger another check.

@cla-bot cla-bot Bot removed the cla-signed label Apr 30, 2026
@saucy-tech
saucy-tech force-pushed the gh9439-repo-picker-paths branch from 47d1ca4 to 9bc883f Compare April 30, 2026 20:42
@cla-bot cla-bot Bot added the cla-signed label Apr 30, 2026
warp-for-oss[bot]
warp-for-oss Bot previously requested changes Apr 30, 2026

@warp-for-oss warp-for-oss 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.

Overview

This PR changes the tab-config repo picker to display friendlier repo paths, adds tooltip and filter-text support to dropdown items, and switches filterable dropdown selection preservation to use actions instead of rendered labels. A supplemental security pass did not identify security issues.

Concerns

  • RepoPicker::selected_value() no longer reports the raw path for an initially auto-selected row when there is no explicit default or previous selection, so repo params can render a selected repo but submit as empty until clicked.
  • The repo display text is still destructively left-truncated to a fixed character count, so paths with identical suffixes remain ambiguous in the picker despite the readability goal.

Verdict

Found: 0 critical, 2 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread app/src/tab_configs/repo_picker.rs Outdated
Comment thread app/src/tab_configs/repo_picker.rs
warp-for-oss[bot]
warp-for-oss Bot previously requested changes Apr 30, 2026

@warp-for-oss warp-for-oss 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.

Overview

This PR changes the tab config repo picker display path, adds tooltip/filter-text support to dropdown items, and updates FilterableDropdown selection tracking to use actions so truncated labels can collide safely.

Concerns

  • RepoPicker::selected_value now returns only self.selected, so a repo picker opened without an explicit/default path can visibly auto-select the first row while still reporting no usable repo value to callers such as required repo params.
  • The repo picker display path is hard-truncated to 40 characters rather than rendered as a two-line soft-wrapped label, so the main readability change described by the PR is not actually implemented and same-suffix paths can still collide visually until hover.
  • Supplemental security pass found no additional security-specific findings.

Verdict

Found: 0 critical, 2 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread app/src/tab_configs/repo_picker.rs
Comment thread app/src/tab_configs/repo_picker.rs Outdated
warp-for-oss[bot]
warp-for-oss Bot previously requested changes Apr 30, 2026

@warp-for-oss warp-for-oss 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.

Overview

This PR improves the tab config repo picker by displaying home-relative paths, adding multiline dropdown rows, and exposing tooltips through the shared dropdown item API.

Concerns

  • Repo picker filtering regresses for absolute paths under the user's home directory because items now match only the ~-substituted display text. Users who paste or type the full absolute path can no longer find matching saved repos even though the raw path is still the backing value.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread app/src/tab_configs/repo_picker.rs
@saucy-tech

Copy link
Copy Markdown
Contributor Author

/oz-review

@warp-for-oss

warp-for-oss Bot commented May 1, 2026 •

Copy link
Copy Markdown
Contributor

@saucy-tech

I'm re-reviewing this pull request in response to a review request.

You can view the conversation on Warp.

I reviewed this pull request and requested human review from: @moirahuang.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@warp-for-oss
warp-for-oss Bot dismissed stale reviews from themself May 1, 2026 00:08

Oz no longer requests changes for this pull request after the latest automated review.

@warp-for-oss
warp-for-oss Bot dismissed their stale review May 1, 2026 00:09

Oz no longer requests changes for this pull request after the latest automated review.

@warp-for-oss warp-for-oss 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.

Overview

This PR improves the tab config repo picker display by abbreviating home-directory paths, allowing saved repo rows to wrap over two lines, preserving selection identity by action instead of label, and adding tooltips/filter text for the raw absolute path. It also extends shared dropdown primitives in an opt-in way and updates affected generic bounds.

Concerns

  • No blocking correctness issues found in the changed diff lines.
  • Supplemental security pass: no security concerns identified; the full path tooltip is a local UI disclosure consistent with the stated picker behavior.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@warp-for-oss
warp-for-oss Bot requested a review from moirahuang May 1, 2026 00:09
@saucy-tech

Copy link
Copy Markdown
Contributor Author

Mind addressing the comments and rerunning oz-review? once it's approved i'll take a look

Oz is passing. Thank you Warp for going OSS, and allowing me to submit an issue and contribute the PR!

@alokedesai alokedesai left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you so much for working on this! I left a more detailed review. Once those get addressed, I think this is good to go :D

Comment thread app/src/tab_configs/repo_picker.rs Outdated
Comment thread app/src/tab_configs/repo_picker.rs
Comment thread app/src/view_components/dropdown.rs Outdated
Comment thread app/src/view_components/dropdown.rs Outdated
Comment thread app/src/view_components/filterable_dropdown.rs Outdated
@saucy-tech
saucy-tech force-pushed the gh9439-repo-picker-paths branch from 2a1e975 to 69e19c0 Compare May 1, 2026 23:45
@saucy-tech

Copy link
Copy Markdown
Contributor Author

/oz-review

@warp-for-oss

warp-for-oss Bot commented May 1, 2026 •

Copy link
Copy Markdown
Contributor

@saucy-tech

I'm re-reviewing this pull request in response to a review request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

warp-for-oss[bot]
warp-for-oss Bot previously requested changes May 1, 2026

@warp-for-oss warp-for-oss 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.

Overview

This PR changes the tab config repo picker to display user-friendly saved-repo paths and adds dropdown tooltip support. The security pass found no issues.

Concerns

  • Pre-selection now looks up rows by the formatted display string, which can collide after path abbreviation/truncation and select the wrong repo.
  • Repo labels are still pre-truncated to a fixed character count, so the picker does not get a full label to soft-wrap and still discards path context in the row itself.

Verdict

Found: 0 critical, 2 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread app/src/tab_configs/repo_picker.rs Outdated
Comment on lines +190 to +194
// The dropdown looks up by `display_text`, so format the raw path
// with the same formatter used to build the items above.
if let Some(ref raw) = raw_to_select {
let display = format_display_path(raw, home.as_deref());
dropdown.set_selected_by_name(display.as_str(), ctx);

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.

⚠️ [IMPORTANT] Selecting by the formatted label can pick the wrong repo when two raw paths collapse to the same ~/truncated display string; select by the raw action instead.

Suggested change
// The dropdown looks up by `display_text`, so format the raw path
// with the same formatter used to build the items above.
if let Some(ref raw) = raw_to_select {
let display = format_display_path(raw, home.as_deref());
dropdown.set_selected_by_name(display.as_str(), ctx);
if let Some(ref raw) = raw_to_select {
dropdown.set_selected_by_action(RepoPickerAction::Select(raw.clone()), ctx);

Comment thread app/src/tab_configs/repo_picker.rs Outdated
/// the result is longer than [`MAX_REPO_DISPLAY_LEN`].
fn format_display_path(raw_path: &str, home: Option<&str>) -> String {
let abbreviated = user_friendly_path(raw_path, home);
truncate_from_beginning(&abbreviated, MAX_REPO_DISPLAY_LEN)

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.

⚠️ [IMPORTANT] This truncates the label before the dropdown can render it, so rows cannot soft-wrap to two lines and users still lose path context unless they hover; keep the full abbreviated path as the label and cap the rendered menu item lines instead.

Defends against label collision when two paths share a 40-char trailing
suffix and render identical after `truncate_from_beginning`. Uses the
existing public `FilterableDropdown::set_selected_by_action` — no new
plumbing.
@saucy-tech

saucy-tech commented May 2, 2026 •

Copy link
Copy Markdown
Contributor Author

Hey @alokedesai sorry for the back-and-forth here. I force-pushed back to 69e19c0 to get this PR back to a smaller scope.

That removes the broader Oz-driven additions from the previous version (thank you for those detailed review and comments):

File:line Resolution
repo_picker.rs:159 soft-wrap removed; repo rows are single-line with left truncation
repo_picker.rs:224 selected_value reverted to the original fallback behavior
dropdown.rs:144 with_filter_text removed
dropdown.rs:178 with_multiline and the MenuItemFields::new_multiline branch removed
filterable_dropdown.rs:636 selection preservation reverted to the existing label-based behavior

I made one small follow-up commit on top (bcf7c59): preselection in RepoPicker::refresh_items now uses the existing FilterableDropdown::set_selected_by_action instead of set_selected_by_name. RepoPickerAction already derives PartialEq, so this is a tiny change with no new public dropdown API, and it avoids selecting the wrong backing repo if two raw paths collapse to the same truncated display label.

Oz is still asking for soft-wrap/multiline rows, but I left that out because your earlier direction was to avoid soft-wrap and clip from the left instead. If you'd prefer the multiline rendering after all, I can restore only that piece; otherwise I think the PR is now back to the intended scope.

@saucy-tech

saucy-tech commented May 2, 2026 •

Copy link
Copy Markdown
Contributor Author

Manual smoke on a local OSS build (./script/run). Saved repos include both a short path and a deeply-nested iCloud path that's well past the 40-char cap.

Screenshot 2026-05-01 at 8 47 55 PM

The first row shows ~ substitution at full length. The second row shows the left-clip in action: leading … plus the trailing Brandon/2-Areas/Health segment, which is exactly the part that used to get cut off by the right-side ellipsis.

@saucy-tech

Copy link
Copy Markdown
Contributor Author

/oz-review

@warp-for-oss

warp-for-oss Bot commented May 2, 2026 •

Copy link
Copy Markdown
Contributor

@saucy-tech

I'm re-reviewing this pull request in response to a review request.

You can view the conversation on Warp.

I reviewed this pull request and requested human review from: @moirahuang.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@warp-for-oss
warp-for-oss Bot dismissed their stale review May 2, 2026 11:42

Oz no longer requests changes for this pull request after the latest automated review.

@warp-for-oss warp-for-oss 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.

Overview

This PR improves the repo picker display by using home-directory abbreviation, beginning truncation, raw-path-backed selection, and optional dropdown tooltips for full paths.

Concerns

  • No blocking correctness or security concerns found.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@alokedesai alokedesai left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for all of the revs on this! I have one more comment and then I think this is good to go--I'll take it spin tomorrow morning

Comment thread app/src/tab_configs/repo_picker.rs Outdated
@alokedesai asked to expose an optional `ClipConfig` setting so the
text-layout layer can clip at the actual render width, instead of
approximating with a 40-char cap on the display string.

* `MenuItemFields` gains an opt-in `clip_config` field, threaded into
  `MenuItemLabel::render` and applied only to the plain `Text` arm via
  `Text::with_clip(...).soft_wrap(false)`. Multiline, stacked, labeled,
  icon, and custom variants ignore the field. Other menu consumers
  default to `None`, so no behavior change anywhere else.
* `DropdownItem::with_clip_config` mirrors the existing per-item
  `with_tooltip` builder and forwards the config when constructing the
  menu item.
* The repo picker hands the full `~`-abbreviated `user_friendly_path`
  output to the dropdown and chains
  `.with_clip_config(ClipConfig::start())`. `MAX_REPO_DISPLAY_LEN`,
  `format_display_path`, and the `truncate_from_beginning` import are
  removed.

Tooltip and `set_selected_by_action` preselection are unchanged.

Co-Authored-By: Claude <noreply@anthropic.com>

@alokedesai alokedesai left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for contributing!

@moirahuang
moirahuang merged commit b87da5f into warpdotdev:master May 8, 2026
24 checks passed
zhangyu1818-bot pushed a commit to zhangyu1818/warply that referenced this pull request May 10, 2026
…#9451)

Fixes warpdotdev#9439.

<img width="488" height="244" alt="Screenshot 2026-05-01 at 8 47 55 PM"
src="https://github.com/user-attachments/assets/d9a91703-d4f3-4577-9406-e922bb517382"
/>

The tab config `type = "repo"` picker renders saved repos as raw,
single-line entries. When several saved repos live deep inside paths
like `~/Library/Mobile Documents/iCloud~md~obsidian/Documents/...`, the
visible portion of two different rows can be byte-for-byte identical, so
the user can't reliably pick the right one.

Per @moirahuang and @alokedesai's preferred direction (warpdotdev#9439 comment, PR
review), this is a **left-clip + `~` substitution + tooltip** approach —
no soft-wrap, no schema changes:

1. **`~` substitution for the home directory** in the displayed label,
via `warp_util::path::user_friendly_path` — the same helper already used
in `tab_configs/action_sidecar.rs` and
`tab_configs/session_config_rendering.rs`. The dropdown action and the
cached `self.selected` continue to carry the raw absolute path so
launched sessions resolve correctly.
2. **Left-truncation with a leading `…`**
(`crate::util::truncation::truncate_from_beginning`) at a 40-character
cap. The trailing repo name — the most distinctive part of the path —
stays visible in every row.
3. **Hover tooltip with the full absolute path** via the existing
`MenuItemFields::with_tooltip`, exposed through a new `with_tooltip`
builder on `DropdownItem`. Even after `~` substitution and left-clip the
user can recover the original path.
4. **Action-based preselection.** `RepoPicker::refresh_items` now calls
the existing public
`FilterableDropdown::set_selected_by_action(RepoPickerAction::Select(raw))`
instead of `set_selected_by_name(display)`. If two raw paths happen to
share the same trailing 40 characters, preselection still picks the
correct backing repo. `RepoPickerAction` already derives `PartialEq`, so
this is a small swap with no new public dropdown API.

The new `with_tooltip` builder on `DropdownItem` is opt-in (defaults to
`None`), so other `FilterableDropdown` consumers are unaffected.

- **User-defined nicknames / aliases.** The issue body flags this as a
saved-repo metadata change rather than picker UX.
- **Soft-wrap to two lines.** Considered earlier in this PR; reverted
per maintainer review in favor of the left-clip approach.
- **Mid-path elision.** Left-clip supersedes this for the picker rows.

`cargo fmt --check -p warp`, `cargo check -p warp`, and `cargo clippy -p
warp --all-targets` are all clean locally.

Manual smoke verified locally with deeply-nested iCloud paths — see
follow-up comment for screenshot. Short paths render unchanged with `~`
substitution; long paths left-clip with a leading `…` so the trailing
repo name stays visible; full absolute path appears on hover.

The change leans on already-tested primitives:

- `warp_util::path::user_friendly_path` has unit tests in
`crates/warp_util/src/path_test.rs`.
- `crate::util::truncation::truncate_from_beginning` is the same helper
used elsewhere in the app.
- `FilterableDropdown::set_selected_by_action` and
`MenuItemFields::with_tooltip` are existing primitives.

- [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode

CHANGELOG-IMPROVEMENT: Tab config repo picker now abbreviates the home
directory to `~`, left-truncates long paths so the trailing repo name
stays visible, and surfaces the full absolute path on hover so deeply
nested saved repos stay distinguishable.

---------

Co-authored-by: Oz <oz-agent@warp.dev>
Co-authored-by: Claude <noreply@anthropic.com>
(cherry picked from commit b87da5f)
tungd pushed a commit to tungd/warp that referenced this pull request May 11, 2026
…#9451)

## Description

Fixes warpdotdev#9439.

<img width="488" height="244" alt="Screenshot 2026-05-01 at 8 47 55 PM"
src="https://github.com/user-attachments/assets/d9a91703-d4f3-4577-9406-e922bb517382"
/>

The tab config `type = "repo"` picker renders saved repos as raw,
single-line entries. When several saved repos live deep inside paths
like `~/Library/Mobile Documents/iCloud~md~obsidian/Documents/...`, the
visible portion of two different rows can be byte-for-byte identical, so
the user can't reliably pick the right one.

Per @moirahuang and @alokedesai's preferred direction (warpdotdev#9439 comment, PR
review), this is a **left-clip + `~` substitution + tooltip** approach —
no soft-wrap, no schema changes:

1. **`~` substitution for the home directory** in the displayed label,
via `warp_util::path::user_friendly_path` — the same helper already used
in `tab_configs/action_sidecar.rs` and
`tab_configs/session_config_rendering.rs`. The dropdown action and the
cached `self.selected` continue to carry the raw absolute path so
launched sessions resolve correctly.
2. **Left-truncation with a leading `…`**
(`crate::util::truncation::truncate_from_beginning`) at a 40-character
cap. The trailing repo name — the most distinctive part of the path —
stays visible in every row.
3. **Hover tooltip with the full absolute path** via the existing
`MenuItemFields::with_tooltip`, exposed through a new `with_tooltip`
builder on `DropdownItem`. Even after `~` substitution and left-clip the
user can recover the original path.
4. **Action-based preselection.** `RepoPicker::refresh_items` now calls
the existing public
`FilterableDropdown::set_selected_by_action(RepoPickerAction::Select(raw))`
instead of `set_selected_by_name(display)`. If two raw paths happen to
share the same trailing 40 characters, preselection still picks the
correct backing repo. `RepoPickerAction` already derives `PartialEq`, so
this is a small swap with no new public dropdown API.

The new `with_tooltip` builder on `DropdownItem` is opt-in (defaults to
`None`), so other `FilterableDropdown` consumers are unaffected.

### Out of scope (left for follow-ups)

- **User-defined nicknames / aliases.** The issue body flags this as a
saved-repo metadata change rather than picker UX.
- **Soft-wrap to two lines.** Considered earlier in this PR; reverted
per maintainer review in favor of the left-clip approach.
- **Mid-path elision.** Left-clip supersedes this for the picker rows.

## Testing

`cargo fmt --check -p warp`, `cargo check -p warp`, and `cargo clippy -p
warp --all-targets` are all clean locally.

Manual smoke verified locally with deeply-nested iCloud paths — see
follow-up comment for screenshot. Short paths render unchanged with `~`
substitution; long paths left-clip with a leading `…` so the trailing
repo name stays visible; full absolute path appears on hover.

The change leans on already-tested primitives:

- `warp_util::path::user_friendly_path` has unit tests in
`crates/warp_util/src/path_test.rs`.
- `crate::util::truncation::truncate_from_beginning` is the same helper
used elsewhere in the app.
- `FilterableDropdown::set_selected_by_action` and
`MenuItemFields::with_tooltip` are existing primitives.

## Agent Mode

- [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode

## Changelog Entries for Stable

CHANGELOG-IMPROVEMENT: Tab config repo picker now abbreviates the home
directory to `~`, left-truncates long paths so the trailing repo name
stays visible, and surfaces the full absolute path on hover so deeply
nested saved repos stay distinguishable.

---------

Co-authored-by: Oz <oz-agent@warp.dev>
Co-authored-by: Claude <noreply@anthropic.com>
kevinchevalier pushed a commit that referenced this pull request May 19, 2026
## Description

Fixes #10862. The new-tab worktree menu truncates long repo paths from
the right, hiding the distinguishing trailing folder when worktrees
share a long parent path. Maintainer @moirahuang scoped the work to
mirror the repo-picker fix from PR #9451 (#9439), excluding the
"management controls" half of the original ask.

This PR ports the same three-part pattern to
`build_worktree_sidecar_items` in `app/src/workspace/view.rs`:

1. Tilde-substitute the home directory in the displayed label via
`warp_util::path::user_friendly_path`.
2. Apply `ClipConfig::start()` so truncation eats from the left and the
trailing repo name stays visible.
3. Add `with_tooltip(path_str)` so the full absolute path is available
on hover.

The raw path is preserved unchanged in the `OpenWorktreeRepo { repo_path
}` action, so the actual cd target is unaffected.

## Linked Issue

Fixes #10862.

- [x] The linked issue is labeled `ready-to-spec` or
`ready-to-implement`.
- [x] Where appropriate, screenshots or a short video of the
implementation are included below.

## Testing

**Automated.** No new tests added, matching the precedent set by
reference PR #9451 (`b87da5fe`), which made the same three-part change
to the repo picker without new tests. The change is mechanical builder
calls on `MenuItemFields`; no logic to regress. Full warp-crate test
suite passes locally (`cargo nextest run -p warp`: 4144/4144 pass).

**Manual.** Built with `./script/run`, opened the new-tab menu, hovered
"New worktree config", and verified worktree entries render with
tilde-substituted display labels. Screenshot below.

- [x] I have manually tested my changes locally with `./script/run`

### Screenshots / Videos

![Worktree menu in new-tab dropdown after the fix: every indexed repo's
path is shown with the home directory abbreviated to
`~/...`.](https://i.ibb.co/5hkf6G0V/Screenshot-2026-05-14-at-6-12-05-PM.png)

## Agent Mode

- [ ] Warp Agent Mode

CHANGELOG-IMPROVEMENT: The new-tab worktree menu now abbreviates the
home directory to `~`, left-truncates long paths so the trailing repo
name stays visible, and surfaces the full absolute path on hover
(#10862).
lawsmd pushed a commit to lawsmd/cortex that referenced this pull request May 22, 2026
…#9451)

## Description

Fixes warpdotdev#9439.

<img width="488" height="244" alt="Screenshot 2026-05-01 at 8 47 55 PM"
src="https://github.com/user-attachments/assets/d9a91703-d4f3-4577-9406-e922bb517382"
/>

The tab config `type = "repo"` picker renders saved repos as raw,
single-line entries. When several saved repos live deep inside paths
like `~/Library/Mobile Documents/iCloud~md~obsidian/Documents/...`, the
visible portion of two different rows can be byte-for-byte identical, so
the user can't reliably pick the right one.

Per @moirahuang and @alokedesai's preferred direction (warpdotdev#9439 comment, PR
review), this is a **left-clip + `~` substitution + tooltip** approach —
no soft-wrap, no schema changes:

1. **`~` substitution for the home directory** in the displayed label,
via `warp_util::path::user_friendly_path` — the same helper already used
in `tab_configs/action_sidecar.rs` and
`tab_configs/session_config_rendering.rs`. The dropdown action and the
cached `self.selected` continue to carry the raw absolute path so
launched sessions resolve correctly.
2. **Left-truncation with a leading `…`**
(`crate::util::truncation::truncate_from_beginning`) at a 40-character
cap. The trailing repo name — the most distinctive part of the path —
stays visible in every row.
3. **Hover tooltip with the full absolute path** via the existing
`MenuItemFields::with_tooltip`, exposed through a new `with_tooltip`
builder on `DropdownItem`. Even after `~` substitution and left-clip the
user can recover the original path.
4. **Action-based preselection.** `RepoPicker::refresh_items` now calls
the existing public
`FilterableDropdown::set_selected_by_action(RepoPickerAction::Select(raw))`
instead of `set_selected_by_name(display)`. If two raw paths happen to
share the same trailing 40 characters, preselection still picks the
correct backing repo. `RepoPickerAction` already derives `PartialEq`, so
this is a small swap with no new public dropdown API.

The new `with_tooltip` builder on `DropdownItem` is opt-in (defaults to
`None`), so other `FilterableDropdown` consumers are unaffected.

### Out of scope (left for follow-ups)

- **User-defined nicknames / aliases.** The issue body flags this as a
saved-repo metadata change rather than picker UX.
- **Soft-wrap to two lines.** Considered earlier in this PR; reverted
per maintainer review in favor of the left-clip approach.
- **Mid-path elision.** Left-clip supersedes this for the picker rows.

## Testing

`cargo fmt --check -p warp`, `cargo check -p warp`, and `cargo clippy -p
warp --all-targets` are all clean locally.

Manual smoke verified locally with deeply-nested iCloud paths — see
follow-up comment for screenshot. Short paths render unchanged with `~`
substitution; long paths left-clip with a leading `…` so the trailing
repo name stays visible; full absolute path appears on hover.

The change leans on already-tested primitives:

- `warp_util::path::user_friendly_path` has unit tests in
`crates/warp_util/src/path_test.rs`.
- `crate::util::truncation::truncate_from_beginning` is the same helper
used elsewhere in the app.
- `FilterableDropdown::set_selected_by_action` and
`MenuItemFields::with_tooltip` are existing primitives.

## Agent Mode

- [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode

## Changelog Entries for Stable

CHANGELOG-IMPROVEMENT: Tab config repo picker now abbreviates the home
directory to `~`, left-truncates long paths so the trailing repo name
stays visible, and surfaces the full absolute path on hover so deeply
nested saved repos stay distinguishable.

---------

Co-authored-by: Oz <oz-agent@warp.dev>
Co-authored-by: Claude <noreply@anthropic.com>
lawsmd pushed a commit to lawsmd/cortex that referenced this pull request May 22, 2026
…warpdotdev#10958)

## Description

Fixes warpdotdev#10862. The new-tab worktree menu truncates long repo paths from
the right, hiding the distinguishing trailing folder when worktrees
share a long parent path. Maintainer @moirahuang scoped the work to
mirror the repo-picker fix from PR warpdotdev#9451 (warpdotdev#9439), excluding the
"management controls" half of the original ask.

This PR ports the same three-part pattern to
`build_worktree_sidecar_items` in `app/src/workspace/view.rs`:

1. Tilde-substitute the home directory in the displayed label via
`warp_util::path::user_friendly_path`.
2. Apply `ClipConfig::start()` so truncation eats from the left and the
trailing repo name stays visible.
3. Add `with_tooltip(path_str)` so the full absolute path is available
on hover.

The raw path is preserved unchanged in the `OpenWorktreeRepo { repo_path
}` action, so the actual cd target is unaffected.

## Linked Issue

Fixes warpdotdev#10862.

- [x] The linked issue is labeled `ready-to-spec` or
`ready-to-implement`.
- [x] Where appropriate, screenshots or a short video of the
implementation are included below.

## Testing

**Automated.** No new tests added, matching the precedent set by
reference PR warpdotdev#9451 (`1f5a9300`), which made the same three-part change
to the repo picker without new tests. The change is mechanical builder
calls on `MenuItemFields`; no logic to regress. Full warp-crate test
suite passes locally (`cargo nextest run -p warp`: 4144/4144 pass).

**Manual.** Built with `./script/run`, opened the new-tab menu, hovered
"New worktree config", and verified worktree entries render with
tilde-substituted display labels. Screenshot below.

- [x] I have manually tested my changes locally with `./script/run`

### Screenshots / Videos

![Worktree menu in new-tab dropdown after the fix: every indexed repo's
path is shown with the home directory abbreviated to
`~/...`.](https://i.ibb.co/5hkf6G0V/Screenshot-2026-05-14-at-6-12-05-PM.png)

## Agent Mode

- [ ] Warp Agent Mode

CHANGELOG-IMPROVEMENT: The new-tab worktree menu now abbreviates the
home directory to `~`, left-truncates long paths so the trailing repo
name stays visible, and surfaces the full absolute path on hover
(warpdotdev#10862).
Stoica-Mihai pushed a commit to Stoica-Mihai/warp that referenced this pull request Jun 5, 2026
…#9451)

## Description

Fixes warpdotdev#9439.

<img width="488" height="244" alt="Screenshot 2026-05-01 at 8 47 55 PM"
src="https://github.com/user-attachments/assets/d9a91703-d4f3-4577-9406-e922bb517382"
/>

The tab config `type = "repo"` picker renders saved repos as raw,
single-line entries. When several saved repos live deep inside paths
like `~/Library/Mobile Documents/iCloud~md~obsidian/Documents/...`, the
visible portion of two different rows can be byte-for-byte identical, so
the user can't reliably pick the right one.

Per @moirahuang and @alokedesai's preferred direction (warpdotdev#9439 comment, PR
review), this is a **left-clip + `~` substitution + tooltip** approach —
no soft-wrap, no schema changes:

1. **`~` substitution for the home directory** in the displayed label,
via `warp_util::path::user_friendly_path` — the same helper already used
in `tab_configs/action_sidecar.rs` and
`tab_configs/session_config_rendering.rs`. The dropdown action and the
cached `self.selected` continue to carry the raw absolute path so
launched sessions resolve correctly.
2. **Left-truncation with a leading `…`**
(`crate::util::truncation::truncate_from_beginning`) at a 40-character
cap. The trailing repo name — the most distinctive part of the path —
stays visible in every row.
3. **Hover tooltip with the full absolute path** via the existing
`MenuItemFields::with_tooltip`, exposed through a new `with_tooltip`
builder on `DropdownItem`. Even after `~` substitution and left-clip the
user can recover the original path.
4. **Action-based preselection.** `RepoPicker::refresh_items` now calls
the existing public
`FilterableDropdown::set_selected_by_action(RepoPickerAction::Select(raw))`
instead of `set_selected_by_name(display)`. If two raw paths happen to
share the same trailing 40 characters, preselection still picks the
correct backing repo. `RepoPickerAction` already derives `PartialEq`, so
this is a small swap with no new public dropdown API.

The new `with_tooltip` builder on `DropdownItem` is opt-in (defaults to
`None`), so other `FilterableDropdown` consumers are unaffected.

### Out of scope (left for follow-ups)

- **User-defined nicknames / aliases.** The issue body flags this as a
saved-repo metadata change rather than picker UX.
- **Soft-wrap to two lines.** Considered earlier in this PR; reverted
per maintainer review in favor of the left-clip approach.
- **Mid-path elision.** Left-clip supersedes this for the picker rows.

## Testing

`cargo fmt --check -p warp`, `cargo check -p warp`, and `cargo clippy -p
warp --all-targets` are all clean locally.

Manual smoke verified locally with deeply-nested iCloud paths — see
follow-up comment for screenshot. Short paths render unchanged with `~`
substitution; long paths left-clip with a leading `…` so the trailing
repo name stays visible; full absolute path appears on hover.

The change leans on already-tested primitives:

- `warp_util::path::user_friendly_path` has unit tests in
`crates/warp_util/src/path_test.rs`.
- `crate::util::truncation::truncate_from_beginning` is the same helper
used elsewhere in the app.
- `FilterableDropdown::set_selected_by_action` and
`MenuItemFields::with_tooltip` are existing primitives.

## Agent Mode

- [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode

## Changelog Entries for Stable

CHANGELOG-IMPROVEMENT: Tab config repo picker now abbreviates the home
directory to `~`, left-truncates long paths so the trailing repo name
stays visible, and surfaces the full absolute path on hover so deeply
nested saved repos stay distinguishable.

---------

Co-authored-by: Oz <oz-agent@warp.dev>
Co-authored-by: Claude <noreply@anthropic.com>
Stoica-Mihai pushed a commit to Stoica-Mihai/warp that referenced this pull request Jun 5, 2026
…warpdotdev#10958)

## Description

Fixes warpdotdev#10862. The new-tab worktree menu truncates long repo paths from
the right, hiding the distinguishing trailing folder when worktrees
share a long parent path. Maintainer @moirahuang scoped the work to
mirror the repo-picker fix from PR warpdotdev#9451 (warpdotdev#9439), excluding the
"management controls" half of the original ask.

This PR ports the same three-part pattern to
`build_worktree_sidecar_items` in `app/src/workspace/view.rs`:

1. Tilde-substitute the home directory in the displayed label via
`warp_util::path::user_friendly_path`.
2. Apply `ClipConfig::start()` so truncation eats from the left and the
trailing repo name stays visible.
3. Add `with_tooltip(path_str)` so the full absolute path is available
on hover.

The raw path is preserved unchanged in the `OpenWorktreeRepo { repo_path
}` action, so the actual cd target is unaffected.

## Linked Issue

Fixes warpdotdev#10862.

- [x] The linked issue is labeled `ready-to-spec` or
`ready-to-implement`.
- [x] Where appropriate, screenshots or a short video of the
implementation are included below.

## Testing

**Automated.** No new tests added, matching the precedent set by
reference PR warpdotdev#9451 (`ba69b781`), which made the same three-part change
to the repo picker without new tests. The change is mechanical builder
calls on `MenuItemFields`; no logic to regress. Full warp-crate test
suite passes locally (`cargo nextest run -p warp`: 4144/4144 pass).

**Manual.** Built with `./script/run`, opened the new-tab menu, hovered
"New worktree config", and verified worktree entries render with
tilde-substituted display labels. Screenshot below.

- [x] I have manually tested my changes locally with `./script/run`

### Screenshots / Videos

![Worktree menu in new-tab dropdown after the fix: every indexed repo's
path is shown with the home directory abbreviated to
`~/...`.](https://i.ibb.co/5hkf6G0V/Screenshot-2026-05-14-at-6-12-05-PM.png)

## Agent Mode

- [ ] Warp Agent Mode

CHANGELOG-IMPROVEMENT: The new-tab worktree menu now abbreviates the
home directory to `~`, left-truncates long paths so the trailing repo
name stays visible, and surfaces the full absolute path on hover
(warpdotdev#10862).
Zollicoff pushed a commit to Zollicoff/warp that referenced this pull request Jul 2, 2026
…#9451)

## Description

Fixes warpdotdev#9439.

<img width="488" height="244" alt="Screenshot 2026-05-01 at 8 47 55 PM"
src="https://github.com/user-attachments/assets/d9a91703-d4f3-4577-9406-e922bb517382"
/>

The tab config `type = "repo"` picker renders saved repos as raw,
single-line entries. When several saved repos live deep inside paths
like `~/Library/Mobile Documents/iCloud~md~obsidian/Documents/...`, the
visible portion of two different rows can be byte-for-byte identical, so
the user can't reliably pick the right one.

Per @moirahuang and @alokedesai's preferred direction (warpdotdev#9439 comment, PR
review), this is a **left-clip + `~` substitution + tooltip** approach —
no soft-wrap, no schema changes:

1. **`~` substitution for the home directory** in the displayed label,
via `warp_util::path::user_friendly_path` — the same helper already used
in `tab_configs/action_sidecar.rs` and
`tab_configs/session_config_rendering.rs`. The dropdown action and the
cached `self.selected` continue to carry the raw absolute path so
launched sessions resolve correctly.
2. **Left-truncation with a leading `…`**
(`crate::util::truncation::truncate_from_beginning`) at a 40-character
cap. The trailing repo name — the most distinctive part of the path —
stays visible in every row.
3. **Hover tooltip with the full absolute path** via the existing
`MenuItemFields::with_tooltip`, exposed through a new `with_tooltip`
builder on `DropdownItem`. Even after `~` substitution and left-clip the
user can recover the original path.
4. **Action-based preselection.** `RepoPicker::refresh_items` now calls
the existing public
`FilterableDropdown::set_selected_by_action(RepoPickerAction::Select(raw))`
instead of `set_selected_by_name(display)`. If two raw paths happen to
share the same trailing 40 characters, preselection still picks the
correct backing repo. `RepoPickerAction` already derives `PartialEq`, so
this is a small swap with no new public dropdown API.

The new `with_tooltip` builder on `DropdownItem` is opt-in (defaults to
`None`), so other `FilterableDropdown` consumers are unaffected.

### Out of scope (left for follow-ups)

- **User-defined nicknames / aliases.** The issue body flags this as a
saved-repo metadata change rather than picker UX.
- **Soft-wrap to two lines.** Considered earlier in this PR; reverted
per maintainer review in favor of the left-clip approach.
- **Mid-path elision.** Left-clip supersedes this for the picker rows.

## Testing

`cargo fmt --check -p warp`, `cargo check -p warp`, and `cargo clippy -p
warp --all-targets` are all clean locally.

Manual smoke verified locally with deeply-nested iCloud paths — see
follow-up comment for screenshot. Short paths render unchanged with `~`
substitution; long paths left-clip with a leading `…` so the trailing
repo name stays visible; full absolute path appears on hover.

The change leans on already-tested primitives:

- `warp_util::path::user_friendly_path` has unit tests in
`crates/warp_util/src/path_test.rs`.
- `crate::util::truncation::truncate_from_beginning` is the same helper
used elsewhere in the app.
- `FilterableDropdown::set_selected_by_action` and
`MenuItemFields::with_tooltip` are existing primitives.

## Agent Mode

- [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode

## Changelog Entries for Stable

CHANGELOG-IMPROVEMENT: Tab config repo picker now abbreviates the home
directory to `~`, left-truncates long paths so the trailing repo name
stays visible, and surfaces the full absolute path on hover so deeply
nested saved repos stay distinguishable.

---------

Co-authored-by: Oz <oz-agent@warp.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed external-contributor Indicates that a PR has been opened by someone outside the Warp team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tab config repo picker truncates long paths with no way to see, scroll, or alias them

5 participants