-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Security solution] Elastic AI Assistant Modal CSS Improvements #160799
Conversation
@@ -446,44 +447,58 @@ const AssistantComponent: React.FC<Props> = ({ | |||
{Object.keys(promptContexts).length > 0 && <EuiSpacer size={'s'} />} | |||
</> | |||
)} | |||
</EuiModalHeader> | |||
<EuiModalBody> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By putting the dialog in EuiModalBody
, we allow eui to handle the scrolling behavior. The max-height
in now deleted CommentsContainer
was causing the modal to expand unexpectedly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
really nice!
Pinging @elastic/security-threat-hunting (Team:Threat Hunting) |
Pinging @elastic/security-solution (Team: SecuritySolution) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code LGTM, pulled down and tested looks really nice!
Only comment is that added data-test-subj
value that isn't used anywhere, yet
${({ theme }) => `margin-top: ${theme.eui.euiSizeXXL};`} | ||
min-width: 95vw; | ||
min-height: 25vh; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!!
@@ -79,7 +78,7 @@ export const AssistantOverlay: React.FC = React.memo(() => { | |||
return ( | |||
<> | |||
{isModalVisible && ( | |||
<StyledEuiModal onClose={handleCloseModal}> | |||
<StyledEuiModal onClose={handleCloseModal} data-test-subj="ai-assistant-modal"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this isn't used anywhere in the repo, did you intent to use it or was that just for temporary testing and should be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, there is not a ton of test coverage (any?), but after all this bug fixing I plan to come back with a unit test PR. I left this in there both because I plan on coming back to use it, and because it helps debug as I can cmd + F
and search for this label to find the markup when working with Chrome DevTools.
@@ -446,44 +447,58 @@ const AssistantComponent: React.FC<Props> = ({ | |||
{Object.keys(promptContexts).length > 0 && <EuiSpacer size={'s'} />} | |||
</> | |||
)} | |||
</EuiModalHeader> | |||
<EuiModalBody> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
really nice!
💚 Build Succeeded
Metrics [docs]Async chunks
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
…tic#160799) (cherry picked from commit a156e48)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…#160799) (#160882) # Backport This will backport the following commits from `main` to `8.9`: - [[Security solution] Elastic AI Assistant Modal CSS Improvements (#160799)](#160799) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Steph Milovic","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-06-29T12:35:28Z","message":"[Security solution] Elastic AI Assistant Modal CSS Improvements (#160799)","sha":"a156e4819323817d337379f417dc5b55203b8085","branchLabelMapping":{"^v8.10.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Threat Hunting","Team: SecuritySolution","v8.9.0","v8.10.0"],"number":160799,"url":"https://github.com/elastic/kibana/pull/160799","mergeCommit":{"message":"[Security solution] Elastic AI Assistant Modal CSS Improvements (#160799)","sha":"a156e4819323817d337379f417dc5b55203b8085"}},"sourceBranch":"main","suggestedTargetBranches":["8.9"],"targetPullRequestStates":[{"branch":"8.9","label":"v8.9.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.10.0","labelRegex":"^v8.10.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/160799","number":160799,"mergeCommit":{"message":"[Security solution] Elastic AI Assistant Modal CSS Improvements (#160799)","sha":"a156e4819323817d337379f417dc5b55203b8085"}}]}] BACKPORT--> Co-authored-by: Steph Milovic <[email protected]>
Summary
Bugfix for
Previous to this PR, the scrolling within the AI Assistant modal was controlled by
maxHeight
/overflowY
instead of havingEuiModalBody
handle the sizing. The max height caused issues with the modal being too big to close on small screens. Removes custom CSS in order to utilize the thoroughly testedEuiModal
scrolling implementationBefore (cannot close modal)
Tall, narrow screen
Laptop screen
After (close modal icon visible)
Tall, narrow screen
Laptop screen