Skip to content

Commit

Permalink
[Security Solution] [AI Assistant] security assistant content referen…
Browse files Browse the repository at this point in the history
…ces tour (elastic#208775)

## Summary
Follow up to : elastic#206683

This PR adds a tour that tells the user how to toggle citations on and
off and how to show and hide anonymized values.

### How to test:
- Enable feature flag: 
```yaml
# kibana.dev.yml
xpack.securitySolution.enableExperimental: ['contentReferencesEnabled']
```
- Launch the security AI assistant
- Now we need to get the assistant to reply with a message that contains
either anonymized values or citations. This is what triggers the tour.
To do this ask it a question about one of your KB documents or an alert
that contains anonymized properties or returns a citation.
- Once the assistant stream ends, the tour should appear 1 second later
(unless the knowledge base tour is open).

The tour will only appear one time per browser. To make it appear again,
clear the key
`elasticAssistant.anonymizedValuesAndCitationsTourCompleted` from local
storage.

Also fixes a
[typo](https://github.com/elastic/kibana/pull/208775/files#diff-e6ed566edfccebe7592cb2491ae0a601c2c54da879114e6100602b8b08099ca6R69).


https://github.com/user-attachments/assets/97fca992-d39d-43e7-8e73-a11daf7549ca


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [x] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...

---------

Co-authored-by: kibanamachine <[email protected]>
Co-authored-by: Elastic Machine <[email protected]>
Co-authored-by: Steph Milovic <[email protected]>
  • Loading branch information
4 people authored Feb 3, 2025
1 parent 6cc788c commit 572e665
Show file tree
Hide file tree
Showing 10 changed files with 516 additions and 176 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ interface OwnProps {
}

type Props = OwnProps;

export const AI_ASSISTANT_SETTINGS_MENU_CONTAINER_ID = 'aiAssistantSettingsMenuContainer';

/**
* Renders the header of the Elastic AI Assistant.
* Provide a user interface for selecting and managing conversations,
Expand Down Expand Up @@ -170,7 +173,7 @@ export const AssistantHeader: React.FC<Props> = ({
onConnectorSelected={onConversationChange}
/>
</EuiFlexItem>
<EuiFlexItem>
<EuiFlexItem id={AI_ASSISTANT_SETTINGS_MENU_CONTAINER_ID}>
<SettingsContextMenu isDisabled={isDisabled} onChatCleared={onChatCleared} />
</EuiFlexItem>
</EuiFlexGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const SHOW_REAL_VALUES = i18n.translate(
export const ANONYMIZE_VALUES = i18n.translate(
'xpack.elasticAssistant.assistant.settings.anonymizeValues',
{
defaultMessage: 'Show anonymize values',
defaultMessage: 'Show anonymized values',
}
);

Expand All @@ -89,7 +89,7 @@ const isMac = navigator.platform.toLowerCase().indexOf('mac') >= 0;
export const ANONYMIZE_VALUES_TOOLTIP = i18n.translate(
'xpack.elasticAssistant.assistant.settings.anonymizeValues.tooltip',
{
values: { keyboardShortcut: isMac ? '⌥ a' : 'Alt a' },
values: { keyboardShortcut: isMac ? '⌥ + a' : 'Alt + a' },
defaultMessage:
'Toggle to reveal or hide field values in your chat stream. The data sent to the LLM is still anonymized based on settings in the Anonymization panel. Keyboard shortcut: {keyboardShortcut}',
}
Expand All @@ -98,7 +98,7 @@ export const ANONYMIZE_VALUES_TOOLTIP = i18n.translate(
export const SHOW_CITATIONS_TOOLTIP = i18n.translate(
'xpack.elasticAssistant.assistant.settings.showCitationsLabel.tooltip',
{
values: { keyboardShortcut: isMac ? '⌥ c' : 'Alt c' },
values: { keyboardShortcut: isMac ? '⌥ + c' : 'Alt + c' },
defaultMessage: 'Keyboard shortcut: {keyboardShortcut}',
}
);
Expand Down
Loading

0 comments on commit 572e665

Please sign in to comment.