Skip to content

[Controls] Clear indicate related panel state when entering/exiting edit mode or flyout#273760

Merged
Zacqary merged 7 commits into
elastic:mainfrom
Zacqary:related-panel-highlight-edit-fix
Jun 17, 2026
Merged

[Controls] Clear indicate related panel state when entering/exiting edit mode or flyout#273760
Zacqary merged 7 commits into
elastic:mainfrom
Zacqary:related-panel-highlight-edit-fix

Conversation

@Zacqary

@Zacqary Zacqary commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Quick UX fix followup to #264426. User reported confusion when:

  1. Editing a panel
  2. Clicking an ES|QL control to indicate related panels
  3. Closing the edit window and seeing all the related panels remain highlighted

This is because the relatedPanelsIndicatorId is set independently of opening or closing an edit flyout. This PR makes sure to clear the indicator ID when entering or leaving an edit flyout.

@Zacqary Zacqary requested a review from a team as a code owner June 17, 2026 15:08
@Zacqary Zacqary added Feature:Dashboard Dashboard related features Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// loe:small Small Level of Effort release_note:skip Skip the PR/issue when compiling release notes impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. backport:version Backport to applied version labels v9.5.0 labels Jun 17, 2026
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

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

@Zacqary Zacqary changed the title [Controls] Clear indicate related panel state when entering/exiting an edit flyout [Controls] Clear indicate related panel state when entering/exiting edit mode or flyout Jun 17, 2026
@Zacqary Zacqary requested a review from Heenawter June 17, 2026 19:27
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 9a5b1d73-c87f-425f-bfbb-ff5a5600ecad

📥 Commits

Reviewing files that changed from the base of the PR and between 8e85b96 and f45cf6f.

📒 Files selected for processing (4)
  • src/platform/plugins/shared/dashboard/public/dashboard_api/get_dashboard_api.ts
  • src/platform/plugins/shared/dashboard/public/dashboard_api/track_overlay.ts
  • src/platform/plugins/shared/dashboard/public/dashboard_api/track_panel.test.ts
  • src/platform/plugins/shared/dashboard/public/dashboard_api/track_panel.ts

📝 Walkthrough

Walkthrough

initializeTrackPanel gains a viewMode$: BehaviorSubject<ViewMode> parameter; the combineLatest blur computation now returns empty results when viewMode is not 'edit', suppressing panel blur outside edit mode. initializeTrackOverlay's signature changes from a single setFocusedPanelId callback to a destructured object that also includes setRelatedPanelsIndicatorId; both clearOverlays (overlay close) and the overlay-open path now call setRelatedPanelsIndicatorId(undefined) to prevent related-panel indicator state from persisting. getDashboardApi wiring is updated to forward viewModeManager.api.viewMode$ to initializeTrackPanel and pass the full trackPanel.api object to initializeTrackOverlay.

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • 🛠️ Update Documentation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Heenawter Heenawter left a comment

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.

Code review + tested locally. Left a few nits, but overall the fix is straightforward

Comment on lines +25 to +28
// Clear related panels indicator ID when closing overlays as well. If the user is editing a panel
// and selects a control to indicate its related panels, then exits edit mode, they're probably thinking of
// the indication state to be part of the edit operation and expect it to clear
setRelatedPanelsIndicatorId(undefined);

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.

nit I think this comment is good enough but 🤷

Suggested change
// Clear related panels indicator ID when closing overlays as well. If the user is editing a panel
// and selects a control to indicate its related panels, then exits edit mode, they're probably thinking of
// the indication state to be part of the edit operation and expect it to clear
setRelatedPanelsIndicatorId(undefined);
// Clear related panels indicator ID when closing overlays as well

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.

Maybe worth adding a unit test for the view mode case?

@Zacqary Zacqary enabled auto-merge (squash) June 17, 2026 20:53
@kibanamachine

Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #2 / AssetDocumentTab should select json tab when clicked
  • [job] [logs] FTR Configs #133 / integrations For each artifact list under management When on the Event Filters entries list should be able to update an existing Event Filters entry
  • [job] [logs] Scout Lane #5 - stateful-classic / default / local-stateful-classic - APM integration not installed but setup completed - Admin user
  • [job] [logs] Scout Lane #6 - stateful-classic / default / local-stateful-classic - Bulk add alerts to chat - should disable the "Add to chat" bulk action when all alerts are selected via the query button
  • [job] [logs] Scout Lane #6 - stateful-classic / default / local-stateful-classic - Bulk add alerts to chat - should open agent builder conversation with attachment chip and pre-filled prompt, and send multiple alerts to the LLM
  • [job] [logs] Scout Lane #5 - stateful-classic / default / local-stateful-classic - Collector integration is not installed - collector integration missing
  • [job] [logs] Scout Lane #5 - stateful-classic / default / local-stateful-classic - Profiling is setup and data is loaded - Admin user
  • [job] [logs] Scout Lane #1 - stateful-classic / default / local-stateful-classic - Stream data routing - previewing data - should show preview during rule creation

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
dashboard 1.1MB 1.1MB +88.0B

History

@Zacqary Zacqary merged commit f6c49cb into elastic:main Jun 17, 2026
30 checks passed
@kibanamachine kibanamachine added backport:skip This PR does not require backporting and removed backport:version Backport to applied version labels labels Jun 17, 2026
flash1293 pushed a commit to flash1293/kibana that referenced this pull request Jun 23, 2026
…dit mode or flyout (elastic#273760)

## Summary

Quick UX fix followup to elastic#264426.
User reported confusion when:

1. Editing a panel
2. Clicking an ES|QL control to indicate related panels
3. Closing the edit window and seeing all the related panels remain
highlighted

This is because the `relatedPanelsIndicatorId` is set independently of
opening or closing an edit flyout. This PR makes sure to clear the
indicator ID when entering or leaving an edit flyout.
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:Dashboard Dashboard related features impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort release_note:skip Skip the PR/issue when compiling release notes 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.

3 participants