Skip to content

[Dashboard] Keep pinned_panels separate in read response#258444

Merged
nickpeihl merged 5 commits intoelastic:mainfrom
nickpeihl:fix-pinned-panels-scope-tooling
Mar 19, 2026
Merged

[Dashboard] Keep pinned_panels separate in read response#258444
nickpeihl merged 5 commits intoelastic:mainfrom
nickpeihl:fix-pinned-panels-scope-tooling

Conversation

@nickpeihl
Copy link
Copy Markdown
Contributor

@nickpeihl nickpeihl commented Mar 18, 2026

Summary

Fixes stripUnmappedKeys so pinned_panels are not merged into the main panels array when serving dashboard REST read responses. pinned_panels are still validated through the same isMappedPanelType logic so unsupported pinned control configs are dropped with warnings.

Before this change, stripUnmappedKeys concatenated pinned_panels into panels, causing pinned controls to show up inside data.panels and effectively dropping the dedicated pinned_panels field. Additionally, since pinned_panels were showing up in the panels array, the server was throwing an unhelpful 500 error due to the invalid schemas (pinned_panels don't have grid schemas) caused by the dashboardSchema.validate call that is injecting defaults.

What changed

  • stripUnmappedKeys now filters/maps panels and pinned_panels independently.
  • Added a Jest regression test covering the bug + fix.

Testing

  1. Start Kibana locally (your usual dev setup).
  2. Create a dashboard and add a pinned control (e.g. a pinned Options List control). Save the dashboard and copy the dashboard id from the URL.
  3. Request the dashboard via API using Kibana's Dev Tools Console
  • GET kbn:/api/dashboards/<DASHBOARD_ID>?apiVersion=1
  1. Verify the response shape:
    • data.pinned_panels contains the pinned control(s).
    • data.panels contains only regular dashboard panels/sections (no pinned control objects).

Any pinned panels without a registered schema should be dropped from pinned_panels with a warning.

@nickpeihl nickpeihl added Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Project:Dashboards API v9.4.0 labels Mar 18, 2026
@nickpeihl nickpeihl marked this pull request as ready for review March 18, 2026 20:27
@nickpeihl nickpeihl requested a review from a team as a code owner March 18, 2026 20:27
@elasticmachine
Copy link
Copy Markdown
Contributor

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

@nickpeihl nickpeihl changed the title [Dashboard] Keep pinned_panels separate in REST read response [Dashboard] Keep pinned_panels separate in read response Mar 18, 2026
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.

Good clean fix and nice snapshot based regression testing. Changes LGTM!

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

@nickpeihl nickpeihl merged commit 57a9d2f into elastic:main Mar 19, 2026
33 checks passed
mbondyra added a commit to mbondyra/kibana that referenced this pull request Mar 19, 2026
…d_agent_navigation2

* commit '9289d6b5502db245e645e190b0246554396c6c20': (34 commits)
  [api-docs] 2026-03-19 Daily api_docs build (elastic#258471)
  [Shared UX][DateRangePicker] Missing parts (elastic#258229)
  [Dashboard] Keep pinned_panels separate in read response (elastic#258444)
  Move inheritance: true to top level in .coderabbit.yml (elastic#258461)
  [DOCS] 9.3.2 Kibana release notes (elastic#257332)
  adds routing accept metric attribute to the cps metric (elastic#258168)
  [ML] AI/Inference Connector creation: use 'location' field to correctly set provider config  (elastic#250838)
  [Lens] Add e2e test for legend list layout (elastic#258160)
  [SigEvents] Convert feature duplication evaluators to createPrompt pattern (elastic#256534)
  Add actionable-obs author to .coderabbit.yml (elastic#257922)
  [DOCS] 9.2.7 Kibana release notes (elastic#257331)
  Grant Serverless editor/viewer access to ES v2 indices (elastic#258384)
  [SigEvents][Evals] Rename terminology for KI features and KI queries (elastic#258361)
  [EDR Workflows][Osquery] Add shared table toolbar components and redesign saved queries list (elastic#258394)
  [Automatic Import V2] Upload samples using an existing index (elastic#258074)
  Add GET /inference_features route to expose feature registry (elastic#258044)
  fix additional fields not included (elastic#257625)
  [Discover] [Metrics] Add tier 2 journeys for Metrics in Discover E2E (elastic#255036)
  [Lens as code] Support correct X-Axis types in ES|QL visualizations (elastic#258159)
  Update APM (main) (elastic#254880)
  ...
flash1293 pushed a commit to flash1293/kibana that referenced this pull request Mar 19, 2026
jeramysoucy pushed a commit to jeramysoucy/kibana that referenced this pull request Mar 26, 2026
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 Project:Dashboards API release_note:skip Skip the PR/issue when compiling release notes Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants