fix: label image references with filenames - #1958
Merged
Merged
Conversation
Co-Authored-By: GPT-5.6 Sol <noreply@openai.com>
|
Warning Review limit reached
On-demand reviews are free for the next 27 days. After that, they cost $0.25 per reviewed file. Or wait 41 minutes for your next included review. View limit detailsLimit details: You’ve used the included review currently available. Your 70 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (14)
Comment |
3 tasks
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.
Problem
Image references used generated labels such as
Image #3, while the attachment tray showed filenames such aspasted-image-4.png. Removing an earlier image or inserting the same image twice left both labels factually valid but visually contradictory, and users had no visible numbered list to reconcile them against.Solution
Image references now use the attachment filename everywhere users encounter the pointer: editor chips, plain-text copy, serialized markdown, sent-message links, and agent-authored attachment links. Images now follow the same naming rule as PDFs and other files, so a tray item and each reference to it share one stable label.
attachmentReferenceLabelin@threa/prosemirrorowns the filename-first rule for both markdown and TipTap. Existing[Image #N](attachment:...)content still parses. When old content has metadata, it renders the stored filename; metadata-free legacy image links retainImage #Nas a fallback. No migration or attachment ID behavior changes.The companion prompt and design-system examples now document filename labels. Opus independently recommended this choice because filenames remain stable under tray mutation and give screen readers the same identifier visible elsewhere.
Verification
Residual risk
imageIndexremains incontentJsonand clipboard HTML for backward compatibility, but it no longer overrides an available filename.🤖 PR by Pi using GPT-5.6 Sol
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.