Skip to content

Make processor description clickable to edit#271219

Open
nikita-lavrov wants to merge 9 commits into
elastic:mainfrom
nikita-lavrov:1198-make-processor-description-clickable-to-edit
Open

Make processor description clickable to edit#271219
nikita-lavrov wants to merge 9 commits into
elastic:mainfrom
nikita-lavrov:1198-make-processor-description-clickable-to-edit

Conversation

@nikita-lavrov
Copy link
Copy Markdown
Contributor

Summary

Closes https://github.com/elastic/streams-program/issues/1198

This PR makes the processor description clickable to edit.

It also changes the behavior of the Unsaved badge. Now it only shows if the description, parent or branch of the processor differs from its original state. This prevents the badge from being displayed after we reverted the changes that we didn't save.

Demo

Before

Screen.Recording.2026-05-26.at.10.58.46.AM.mov

After

Screen.Recording.2026-05-26.at.10.47.09.AM.mov

@nikita-lavrov nikita-lavrov added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting labels May 26, 2026
@nikita-lavrov nikita-lavrov added Team:obs-onboarding Observability Onboarding Team Feature:Streams This is the label for the Streams Project labels May 26, 2026
@nikita-lavrov nikita-lavrov marked this pull request as ready for review May 26, 2026 12:50
@nikita-lavrov nikita-lavrov requested a review from a team as a code owner May 26, 2026 12:50
@infra-vault-gh-plugin-prod
Copy link
Copy Markdown

Pinging @elastic/obs-onboarding-team (Team:obs-onboarding)

@diogolima-elastic diogolima-elastic self-requested a review May 28, 2026 10:48
}
display="block"
>
<EuiText
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

question: if this text is working as a button should it have a aria-label for accessibility? not really sure if it works with the EuiText even with the role="button"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In 5353ca1 I changed it to EuiEmptyButton instead. The Voiceover correctly announces the tooltip content when focusing on the button.

<i>{stepDescription}</i>
</p>
<p>
{i18n.translate(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This edit text is rendering unconditionally, even when the user has no permissions to edit

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Addressed in 5353ca1


const saveDescription = () => {
const trimmedEditValue = editValue.trim();
if (stepDescription !== trimmedEditValue) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

possible edge case: if the user wants to freeze the auto-generated description it needs to edit and then edit again to do it, instead of comparing to the stepDescription that is the display name we could check against the step.description. I am not sure if this will really be something our users want to do but I don't see any downside in checking against the real description, wdyt?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think this would be confusing for the user, as in this case simply interacting with the auto-generated description will prompt the user to save the changes, even though from their perspective they haven't changed anything.

My rationale is that the description saved in a processor definition is a custom description, whereas the one we show the user in this case is a default one, that the user can change if they want to. Does this make sense?

Copy link
Copy Markdown
Contributor

@diogolima-elastic diogolima-elastic left a comment

Choose a reason for hiding this comment

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

Nice work here @nikita-lavrov , really smooth to edit now! Just found a small bug that needs fixing, if you have a processor saved in a stream and edit it, then edit the description and clear it (to revert to the previous name) when you press enter the Unsaved chip from the processor is gone, the button to Save is still present so I'm not sure if the changes are really gone or if it's just the chip

Also left some comments but those are small/picky stuff

Comment on lines +732 to +734
return !isEqual(
sanitiseForEditing(nextStreamlangDSL),
sanitiseForEditing(previousStreamlangDSL)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

StreamlangDSL might have the same object and properties, but their order might be different. This causes the equality check to fail when we convert them to strings.

const actionRestSanitised = stripUndefinedValues(actionRest);
return removeCustomIdentifiers
? actionRestSanitised
: { ...actionRestSanitised, customIdentifier };
Copy link
Copy Markdown
Contributor Author

@nikita-lavrov nikita-lavrov May 29, 2026

Choose a reason for hiding this comment

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

This prevents the bottom bar from appearing after we reverted all the changes we've made.

This works because when we save processor changes, the state machine receives an action step that can contain undefined values (those that we left empty while editing the processor). Because these undefined values aren't present in the previousStreamlangDSL, the equality check fails.

I can extract this and the changes in the state machines into a separate PR if there are concerns.

@nikita-lavrov
Copy link
Copy Markdown
Contributor Author

if you have a processor saved in a stream and edit it, then edit the description and clear it (to revert to the previous name) when you press enter the Unsaved chip from the processor is gone, the button to Save is still present

Fixed in 5353ca1

@kibanamachine
Copy link
Copy Markdown
Contributor

kibanamachine commented Jun 1, 2026

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #134 / Cloud Security Posture - Group 5 (KSPM + Flyouts) Security Alerts Page - Graph visualization expanded flyout - filter by node
  • [job] [logs] FTR Configs #134 / Cloud Security Posture - Group 5 (KSPM + Flyouts) Security Alerts Page - Graph visualization expanded flyout - filter by node
  • [job] [logs] FTR Configs #192 / Entity Analytics - Watchlists @ess @serverless @skipInServerlessMKI Entity Store Attribute Sync should remove the watchlist id from entity.attributes.watchlists on deletion but preserve other ids

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
streamsApp 1973 1971 -2

Async chunks

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

id before after diff
streamsApp 2.1MB 2.1MB -1.4KB

History

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:Streams This is the label for the Streams Project release_note:skip Skip the PR/issue when compiling release notes Team:obs-onboarding Observability Onboarding Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants