fix: allow scrolling the sent-to-prompt code attachment#495
Draft
laileni-aws wants to merge 2 commits into
Draft
fix: allow scrolling the sent-to-prompt code attachment#495laileni-aws wants to merge 2 commits into
laileni-aws wants to merge 2 commits into
Conversation
The code snippet added via 'send to prompt' rendered its syntax highlighter with overflow: hidden, so long or wide code was clipped and could not be scrolled (no usable scrollbars) in either the inline prompt attachment or its preview overlay. Enable overflow: auto on the snippet's syntax highlighter when the inline attachment is hovered, and for the preview overlay (which is also made interactive), so the full code can be scrolled and viewed.
Keeps the repo lint gate green (strict-boolean-expressions).
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.
Problem
When code is added to the chat prompt via "Send to prompt" (right‑click → Amazon Q → Send to prompt, or the keyboard shortcut), the code snippet cannot be scrolled: long/wide code is clipped and the horizontal/vertical scrollbars are not usable, so the full code cannot be viewed — in both the inline prompt attachment and its hover preview.
Root cause
In
src/styles/components/chat/_chat-prompt-attachment.scss, the snippet's syntax highlighter is styled withoverflow: hidden(andpointer-events: none). On hover the inline attachment setspointer-events: autobut keepsoverflow: hidden, so there is never a usable scrollbar; the preview overlay inherits the sameoverflow: hidden.Fix
:hover, setoverflow: autoon the syntax highlighter so the (already interactive) snippet can be scrolled to view the full code..mynah-prompt-input-snippet-attachment-overlay): setoverflow: autoandpointer-events: autoon the syntax highlighter so the preview scrolls and is interactive.Scope / testing
overflow: hidden, so it is visually unchanged.npm run buildcompiles the styles; full unit suite,eslint, andprettier --checkpass. No end‑to‑end snapshot covers the hover/overlay state.Additional change
ui-tests/__test__/flows/quick-action-commands-header.ts: coerced a Playwrightevaluateresult to a boolean to satisfy@typescript-eslint/strict-boolean-expressionsand keep the repo lint gate green.