Skip to content

feat(tui): use ellipsis in middle of file path instead of truncating for modified files list#9590

Closed
angristan wants to merge 2 commits into
anomalyco:devfrom
angristan:sidebar-truncate-dynamic
Closed

feat(tui): use ellipsis in middle of file path instead of truncating for modified files list#9590
angristan wants to merge 2 commits into
anomalyco:devfrom
angristan:sidebar-truncate-dynamic

Conversation

@angristan

@angristan angristan commented Jan 20, 2026

Copy link
Copy Markdown
Contributor

Closes #9592

What does this PR do?

I watched this video a couple of days ago where Scott Jenson talks about early on macOS where they moved the ellipsis in the middle of the file instead of the end to not trim critical information.
image

I found myself needing this in opencode, because when paths get long, the actual filename get truncated so the modified files list is less useful.

How did you verify your code works?

After/before:

image

Copilot AI review requested due to automatic review settings January 20, 2026 10:03
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

Copilot AI 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.

Pull request overview

This PR improves the user experience in the TUI by displaying file paths with middle truncation (ellipsis in the middle) instead of end truncation in the modified files list. This preserves the filename and extension, which are often the most important parts of the path.

Changes:

  • Added constants for sidebar width calculations to enable dynamic file path truncation
  • Updated modified files list to use Locale.truncateMiddle() with calculated width based on available space
  • Width calculation accounts for sidebar padding and stats display (additions/deletions)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@angristan
angristan force-pushed the sidebar-truncate-dynamic branch from ed381c2 to 3c7e99e Compare February 10, 2026 19:15
@angristan

Copy link
Copy Markdown
Contributor Author

OK I fixed the two-spaces gap between filename and diff, now it's one:

image

@johanohly

Copy link
Copy Markdown

Hope it's OK to bump this, I'd really like this as well.

@github-actions

Copy link
Copy Markdown
Contributor

Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR.

@github-actions github-actions Bot closed this Apr 26, 2026
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.

[FEATURE]: use ellipses in middle of file path instead of truncating for modified files list

3 participants