fix(tooltip): show pixel dimensions for media files, not line counts#67
Merged
Conversation
…61) Hovering an image/video billboard surfaced the generic "N lines" suffix, which is a meaningless 0 for binary media. Show the pixel dimensions (e.g. 1920×1080) instead, falling back to line count when a media file has no stamped dimensions. Extract the hover-tooltip formatting out of the inputHandlers closure into a pure, unit-testable tooltipText module (rootName passed in rather than read off the manifest signal), and cover every target case with tests. Closes #61 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ab6e0e6 to
48f3863
Compare
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.
Closes #61.
Hovering a media/image billboard surfaced the generic building tooltip's
· N linessuffix — a meaningless0for binary media. Now it shows pixel dimensions instead.What changed
/codecity/app/logo.png · 1920×1080) instead of a line count.media_width/media_heightpresence rather thanmediaKind === 'image'. The backend only stamps those on recognized media, so it's self-guarding and fixes the same "0 lines" bug for video too — not just the image case named in the issue. Media files without stamped dimensions fall back to the line count.inputHandlersclosure into a pure, unit-testablecity/interaction/tooltipText.ts(formatHoverTooltip(target, rootName)— root name passed in rather than read off the manifest signal).inputHandlersshrank ~46 lines.Tests
tooltipText.test.tscovers every target case (file / image / dir / gem / commit, plus root-prefix edge cases).N lines, dir count pluralization).tsc --noEmitclean, eslint clean, full suite 2306/2306 green.🤖 Generated with Claude Code