Skip to content

[embeddable] Update naming of functions to make state ownership clearer#270270

Open
nreese wants to merge 9 commits into
elastic:mainfrom
nreese:initialize_state_api
Open

[embeddable] Update naming of functions to make state ownership clearer#270270
nreese wants to merge 9 commits into
elastic:mainfrom
nreese:initialize_state_api

Conversation

@nreese
Copy link
Copy Markdown
Contributor

@nreese nreese commented May 20, 2026

Background

The embeddable system was originally designed to only support resetting embeddable state from resetting unsaved changes. With current "dashboard in chat" and future undo/redo features, the embeddable system needs to support resetting embeddable state from more than just resetting unsaved changes. This PR migrates names away from unsaved changes nomenclature to more generic names.

Changes

  • initializeUnsavedChanges -> initializeStateApi
  • initializeStateApi return type changed to include serializeState
  • onReset -> applySerializedState
  • applySerializedState is passed state instead of state | undefined

@nreese nreese force-pushed the initialize_state_api branch from fa8c828 to 8aa8169 Compare May 21, 2026 11:46
@nreese
Copy link
Copy Markdown
Contributor Author

nreese commented May 21, 2026

/ci

@nreese nreese changed the title initialize state api [embeddable] Update naming of functions to make state ownership clearer May 21, 2026
@nreese
Copy link
Copy Markdown
Contributor Author

nreese commented May 21, 2026

/ci

1 similar comment
@nreese
Copy link
Copy Markdown
Contributor Author

nreese commented May 21, 2026

/ci

@nreese
Copy link
Copy Markdown
Contributor Author

nreese commented May 21, 2026

/ci

@nreese
Copy link
Copy Markdown
Contributor Author

nreese commented May 21, 2026

/ci

@kibanamachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Scout Lane #11 - stateful-classic / default / local-stateful-classic - Profiling is setup and data is loaded - Admin user
  • [job] [logs] Scout Lane #21 - stateful-classic / uptime_legacy / local-stateful-classic - snapshot count - counts correctly with timespans=true and observer=true

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
aiops 530.8KB 530.7KB -90.0B
apm 2.8MB 2.8MB -558.0B
controls 528.2KB 528.0KB -128.0B
dashboardMarkdown 76.2KB 76.2KB -7.0B
dataVisualizer 621.9KB 621.9KB -10.0B
discover 1.9MB 1.9MB -41.0B
embeddableAlertsTable 1.2MB 1.2MB -16.0B
imageEmbeddable 111.9KB 111.8KB -38.0B
infra 1.5MB 1.5MB +2.0B
lens 2.1MB 2.1MB +18.0B
links 102.8KB 102.8KB -37.0B
maps 3.2MB 3.2MB -31.0B
ml 5.6MB 5.6MB -86.0B
slo 1.2MB 1.2MB -154.0B
synthetics 1.1MB 1.1MB -108.0B
visualizations 335.1KB 335.1KB -10.0B
total -1.3KB

Page load bundle

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

id before after diff
aiops 13.9KB 13.9KB +6.0B
apm 48.3KB 48.3KB -3.0B
discover 28.7KB 28.7KB -2.0B
lens 88.2KB 88.2KB +20.0B
total +21.0B

History

@nreese nreese marked this pull request as ready for review May 21, 2026 18:13
@nreese nreese requested review from a team as code owners May 21, 2026 18:13
@nreese nreese added Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// release_note:skip Skip the PR/issue when compiling release notes labels May 21, 2026
@nreese nreese added backport:skip This PR does not require backporting v9.5.0 labels May 21, 2026
@infra-vault-gh-plugin-prod
Copy link
Copy Markdown

Pinging @elastic/kibana-presentation (Team:Presentation)

@peteharverson peteharverson requested a review from rbrtj May 22, 2026 08:45
@botelastic botelastic Bot added the Team:obs-presentation Focus: APM UI, Infra UI, Hosts UI, Universal Profiling, Obs Overview and left Navigation label May 22, 2026
@infra-vault-gh-plugin-prod
Copy link
Copy Markdown

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

Copy link
Copy Markdown
Contributor

@shahzad31 shahzad31 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 !!

Copy link
Copy Markdown
Contributor

@ThomThomson ThomThomson left a comment

Choose a reason for hiding this comment

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

Renaming & differences from original PR LGTM!

Probably should have someone else from presentation team review, as I may have too much context here.

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 release_note:skip Skip the PR/issue when compiling release notes Team:obs-presentation Focus: APM UI, Infra UI, Hosts UI, Universal Profiling, Obs Overview and left Navigation Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// v9.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants