Skip to content

[ML][AI Connector] UX enhancements for editing fields in the AI Connector flyout#231037

Merged
alvarezmelissa87 merged 19 commits intoelastic:mainfrom
alvarezmelissa87:ai-connector-sections
Aug 19, 2025
Merged

[ML][AI Connector] UX enhancements for editing fields in the AI Connector flyout#231037
alvarezmelissa87 merged 19 commits intoelastic:mainfrom
alvarezmelissa87:ai-connector-sections

Conversation

@alvarezmelissa87
Copy link
Contributor

@alvarezmelissa87 alvarezmelissa87 commented Aug 7, 2025

Summary

Related issue: #226580
This PR updates the sections for the AI/Inference connector as described in the issue linked above.

AIConnectorSections.mov

Multiple authentication fields:
Addresses #226588

image

Elasticsearch on serverless with adaptive allocations:

image

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

  • Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
  • Documentation was added for features that require explanation or tutorials
  • Unit or functional tests were updated or added to match the most common scenarios
  • If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker list
  • 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.
  • Flaky Test Runner was used on any tests changed
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
  • Review the backport guidelines and apply applicable backport:* labels.
@alvarezmelissa87
Copy link
Contributor Author

cc @joana-cps - can you confirm the design looks alright? 🙏

@joana-cps
Copy link

cc @joana-cps - can you confirm the design looks alright? 🙏

Looks good, just adding this here for visibility. Can we have the Additional options close by default? Thanks

@alvarezmelissa87
Copy link
Contributor Author

/ci

@alvarezmelissa87 alvarezmelissa87 marked this pull request as ready for review August 11, 2025 22:53
@alvarezmelissa87 alvarezmelissa87 requested review from a team as code owners August 11, 2025 22:53
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

@alvarezmelissa87 alvarezmelissa87 requested a review from a team as a code owner August 12, 2025 18:25
@alvarezmelissa87 alvarezmelissa87 requested a review from qn895 August 12, 2025 18:27
import React, { useMemo, useState } from 'react';
import { EuiButtonGroup, EuiFlexGroup, EuiFlexItem, EuiTitle } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import { ConfigEntryView } from '../../types/types';
Copy link
Member

Choose a reason for hiding this comment

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

nit: import type ConfigEntryView

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch - updated in 7425aa0

<>
{description}{' '}
<EuiLink
href="https://www.elastic.co/guide/en/elasticsearch/reference/current/inference-apis.html#default-enpoints"
Copy link
Member

Choose a reason for hiding this comment

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

is this at all in the docsLink service?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for taking a look 🙏 It's not in the docsLink service. I did notice the url is wrong so I went ahead and updated it.
As this is the only link in the package and is only used for the internal provider, I'm not sure it's worth passing the whole service through. 🤔 Worth keeping an eye on as we update this code, though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to fix link in 7425aa0

);

return (
<EuiFlexGroup direction="column" data-test-subj="authentication-fields">
Copy link
Member

Choose a reason for hiding this comment

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

super duper nit: Suggestion to titleCase data-test-subj so they are formatted consistently with the rest of Kibana. Potentially prefix with 'inferenceUI'? e.g. inferenceUIAuthenticationFields

Copy link
Member

Choose a reason for hiding this comment

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

Never mind, just saw the test subjects for this plugin are in this format.

Copy link
Contributor

@Samiul-TheSoccerFan Samiul-TheSoccerFan left a comment

Choose a reason for hiding this comment

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

LGTM

<EuiTextColor color={euiTheme.colors.primary}>
<EuiTextColor
color={euiTheme.colors.primary}
data-test-subj="inference-endpoint-additional-options-button"
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: Do we need to update options to settings` here too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated for consistency in 7425aa0

Comment on lines +578 to +579
requiredProviderFormFields={authenticationFormFields}
setRequiredProviderFormFields={setAuthenticationFormFields}
Copy link
Contributor

Choose a reason for hiding this comment

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

nice, 👏

<EuiHorizontalRule margin="m" />
</>
) : null}
{/* ADDITIONAL OPTIONS */}
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this part anymore? Optional fields are already handled.

Copy link
Contributor

Choose a reason for hiding this comment

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

On a second thought, this might be the task_settings, I assume?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for taking a look, @Samiul-TheSoccerFan 🙏
Yes, these is now the extra settings like, task type and the inference endpoint.
'More options' is now the optional config settings for the provider.

So we've got
Required and not sensitive - Settings
Optional and not sensitive - More Options
Sensitive - Auth settings
Additional options - Inference endpoint and task type

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

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

Tested locally (including serverless) and LGTM

@alvarezmelissa87
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Member

@qn895 qn895 left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

@darnautov darnautov self-requested a review August 14, 2025 10:24
</h4>
</EuiTitle>
<EuiSpacer size="s" />
{actionTypeModel?.id && actionTypeModel.id !== '.inference' ? (
Copy link
Contributor

Choose a reason for hiding this comment

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

The generic connector form should not be aware of a specific connector ID or adjust its layout based on it. Such alterations are unsustainable and difficult to maintain.

With the planned work in #231016, do we actually need the current change?

If it’s really critical, we can consolidate this logic in one place and remove it once the issue above is resolved. There are already checks in formDeserializer and formSerializer for the .inference connector. Something like this would work:

// TODO remove when https://github.com/elastic/kibana/issues/231016 is resolved
const connectorOverrides = (connectorId: string) => {
  switch(connectorId): {
     case '.inference':
        return : {
           formDeserializer: ...
           formSerializer: ...
           shouldHideConnectorSettings: ...
        }
  }
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm - good point! Yes, I think adding the overrides make sense - with the intention of being able to remove them once they are no longer needed. AFAIK there is planning also being done for allowing the connector framework to have connector-specific serializers so that should solve that issue, as well.

Will update 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated here: 188f56f

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the edits @alvarezmelissa87! I noticed that instead of returning callbacks for formDeserializer and formSerializer, you’re returning serialized and deserialized forms. This makes everything happen at once, whereas we usually handle these steps one at a time. It also makes the naming semantically confusing. Left a suggestion below, but otherwise LGTM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Callbacks are a better idea 👍
Updated in 374211f

Comment on lines 96 to 98
const overrides = connectorOverrides(formData.actionTypeId, formData);
if (overrides?.formSerializer) {
return overrides.formSerializer;
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for consolidating the overrides in one place! I noticed the code unnecessarily serializes and deserializes the form at once. My suggestion was to return a callback instead.

  const overrides = connectorOverrides(formData.actionTypeId);
  if (overrides?.formSerializer) {
    return overrides.formSerializer(formData);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call - updated to be callbacks here 374211f

@alvarezmelissa87
Copy link
Contributor Author

@elasticmachine merge upstream

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
indexManagement 668 671 +3
searchInferenceEndpoints 146 149 +3
searchPlayground 399 402 +3
securitySolution 7882 7885 +3
stackConnectors 338 341 +3
triggersActionsUi 965 966 +1
total +16

Async chunks

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

id before after diff
indexManagement 681.6KB 683.4KB +1.8KB
searchInferenceEndpoints 98.7KB 100.4KB +1.8KB
securitySolution 10.4MB 10.4MB -6.0B
stackConnectors 620.0KB 621.8KB +1.8KB
triggersActionsUi 1.5MB 1.5MB +385.0B
total +5.7KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
triggersActionsUi 104.6KB 104.6KB -5.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
triggersActionsUi 102 103 +1

Total ESLint disabled count

id before after diff
triggersActionsUi 107 108 +1

History

cc @alvarezmelissa87

@alvarezmelissa87 alvarezmelissa87 merged commit 85f7585 into elastic:main Aug 19, 2025
12 checks passed
@alvarezmelissa87 alvarezmelissa87 deleted the ai-connector-sections branch August 19, 2025 16:39
qn895 pushed a commit to qn895/kibana that referenced this pull request Aug 26, 2025
…lastic#231037)

## Summary

Related issue:
elastic#226580
This PR updates the sections for the AI/Inference connector as described
in the issue linked above.



https://github.com/user-attachments/assets/0ab473a3-e444-4e02-a7e8-b522722247bf


Multiple authentication fields:
Addresses
elastic#226588

<img width="630" height="875" alt="image"
src="https://github.com/user-attachments/assets/fc66b51f-0699-42c7-9bba-f7ddff8b7e36"
/>

Elasticsearch on serverless with adaptive allocations:

<img width="635" height="928" alt="image"
src="https://github.com/user-attachments/assets/91217ee8-d7f0-4adf-a3e4-9731ab97ee08"
/>



### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] 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)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [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
- [ ] 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)
- [ ] 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.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] 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)
- [ ] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
@peteharverson peteharverson changed the title [ML][AI Connector] Updating sections and adding field improvements Sep 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting Feature:Inference UI ML Inference endpoints UI and AI connector :ml release_note:enhancement v9.2.0

8 participants