refactor: shorten file mentions in thread titles#1036
refactor: shorten file mentions in thread titles#1036neriousy wants to merge 1 commit intopingdotgg:mainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment Tip CodeRabbit can approve the review once all CodeRabbit's comments are resolved.Enable the |
There was a problem hiding this comment.
Pull request overview
This PR replaces the generic truncateTitle helper with a thread-specific buildThreadTitle that normalizes composer @path mentions to their basenames before applying truncation, then updates thread creation flows to use it.
Changes:
- Removed
truncateTitleand its unit tests. - Added
buildThreadTitlewith mention-aware normalization + new unit tests. - Updated
ChatViewto usebuildThreadTitlefor new thread titles (including plan implementation threads).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| apps/web/src/truncateTitle.ts | Removed the old generic title truncation helper. |
| apps/web/src/truncateTitle.test.ts | Removed tests for the deleted helper. |
| apps/web/src/threadTitle.ts | Added mention-aware thread title normalization + truncation. |
| apps/web/src/threadTitle.test.ts | Added coverage for mention shortening + truncation ordering. |
| apps/web/src/components/ChatView.tsx | Switched thread-title generation to buildThreadTitle. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
What Changed
Mentioning a file at the start would insert the full file path into the thread name.
This PR makes it so rather than inserting the full file path, only the
@filename.tsxgets inserted in thereWhy
Having the full file path in there was making it hard to distinguish threads (yeah you can still rename them but it was annoying to look at)
UI Changes
First thread is before, second is after
Note
Replace
truncateTitlewithbuildThreadTitleto shorten @file mentions in thread titlesbuildThreadTitlewhich replaces full file paths in@mentionsegments with their basenames before truncating to 50 characters with an ellipsis.truncateTitleand its tests, replacing all call sites inChatViewwith the new utility.@filementions now display only the filename (e.g.@foo.ts) rather than the full path before truncation.Macroscope summarized 1d7307f.