8000 fix: correct thumbnail URL generation for Explorer and Trace by tamzrod · Pull Request #82 · tamzrod/Librarian · GitHub
[go: up one dir, main page]

Skip to content

fix: correct thumbnail URL generation for Explorer and Trace - #82

Merged
tamzrod merged 1 commit into
mainfrom
fix/thumbnail-url-generation
Jul 2, 2026
Merged

tamzrod merged 1 commit into
mainfrom
fix/thumbnail-url-generation

Conversation

@tamzrod
@tamzrod tamzrod commented Jul 2, 2026
Copy link
Copy Markdown
Owner

Summary

Fixes broken thumbnail rendering in the Artifact Explorer and Trace Event Stream views.

Problem

Thumbnails were not displaying - browsers showed broken image icons instead of actual thumbnails.

Root Cause

The frontend thumbnail URL generation functions were using an incorrect regex pattern:

  • Database stores: thumbnails/1018_IMG_xxx_thumb.jpg (no leading dot)
  • Old regex: /^\.thumbnails\// (looking for .thumbnails/ with a dot)
  • Result: No match occurred, so the prefix wasn't stripped, resulting in double thumbnails/ in URLs:
    • Broken URL: /thumbnails/thumbnails/1018_...
    • Expected URL: /thumbnails/1018_...

Fix

Changed the regex from /^\.thumbnails\// to /^thumbnails\// in both:

  • getThumbnailUrl() - used by Artifact Explorer
  • getTraceThumbnailUrl() - used by Trace Event Stream and Photo Popup

Files Changed

  • dashboard/src/services/api.ts - Fixed regex pattern in both thumbnail URL functions

Testing

  • Frontend builds successfully
  • Components verified: ArtifactExplorer.tsx, EventStream.tsx, PhotoPopup.tsx all use correct functions
  • No backend changes required
  • API contracts preserved

Verification Steps

  1. Deploy the updated dashboard container
  2. Navigate to Explorer or Trace view
  3. Verify thumbnails load with HTTP 200 responses
  4. Check browser devtools confirms URLs like /thumbnails/filename.jpg (not double prefix)

This PR was created by an AI agent (OpenHands) on behalf of the user.

@tamzrod can click here to continue refining the PR

The thumbnail URL functions were using an incorrect regex pattern.

Root cause:
- Database stores paths like 'thumbnails/filename_thumb.jpg'
- Old regex '/^\.thumbnails\//' looked for '.thumbnails/' (with leading dot)
- No match occurred, causing double 'thumbnails/' prefix in URLs

Fix:
- Changed regex to '/^thumbnails\//' to correctly match database format
- Updated getThumbnailUrl() and getTraceThumbnailUrl() functions
- Updated JSDoc comments to reflect actual data format

Result: Browser now requests correct URLs like '/thumbnails/filename.jpg'
instead of '/thumbnails/thumbnails/filename.jpg'

Co-authored-by: openhands <openhands@all-hands.dev>
@tamzrod
tamzrod marked this pull request as ready for review July 2, 2026 07:37
@tamzrod
tamzrod merged commit 2d5ef0c into main Jul 2, 2026
3 of 7 checks passed
@tamzrod
tamzrod deleted the fix/thumbnail-url-generation branch July 6, 2026 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0