feat(tui): add semantic file path truncation#36352
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FilePathTUI component backed by a pure terminal-column truncation functionExamples
Verification
bun run test test/ui/file-path.test.ts: 8 passedbun run test: 235 passed, 1 skippedbun typecheck: passedgit diff --check: passedVisual verification
Responsive screenshots
Home footer at 64 columns
Pending patch with spinner
Completed patch at 100 columns
Session with the fixed 38-column sidebar footer and no inline session ID
Reverted file at 72 columns
A deterministic Drive script now creates a real Git baseline using anomalyco/opencode-drive#7, invokes OpenCode’s production
patchtool, and runs/undothroughSnapshot.ServiceandSessionRevert.The final recording verifies:
The script remains outside this branch at
/tmp/opencode-drive-git-project-proof.ts; no fixture or media artifacts are committed.The real Modified Files sidebar remains blocked independently by #36351 because V2 does not currently populate
session_diff.File tool presentation
The final recording also verifies that block file-tool headers align with shell-card content, use spinner +
Patchingwhile pending, switch to← Patched <path>when complete, and visibly compact the same long path across 150, 100, and 72-column viewports.Sidebar footer
The fixed 38-column sidebar footer now renders its project directory as one compacted line while retaining the existing muted-parent and bright-basename treatment. Home-relative paths retain
~/when they fit and use the normal ellipsis compaction when they do not.