Add Image viewer overlay and fix max-width of images in chat#122
Merged
Add Image viewer overlay and fix max-width of images in chat#122
Conversation
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.
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.
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:
index.htmlthat 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.app.cssfor the.image-viewer-overlayand related elements to provide proper overlay appearance, transitions, and controls for the image viewer.Chat image interactivity and styling improvements:
ChatMessageList.razor.cssto addcursor: pointerto images and image containers, signaling interactivity and matching the new viewer behavior. [1] [2] [3].markdown-body imgstyles to ensure images are responsive, have rounded corners, and display a pointer cursor, improving both aesthetics and usability.