Skip to content

[Embeddable Rebuild] Fix Lens Embeddable defaultTitle from being overwritten by custom title after reload#225664

Merged
olapawlus merged 9 commits intoelastic:mainfrom
olapawlus:lensEmbeddableDefaultTitle
Jul 2, 2025
Merged

[Embeddable Rebuild] Fix Lens Embeddable defaultTitle from being overwritten by custom title after reload#225664
olapawlus merged 9 commits intoelastic:mainfrom
olapawlus:lensEmbeddableDefaultTitle

Conversation

@olapawlus
Copy link
Member

@olapawlus olapawlus commented Jun 27, 2025

Bug description (also the bug video below):
Fixes a bug where the defaultTitle value in the Lens embeddable was incorrectly overwritten after a dashboard reload.

🐞 Steps to reproduce the issue
Add a Lens panel to a dashboard.
Save the dashboard.
Set a custom title for the panel (e.g. “My Custom Title”).
Reload the page.
Try to reset the title to default via the panel’s UI (e.g. “Reset to default” action in the panel menu).
❌ Actual behavior
The “Reset to default” option is disabled (greyed out) — the app thinks there’s no difference between the current and default title.

From a developer perspective:
Inspecting the Lens embeddable api object reveals that:

The original defaultTitle field was overwritten by the title field during reload — both fields now hold the same value.
✅ Expected behavior:
Now the default title stays correct after reloading a panel, and is no longer overwritten by the custom title.

Before fix:

Screen.Recording.2025-06-30.at.15.32.28.mov

After fixing:

Screen.Recording.2025-06-30.at.15.21.43.mov

Closes: #225660

@olapawlus olapawlus self-assigned this Jun 27, 2025
@olapawlus olapawlus requested a review from a team as a code owner June 27, 2025 14:55
@olapawlus olapawlus added bug Fixes for quality problems that affect the customer experience regression release_note:fix Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// loe:medium Medium Level of Effort Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. project:embeddableRebuild backport:version Backport to applied version labels v9.1.0 v8.19.0 labels Jun 27, 2025
@elasticmachine
Copy link
Contributor

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

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-visualizations (Team:Visualizations)

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

Changes LGTM! Ran this locally to make sure it all worked, and looked through the code. Nice fix!

Copy link
Contributor

@markov00 markov00 left a comment

Choose a reason for hiding this comment

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

This approach just overrides the defaultTitle$ that is already exposed by the dashboardConfig.api.
Is better to evaluate and verify why the current defaultTitle$ doesn't work as expected:

const defaultTitle$ = new BehaviorSubject<string | undefined>(
initialState.title || internalApi.attributes$.getValue().title
);

@olapawlus olapawlus force-pushed the lensEmbeddableDefaultTitle branch from 500ae0b to c3eca1c Compare June 30, 2025 10:24
@olapawlus
Copy link
Member Author

This approach just overrides the defaultTitle$ that is already exposed by the dashboardConfig.api. Is better to evaluate and verify why the current defaultTitle$ doesn't work as expected:

const defaultTitle$ = new BehaviorSubject<string | undefined>(
initialState.title || internalApi.attributes$.getValue().title
);

@markov00 Could you please take a look at the latest changes? I tested locally and the defaultTitle works fine.

@olapawlus olapawlus force-pushed the lensEmbeddableDefaultTitle branch from dbc6286 to cfbc801 Compare June 30, 2025 13:13
olapawlus and others added 2 commits July 1, 2025 12:18
…itializers/initialize_dashboard_services.ts

Co-authored-by: Nick Peihl <nickpeihl@gmail.com>
@olapawlus olapawlus enabled auto-merge (squash) July 1, 2025 12:03
@olapawlus olapawlus changed the title [Embeddable Rebuild] Fix defaultTitle from being overwritten by custom title after reload Jul 1, 2025
Copy link
Contributor

@nickpeihl nickpeihl left a comment

Choose a reason for hiding this comment

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

lgtm! I discussed these latest changes offline with @olapawlus and we confirmed that this fixes the bug.

const defaultTitle$ = new BehaviorSubject<string | undefined>(
initialState.title || internalApi.attributes$.getValue().title
);
const defaultTitle$ = new BehaviorSubject<string | undefined>(initialState.attributes.title);
Copy link
Contributor

Choose a reason for hiding this comment

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

This is great! The defaultTitle should only ever come from a by-reference Lens embeddable and those properties are formed on the initialState.attributes object. The internalApi.attributes are based on LensRuntimeState which is state stored on a dashboard and those properties should not be used to set the defaultTitle.

@olapawlus olapawlus requested a review from markov00 July 1, 2025 15:34
@elasticmachine
Copy link
Contributor

💚 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
lens 1.5MB 1.5MB -21.0B

History

cc @olapawlus

Copy link
Contributor

@markov00 markov00 left a comment

Choose a reason for hiding this comment

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

Changes looks good to me, tested locally.
Probably the only think is not super clear is the fact that the "default" title will always remain the same if you unlink from the library a by-reference visualization and can't be changed.
The unlink action adds the the "by reference" title in the SO and this is then always considered the default "forever".
Anyway I believe this is a different topic and we probably need to create an issue for that

@olapawlus olapawlus merged commit 3128f80 into elastic:main Jul 2, 2025
11 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19, 9.1

https://github.com/elastic/kibana/actions/runs/16026730554

@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19, 9.1

https://github.com/elastic/kibana/actions/runs/16026739368

kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Jul 2, 2025
…m title after reload (elastic#225664)

Bug description (also the bug video below):
Fixes a bug where the defaultTitle value in the Lens embeddable was
incorrectly overwritten after a dashboard reload.

🐞 Steps to reproduce the issue
Add a Lens panel to a dashboard.
Save the dashboard.
Set a custom title for the panel (e.g. “My Custom Title”).
Reload the page.
Try to reset the title to default via the panel’s UI (e.g. “Reset to
default” action in the panel menu).
❌ Actual behavior
The “Reset to default” option is disabled (greyed out) — the app thinks
there’s no difference between the current and default title.

From a developer perspective:
Inspecting the Lens embeddable api object reveals that:

The original defaultTitle field was overwritten by the title field
during reload — both fields now hold the same value.
✅ Expected behavior:
Now the default title stays correct after reloading a panel, and is no
longer overwritten by the custom title.

Before fix:

https://github.com/user-attachments/assets/5ab337de-799e-45e9-afea-168f29419364

After fixing:

https://github.com/user-attachments/assets/c4f1d893-fc71-424f-aa63-a3b904a37908

Closes: elastic#225660

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Nick Peihl <nickpeihl@gmail.com>
(cherry picked from commit 3128f80)
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Jul 2, 2025
…m title after reload (elastic#225664)

Bug description (also the bug video below):
Fixes a bug where the defaultTitle value in the Lens embeddable was
incorrectly overwritten after a dashboard reload.

🐞 Steps to reproduce the issue
Add a Lens panel to a dashboard.
Save the dashboard.
Set a custom title for the panel (e.g. “My Custom Title”).
Reload the page.
Try to reset the title to default via the panel’s UI (e.g. “Reset to
default” action in the panel menu).
❌ Actual behavior
The “Reset to default” option is disabled (greyed out) — the app thinks
there’s no difference between the current and default title.

From a developer perspective:
Inspecting the Lens embeddable api object reveals that:

The original defaultTitle field was overwritten by the title field
during reload — both fields now hold the same value.
✅ Expected behavior:
Now the default title stays correct after reloading a panel, and is no
longer overwritten by the custom title.

Before fix:

https://github.com/user-attachments/assets/5ab337de-799e-45e9-afea-168f29419364

After fixing:

https://github.com/user-attachments/assets/c4f1d893-fc71-424f-aa63-a3b904a37908

Closes: elastic#225660

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Nick Peihl <nickpeihl@gmail.com>
(cherry picked from commit 3128f80)
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Jul 2, 2025
…m title after reload (elastic#225664)

Bug description (also the bug video below):
Fixes a bug where the defaultTitle value in the Lens embeddable was
incorrectly overwritten after a dashboard reload.

🐞 Steps to reproduce the issue
Add a Lens panel to a dashboard.
Save the dashboard.
Set a custom title for the panel (e.g. “My Custom Title”).
Reload the page.
Try to reset the title to default via the panel’s UI (e.g. “Reset to
default” action in the panel menu).
❌ Actual behavior
The “Reset to default” option is disabled (greyed out) — the app thinks
there’s no difference between the current and default title.

From a developer perspective:
Inspecting the Lens embeddable api object reveals that:

The original defaultTitle field was overwritten by the title field
during reload — both fields now hold the same value.
✅ Expected behavior:
Now the default title stays correct after reloading a panel, and is no
longer overwritten by the custom title.

Before fix:

https://github.com/user-attachments/assets/5ab337de-799e-45e9-afea-168f29419364

After fixing:

https://github.com/user-attachments/assets/c4f1d893-fc71-424f-aa63-a3b904a37908

Closes: elastic#225660

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Nick Peihl <nickpeihl@gmail.com>
(cherry picked from commit 3128f80)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.19
9.1

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

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Jul 2, 2025
…m title after reload (elastic#225664)

Bug description (also the bug video below):
Fixes a bug where the defaultTitle value in the Lens embeddable was
incorrectly overwritten after a dashboard reload.

🐞 Steps to reproduce the issue
Add a Lens panel to a dashboard.
Save the dashboard.
Set a custom title for the panel (e.g. “My Custom Title”).
Reload the page.
Try to reset the title to default via the panel’s UI (e.g. “Reset to
default” action in the panel menu).
❌ Actual behavior
The “Reset to default” option is disabled (greyed out) — the app thinks
there’s no difference between the current and default title.

From a developer perspective:
Inspecting the Lens embeddable api object reveals that:

The original defaultTitle field was overwritten by the title field
during reload — both fields now hold the same value.
✅ Expected behavior:
Now the default title stays correct after reloading a panel, and is no
longer overwritten by the custom title.

Before fix:

https://github.com/user-attachments/assets/5ab337de-799e-45e9-afea-168f29419364

After fixing:

https://github.com/user-attachments/assets/c4f1d893-fc71-424f-aa63-a3b904a37908

Closes: elastic#225660

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Nick Peihl <nickpeihl@gmail.com>
(cherry picked from commit 3128f80)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.19
9.1

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 Jul 2, 2025
… custom title after reload (#225664) (#226216)

# Backport

This will backport the following commits from `main` to `9.1`:
- [[Embeddable Rebuild] Fix defaultTitle from being overwritten by
custom title after reload
(#225664)](#225664)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Ola
Pawlus","email":"98127445+olapawlus@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-07-02T13:38:51Z","message":"[Embeddable
Rebuild] Fix defaultTitle from being overwritten by custom title after
reload (#225664)\n\nBug description (also the bug video below):\nFixes a
bug where the defaultTitle value in the Lens embeddable was\nincorrectly
overwritten after a dashboard reload.\n\n🐞 Steps to reproduce the
issue\nAdd a Lens panel to a dashboard.\nSave the dashboard.\nSet a
custom title for the panel (e.g. “My Custom Title”).\nReload the
page.\nTry to reset the title to default via the panel’s UI (e.g. “Reset
to\ndefault” action in the panel menu).\n❌ Actual behavior\nThe “Reset
to default” option is disabled (greyed out) — the app thinks\nthere’s no
difference between the current and default title.\n\nFrom a developer
perspective:\nInspecting the Lens embeddable api object reveals
that:\n\nThe original defaultTitle field was overwritten by the title
field\nduring reload — both fields now hold the same value.\n✅ Expected
behavior:\nNow the default title stays correct after reloading a panel,
and is no\nlonger overwritten by the custom title.\n\nBefore
fix:\n\n\nhttps://github.com/user-attachments/assets/5ab337de-799e-45e9-afea-168f29419364\n\n\nAfter
fixing:\n\n\nhttps://github.com/user-attachments/assets/c4f1d893-fc71-424f-aa63-a3b904a37908\n\n\nCloses:
#225660\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Nick
Peihl
<nickpeihl@gmail.com>","sha":"3128f80147d75a624b193d5e64ca6c0a83246f82","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","regression","release_note:fix","Team:Presentation","loe:medium","Team:Visualizations","impact:medium","project:embeddableRebuild","backport:version","v9.1.0","v8.19.0","v9.2.0"],"title":"[Embeddable
Rebuild] Fix Lens Embeddable defaultTitle from being overwritten by
custom title after
reload","number":225664,"url":"https://github.com/elastic/kibana/pull/225664","mergeCommit":{"message":"[Embeddable
Rebuild] Fix defaultTitle from being overwritten by custom title after
reload (#225664)\n\nBug description (also the bug video below):\nFixes a
bug where the defaultTitle value in the Lens embeddable was\nincorrectly
overwritten after a dashboard reload.\n\n🐞 Steps to reproduce the
issue\nAdd a Lens panel to a dashboard.\nSave the dashboard.\nSet a
custom title for the panel (e.g. “My Custom Title”).\nReload the
page.\nTry to reset the title to default via the panel’s UI (e.g. “Reset
to\ndefault” action in the panel menu).\n❌ Actual behavior\nThe “Reset
to default” option is disabled (greyed out) — the app thinks\nthere’s no
difference between the current and default title.\n\nFrom a developer
perspective:\nInspecting the Lens embeddable api object reveals
that:\n\nThe original defaultTitle field was overwritten by the title
field\nduring reload — both fields now hold the same value.\n✅ Expected
behavior:\nNow the default title stays correct after reloading a panel,
and is no\nlonger overwritten by the custom title.\n\nBefore
fix:\n\n\nhttps://github.com/user-attachments/assets/5ab337de-799e-45e9-afea-168f29419364\n\n\nAfter
fixing:\n\n\nhttps://github.com/user-attachments/assets/c4f1d893-fc71-424f-aa63-a3b904a37908\n\n\nCloses:
#225660\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Nick
Peihl
<nickpeihl@gmail.com>","sha":"3128f80147d75a624b193d5e64ca6c0a83246f82"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/225664","number":225664,"mergeCommit":{"message":"[Embeddable
Rebuild] Fix defaultTitle from being overwritten by custom title after
reload (#225664)\n\nBug description (also the bug video below):\nFixes a
bug where the defaultTitle value in the Lens embeddable was\nincorrectly
overwritten after a dashboard reload.\n\n🐞 Steps to reproduce the
issue\nAdd a Lens panel to a dashboard.\nSave the dashboard.\nSet a
custom title for the panel (e.g. “My Custom Title”).\nReload the
page.\nTry to reset the title to default via the panel’s UI (e.g. “Reset
to\ndefault” action in the panel menu).\n❌ Actual behavior\nThe “Reset
to default” option is disabled (greyed out) — the app thinks\nthere’s no
difference between the current and default title.\n\nFrom a developer
perspective:\nInspecting the Lens embeddable api object reveals
that:\n\nThe original defaultTitle field was overwritten by the title
field\nduring reload — both fields now hold the same value.\n✅ Expected
behavior:\nNow the default title stays correct after reloading a panel,
and is no\nlonger overwritten by the custom title.\n\nBefore
fix:\n\n\nhttps://github.com/user-attachments/assets/5ab337de-799e-45e9-afea-168f29419364\n\n\nAfter
fixing:\n\n\nhttps://github.com/user-attachments/assets/c4f1d893-fc71-424f-aa63-a3b904a37908\n\n\nCloses:
#225660\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Nick
Peihl
<nickpeihl@gmail.com>","sha":"3128f80147d75a624b193d5e64ca6c0a83246f82"}}]}]
BACKPORT-->

Co-authored-by: Ola Pawlus <98127445+olapawlus@users.noreply.github.com>
Co-authored-by: Nick Peihl <nickpeihl@gmail.com>
kibanamachine added a commit that referenced this pull request Jul 2, 2025
…y custom title after reload (#225664) (#226215)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Embeddable Rebuild] Fix defaultTitle from being overwritten by
custom title after reload
(#225664)](#225664)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Ola
Pawlus","email":"98127445+olapawlus@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-07-02T13:38:51Z","message":"[Embeddable
Rebuild] Fix defaultTitle from being overwritten by custom title after
reload (#225664)\n\nBug description (also the bug video below):\nFixes a
bug where the defaultTitle value in the Lens embeddable was\nincorrectly
overwritten after a dashboard reload.\n\n🐞 Steps to reproduce the
issue\nAdd a Lens panel to a dashboard.\nSave the dashboard.\nSet a
custom title for the panel (e.g. “My Custom Title”).\nReload the
page.\nTry to reset the title to default via the panel’s UI (e.g. “Reset
to\ndefault” action in the panel menu).\n❌ Actual behavior\nThe “Reset
to default” option is disabled (greyed out) — the app thinks\nthere’s no
difference between the current and default title.\n\nFrom a developer
perspective:\nInspecting the Lens embeddable api object reveals
that:\n\nThe original defaultTitle field was overwritten by the title
field\nduring reload — both fields now hold the same value.\n✅ Expected
behavior:\nNow the default title stays correct after reloading a panel,
and is no\nlonger overwritten by the custom title.\n\nBefore
fix:\n\n\nhttps://github.com/user-attachments/assets/5ab337de-799e-45e9-afea-168f29419364\n\n\nAfter
fixing:\n\n\nhttps://github.com/user-attachments/assets/c4f1d893-fc71-424f-aa63-a3b904a37908\n\n\nCloses:
#225660\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Nick
Peihl
<nickpeihl@gmail.com>","sha":"3128f80147d75a624b193d5e64ca6c0a83246f82","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","regression","release_note:fix","Team:Presentation","loe:medium","Team:Visualizations","impact:medium","project:embeddableRebuild","backport:version","v9.1.0","v8.19.0","v9.2.0"],"title":"[Embeddable
Rebuild] Fix Lens Embeddable defaultTitle from being overwritten by
custom title after
reload","number":225664,"url":"https://github.com/elastic/kibana/pull/225664","mergeCommit":{"message":"[Embeddable
Rebuild] Fix defaultTitle from being overwritten by custom title after
reload (#225664)\n\nBug description (also the bug video below):\nFixes a
bug where the defaultTitle value in the Lens embeddable was\nincorrectly
overwritten after a dashboard reload.\n\n🐞 Steps to reproduce the
issue\nAdd a Lens panel to a dashboard.\nSave the dashboard.\nSet a
custom title for the panel (e.g. “My Custom Title”).\nReload the
page.\nTry to reset the title to default via the panel’s UI (e.g. “Reset
to\ndefault” action in the panel menu).\n❌ Actual behavior\nThe “Reset
to default” option is disabled (greyed out) — the app thinks\nthere’s no
difference between the current and default title.\n\nFrom a developer
perspective:\nInspecting the Lens embeddable api object reveals
that:\n\nThe original defaultTitle field was overwritten by the title
field\nduring reload — both fields now hold the same value.\n✅ Expected
behavior:\nNow the default title stays correct after reloading a panel,
and is no\nlonger overwritten by the custom title.\n\nBefore
fix:\n\n\nhttps://github.com/user-attachments/assets/5ab337de-799e-45e9-afea-168f29419364\n\n\nAfter
fixing:\n\n\nhttps://github.com/user-attachments/assets/c4f1d893-fc71-424f-aa63-a3b904a37908\n\n\nCloses:
#225660\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Nick
Peihl
<nickpeihl@gmail.com>","sha":"3128f80147d75a624b193d5e64ca6c0a83246f82"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/225664","number":225664,"mergeCommit":{"message":"[Embeddable
Rebuild] Fix defaultTitle from being overwritten by custom title after
reload (#225664)\n\nBug description (also the bug video below):\nFixes a
bug where the defaultTitle value in the Lens embeddable was\nincorrectly
overwritten after a dashboard reload.\n\n🐞 Steps to reproduce the
issue\nAdd a Lens panel to a dashboard.\nSave the dashboard.\nSet a
custom title for the panel (e.g. “My Custom Title”).\nReload the
page.\nTry to reset the title to default via the panel’s UI (e.g. “Reset
to\ndefault” action in the panel menu).\n❌ Actual behavior\nThe “Reset
to default” option is disabled (greyed out) — the app thinks\nthere’s no
difference between the current and default title.\n\nFrom a developer
perspective:\nInspecting the Lens embeddable api object reveals
that:\n\nThe original defaultTitle field was overwritten by the title
field\nduring reload — both fields now hold the same value.\n✅ Expected
behavior:\nNow the default title stays correct after reloading a panel,
and is no\nlonger overwritten by the custom title.\n\nBefore
fix:\n\n\nhttps://github.com/user-attachments/assets/5ab337de-799e-45e9-afea-168f29419364\n\n\nAfter
fixing:\n\n\nhttps://github.com/user-attachments/assets/c4f1d893-fc71-424f-aa63-a3b904a37908\n\n\nCloses:
#225660\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Nick
Peihl
<nickpeihl@gmail.com>","sha":"3128f80147d75a624b193d5e64ca6c0a83246f82"}}]}]
BACKPORT-->

Co-authored-by: Ola Pawlus <98127445+olapawlus@users.noreply.github.com>
Co-authored-by: Nick Peihl <nickpeihl@gmail.com>
kertal pushed a commit to kertal/kibana that referenced this pull request Jul 25, 2025
…m title after reload (elastic#225664)

Bug description (also the bug video below):
Fixes a bug where the defaultTitle value in the Lens embeddable was
incorrectly overwritten after a dashboard reload.

🐞 Steps to reproduce the issue
Add a Lens panel to a dashboard.
Save the dashboard.
Set a custom title for the panel (e.g. “My Custom Title”).
Reload the page.
Try to reset the title to default via the panel’s UI (e.g. “Reset to
default” action in the panel menu).
❌ Actual behavior
The “Reset to default” option is disabled (greyed out) — the app thinks
there’s no difference between the current and default title.

From a developer perspective:
Inspecting the Lens embeddable api object reveals that:

The original defaultTitle field was overwritten by the title field
during reload — both fields now hold the same value.
✅ Expected behavior:
Now the default title stays correct after reloading a panel, and is no
longer overwritten by the custom title.

Before fix:


https://github.com/user-attachments/assets/5ab337de-799e-45e9-afea-168f29419364


After fixing:


https://github.com/user-attachments/assets/c4f1d893-fc71-424f-aa63-a3b904a37908


Closes: elastic#225660

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Nick Peihl <nickpeihl@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels bug Fixes for quality problems that affect the customer experience impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:medium Medium Level of Effort project:embeddableRebuild regression release_note:fix Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// v8.19.0 v9.1.0 v9.2.0

6 participants