Skip to content

fix(tooltip): show pixel dimensions for media files, not line counts#67

Merged
thalida merged 1 commit into
mainfrom
worktree-fix+issue-61-image-tooltips
Jun 15, 2026
Merged

fix(tooltip): show pixel dimensions for media files, not line counts#67
thalida merged 1 commit into
mainfrom
worktree-fix+issue-61-image-tooltips

Conversation

@thalida

@thalida thalida commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Closes #61.

Hovering a media/image billboard surfaced the generic building tooltip's · N lines suffix — a meaningless 0 for binary media. Now it shows pixel dimensions instead.

What changed

  • Image/video billboards show dimensions (e.g. /codecity/app/logo.png · 1920×1080) instead of a line count.
  • Keyed off media_width/media_height presence rather than mediaKind === '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.
  • Refactor: extracted the hover-tooltip string logic out of the inputHandlers closure into a pure, unit-testable city/interaction/tooltipText.ts (formatHoverTooltip(target, rootName) — root name passed in rather than read off the manifest signal). inputHandlers shrank ~46 lines.

Tests

  • New tooltipText.test.ts covers every target case (file / image / dir / gem / commit, plus root-prefix edge cases).
  • Existing behavior preserved exactly (non-pluralized N lines, dir count pluralization).
  • tsc --noEmit clean, eslint clean, full suite 2306/2306 green.

🤖 Generated with Claude Code

@thalida thalida linked an issue Jun 15, 2026 that may be closed by this pull request
…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>
@thalida thalida force-pushed the worktree-fix+issue-61-image-tooltips branch from ab6e0e6 to 48f3863 Compare June 15, 2026 22:21
@thalida thalida merged commit 31fad68 into main Jun 15, 2026
1 check passed
@thalida thalida deleted the worktree-fix+issue-61-image-tooltips branch June 15, 2026 22:26
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.

Image tooltips show image size, not line count

1 participant