Skip to content
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

Merged
merged 3 commits into from
Jun 29, 2023

Conversation

stephmilovic
Copy link
Contributor

@stephmilovic stephmilovic commented Jun 28, 2023

Summary

Bugfix for

  • Can't close the Elastic Security Assistant modal

Previous to this PR, the scrolling within the AI Assistant modal was controlled by maxHeight/overflowY instead of having EuiModalBody 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 tested EuiModal scrolling implementation

Before (cannot close modal)

Tall, narrow screen
Screenshot 2023-06-28 at 3 56 58 PM
Laptop screen
b2

After (close modal icon visible)

Tall, narrow screen
a1
Laptop screen
a2

@stephmilovic stephmilovic added release_note:skip Skip the PR/issue when compiling release notes Team:Threat Hunting Security Solution Threat Hunting Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.9.0 v8.10.0 labels Jun 28, 2023
@@ -446,44 +447,58 @@ const AssistantComponent: React.FC<Props> = ({
{Object.keys(promptContexts).length > 0 && <EuiSpacer size={'s'} />}
</>
)}
</EuiModalHeader>
<EuiModalBody>
Copy link
Contributor Author

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really nice!

@stephmilovic stephmilovic marked this pull request as ready for review June 28, 2023 21:01
@stephmilovic stephmilovic requested a review from a team as a code owner June 28, 2023 21:01
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-threat-hunting (Team:Threat Hunting)

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@stephmilovic stephmilovic changed the title [Security solution] Elastic AI Assistant Bug Fixing [Security solution] Elastic AI Assistant Modal CSS Improvements Jun 28, 2023
Copy link
Contributor

@PhilippeOberti PhilippeOberti left a 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

Comment on lines +21 to +23
${({ theme }) => `margin-top: ${theme.eui.euiSizeXXL};`}
min-width: 95vw;
min-height: 25vh;
Copy link
Contributor

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">
Copy link
Contributor

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?

Copy link
Contributor Author

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>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really nice!

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 11.0MB 11.0MB +816.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
@kbn/elastic-assistant 20 19 -1
enterpriseSearch 14 16 +2
securitySolution 413 417 +4
total +5

Total ESLint disabled count

id before after diff
@kbn/elastic-assistant 20 19 -1
enterpriseSearch 15 17 +2
securitySolution 492 496 +4
total +5

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@stephmilovic stephmilovic merged commit a156e48 into elastic:main Jun 29, 2023
@stephmilovic stephmilovic deleted the bugfix_ai branch June 29, 2023 12:35
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jun 29, 2023
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.9

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jun 29, 2023
…#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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting Security Solution Threat Hunting Team v8.9.0 v8.10.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants