Skip to content

Add Image viewer overlay and fix max-width of images in chat#122

Merged
PureWeen merged 2 commits intomainfrom
dev/redth/img-max-width
Feb 17, 2026
Merged

Add Image viewer overlay and fix max-width of images in chat#122
PureWeen merged 2 commits intomainfrom
dev/redth/img-max-width

Conversation

@Redth
Copy link
Collaborator

@Redth Redth commented Feb 16, 2026

This pull request introduces a full-screen image viewer with zoom and pan capabilities for images within chat messages. It includes both the necessary JavaScript logic and supporting CSS, as well as minor style adjustments to improve image interactivity in the chat interface.

New full-screen image viewer:

  • Added a JavaScript module in index.html that enables users to click images in chat messages to open them in a full-screen overlay with support for zoom (mouse wheel or pinch), pan (drag), and keyboard escape to close.
  • Added CSS styles in app.css for the .image-viewer-overlay and related elements to provide proper overlay appearance, transitions, and controls for the image viewer.

Chat image interactivity and styling improvements:

  • Updated ChatMessageList.razor.css to add cursor: pointer to images and image containers, signaling interactivity and matching the new viewer behavior. [1] [2] [3]
  • Enhanced .markdown-body img styles to ensure images are responsive, have rounded corners, and display a pointer cursor, improving both aesthetics and usability.

Add ::deep .markdown-body img rules to ChatMessageList.razor.css so images in rendered markdown scale to their container (max-width: 100%), preserve aspect ratio (height: auto), and have rounded corners (border-radius: 6px). This prevents image overflow in chat messages and improves visual consistency.
Introduce a full-screen image viewer (overlay, close button, CSS) with zoom/pan support including mouse wheel zoom, mouse drag, and touch pinch-to-zoom/pan. JS is initialized in index.html with delegated clicks on chat images to open the viewer and exposes window.__imageViewer. Also add cursor: pointer to several message/image containers in ChatMessageList.razor.css to indicate clickability.
@PureWeen PureWeen merged commit 5b7df70 into main Feb 17, 2026
@PureWeen PureWeen deleted the dev/redth/img-max-width branch February 22, 2026 00:18
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