feat(preprod): Show original filename tooltip on renamed snapshots#111325
feat(preprod): Show original filename tooltip on renamed snapshots#111325NicoHinderling merged 3 commits intomasterfrom
Conversation
| <InlineCode>{currentImage.image_file_name}</InlineCode> | ||
| </span> | ||
| } | ||
| maxWidth={2000} |
There was a problem hiding this comment.
What's the 2000 here? Seems oddly specific
There was a problem hiding this comment.
it's the max width, i just don't want the tooltip wrap unless it really needs to. really any big number here i guess lol
static/app/views/preprod/snapshots/main/snapshotMainContent.tsx
Outdated
Show resolved
Hide resolved
f980cce to
9857c17
Compare
This stack of pull requests is managed by Graphite. Learn more about stacking. |
| <Layout.Title> | ||
| {/* TODO: Replace with app-id/version when available */} | ||
| <Heading as="h2">{t('Snapshots')}</Heading> | ||
| {t('Snapshots')} |
There was a problem hiding this comment.
technically unrelated to this change, but noticed this simple console error I wanted to fix too
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Removed empty filename guard renders empty InlineCode element
- Added a truthiness guard in
ImageFileNameso empty filenames now render nothing instead of an emptyInlineCodebadge.
- Added a truthiness guard in
Or push these changes by commenting:
@cursor push bb23dfbf76
Preview (bb23dfbf76)
diff --git a/static/app/views/preprod/snapshots/main/snapshotMainContent.tsx b/static/app/views/preprod/snapshots/main/snapshotMainContent.tsx
--- a/static/app/views/preprod/snapshots/main/snapshotMainContent.tsx
+++ b/static/app/views/preprod/snapshots/main/snapshotMainContent.tsx
@@ -286,6 +286,10 @@
fileName: string;
previousFileName?: string;
}) {
+ if (!fileName) {
+ return null;
+ }
+
if (previousFileName) {
return (
<TooltipThis Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
Add previous_image_file_name to SnapshotImage type and display a tooltip on renamed image filenames showing the rename transition (old name → new name). Renamed filenames use the accent InlineCode variant as a visual hint that they are hoverable. Refs EME-961 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Changed and renamed types shared one union variant which prevented TypeScript from narrowing the discriminant after type guards.
9857c17 to
b1f224b
Compare
…#111332) ## Summary Follow-up to #111325 — refactors renamed snapshot items to use `SnapshotDiffPair` instead of a flat `SnapshotImageResponse` with a `previous_image_file_name` field. A rename is conceptually a diff from old image → new image, so the pair structure naturally models this: - `base_image` = old filename (looked up by `previous_image_file_name`) - `head_image` = new filename - `diff` / `diff_image_key` remain `None` (no visual diff for renames) ### Changes - **`SnapshotImageResponse`**: Remove `previous_image_file_name` field (no longer needed in API response) - **`SnapshotDetailsApiResponse`**: Change `renamed` from `list[SnapshotImageResponse]` to `list[SnapshotDiffPair]` - **`CategorizedComparison`**: Same type change for `renamed` - **`categorize_comparison_images`**: Build `SnapshotDiffPair` for renamed items by looking up base image by old filename from `base_images_by_file_name` Note: `previous_image_file_name` is kept on `ComparisonImageResult` in `manifest.py` — that's internal transport from tasks → categorizer, not part of the API response. ## Test plan - [ ] Existing backend snapshot tests pass - [ ] Frontend PR (#111325) updated to consume renamed as `SnapshotDiffPair[]` - [ ] Manual: renamed items show tooltip with old → new filename --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>



Show the previous filename when hovering over a renamed snapshot image's filename.
When images are renamed between builds, the UI now shows a tooltip with the rename
transition (
old_name → new_name) on hover. Renamed filenames use the accentInlineCodevariant (purple tint) as a visual hint that additional info is available.Changes:
previous_image_file_nameto theSnapshotImageTypeScript interfaceTooltipshowing the before → after namesInlineCodeinside the tooltip for consistent stylingCloses EME-961
Regular snapshot title UI:

Renamed snapshot title:

tooltip if you hover the title:
