Skip to content

Add link hover preview to status bar#20

Merged
ptheofan merged 1 commit into
mainfrom
claude/resolve-issue-17-v4y9h
May 14, 2026
Merged

Add link hover preview to status bar#20
ptheofan merged 1 commit into
mainfrom
claude/resolve-issue-17-v4y9h

Conversation

@ptheofan

Copy link
Copy Markdown
Owner

Summary

This PR adds a feature that displays the target URL of hovered links in the status bar, improving the user experience when viewing rendered markdown documents.

Key Changes

  • Renderer: Added setupLinkHover() method to track mouse events over links and update the status bar with the target URL
  • StatusBar:
    • Added linkUrl property to the state
    • Implemented setLinkUrl() method to update the link display
    • Added #status-link element reference and initialization
  • Styling: Added .status-link CSS class with ellipsis truncation for long URLs and hide-when-empty behavior
  • HTML: Added status link element to the status bar footer
  • Documentation: Updated CHANGELOG with the new feature

Implementation Details

  • The link hover detection uses event delegation with mouseover, mouseout, and mouseleave events on the viewer container
  • Links are identified using closest('a[href]') to handle clicks on nested elements within links
  • The status bar element is hidden when empty using CSS (:empty pseudo-selector)
  • Long URLs are truncated with ellipsis, limited to 60 characters width
  • The implementation properly cleans up by clearing the link URL on mouseleave

https://claude.ai/code/session_0174FZDHzmNESyHbFdbd3giP

Resolves #17. Hovering over a link in a rendered markdown document
previously gave no feedback about its destination. Links now surface
their target URL in the status bar while hovered.

https://claude.ai/code/session_0174FZDHzmNESyHbFdbd3giP
@ptheofan ptheofan merged commit 4c8bc5b into main May 14, 2026
4 checks passed
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