NUKnightLab / NUKnightLab/TimelineJS3

Add "imageblank" to allowable media types for thumbnails

Open Beginner friendly
#797 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
3.2k
Forks
645
PR merge metrics
No merged PRs in 30d

Description

In a ZenDesk question, someone reported a case of their customized thumbnails not appearing in their timeline, even though the same image URL was used for the main media on the slide, where they did appear.

The URLs went to something which might be a content management system; more to the point, they end with URL parameters, not a typical file extension. This means that they are handled using the "fallback" assumption that any URL which isn't something else should be treated as an image.

However, for thumbnails, this fallback is not considered, so the same URL did not have parallel results.

It seems like a low-risk fix to simply add the fallback into the image_only path through lookupMediaType. Architecturally, this might be a time to move the image_only smarts from hard-coded in the function into the url pattern data structure, since the "awareness" of whether a given Media subclass is suitable for getting a URL which can go into an img tag belongs with the subclass.

Structurally, it might be more elegant to move the URL testing responsibility into each Media subclass ("can you handle this URL?") but that would increase the effort to review and understand the entire system. So that's probably overengineering.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/js/media/MediaType.js, reading the fallback handling in lookupMediaType and the image_only branches referenced in the issue. Confirm how a URL with query parameters is classified for main media versus thumbnails; done when both paths accept the same fallback image URL behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.