Skip to content

refactor: shorten file mentions in thread titles#1036

Open
neriousy wants to merge 1 commit intopingdotgg:mainfrom
neriousy:refactor/thread-title-file-mentions
Open

refactor: shorten file mentions in thread titles#1036
neriousy wants to merge 1 commit intopingdotgg:mainfrom
neriousy:refactor/thread-title-file-mentions

Conversation

@neriousy
Copy link

@neriousy neriousy commented Mar 13, 2026

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.tsx gets inserted in there

Why

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

image ## Checklist
  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Replace truncateTitle with buildThreadTitle to shorten @file mentions in thread titles

  • Introduces buildThreadTitle which replaces full file paths in @mention segments with their basenames before truncating to 50 characters with an ellipsis.
  • Removes truncateTitle and its tests, replacing all call sites in ChatView with the new utility.
  • Behavioral Change: Thread titles that include @file mentions now display only the filename (e.g. @foo.ts) rather than the full path before truncation.

Macroscope summarized 1d7307f.

Copilot AI review requested due to automatic review settings March 13, 2026 17:14
@coderabbitai
Copy link

coderabbitai bot commented Mar 13, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 4002ce15-5b86-4552-ad54-f4c82e8bc883

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can approve the review once all CodeRabbit's comments are resolved.

Enable the reviews.request_changes_workflow setting to automatically approve the review once all CodeRabbit's comments are resolved.

@github-actions github-actions bot added size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Mar 13, 2026
Copy link
Contributor

Copilot AI left a comment

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 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 truncateTitle and its unit tests.
  • Added buildThreadTitle with mention-aware normalization + new unit tests.
  • Updated ChatView to use buildThreadTitle for 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants