Skip to content

Fix broken formatting in dashboard controls step 2#5664

Open
florent-leborgne wants to merge 10 commits intomainfrom
fix/controls-applies-switch
Open

Fix broken formatting in dashboard controls step 2#5664
florent-leborgne wants to merge 10 commits intomainfrom
fix/controls-applies-switch

Conversation

@florent-leborgne
Copy link
Copy Markdown
Member

@florent-leborgne florent-leborgne commented Mar 27, 2026

Summary

Comprehensive fix for the dashboard controls documentation page (add-controls.md), addressing formatting issues introduced by #5154 (which closed #4676) and verifying all settings against the Kibana source code for both 9.4/serverless and 9.0-9.3.

Formatting fixes

  • Intro: Replace standalone inline {applies_to} badges (pinned/unpinned concept) with a :::{note} using :applies_to: option
  • Step 2: Convert inline {applies_to} to applies-switch for version-specific "Add a control" paths
  • Step 6 settings: Add missing search techniques (Prefix/Contains/Exact) to the 9.4 Options list tab — verified in options_list_editor_options.tsx
  • Step 8 (control ordering): Convert inline {applies_to} to applies-switch for chaining behavior
  • Time slider step 2: Convert inline {applies_to} to applies-switch; use :applies_to: on warning callout
  • Edit controls: Add applies-switch — 9.4 uses panel menu, 9.0-9.3 uses hover pencil icon
  • Delete controls: Convert inline {applies_to} to applies-switch
  • Variable controls: Merge two inline badges into single badge; scope "ES|QL controls" rename note to 9.0-9.1

Version scoping fixes

  • Add serverless: ga alongside stack: ga 9.4 on all applies-items
  • Replace non-standard 9.0-9.3+ syntax with 9.0-9.3 (the + on closed ranges is undocumented)
  • Remove stale serverless: badges from 9.0-9.3 tabs
  • Wrap multi-condition applies-item arguments and :applies_to: options in { } braces (required by YAML parser)

Content fixes

  • Fix step numbering (was jumping from 6 to 8)
  • Fix "Pin to top" → "Pin to Dashboard" (matches pin_control_action.tsx)
  • Fix "Save and close" → "Save" (matches data_control_constants.tsx in both 9.3 and 9.4)
  • Fix capitalization: "Control" → "control" in step 3
  • Add "Clear control" tip (eraser icon action, exists in all versions)
  • Add chaining behavior to "Configure controls settings" 9.4 tab
  • Add cross-reference from "Configure settings" to control creation flow
  • Remove duplicated filter scope text from variable controls section

Verification

  • All 9.4/serverless settings verified against current Kibana main
  • All 9.0-9.3 settings verified against Kibana v9.3.2 tag
  • All section anchors preserved

Test plan

  • Verify CI build passes
  • Preview the page and check:
    • Version tabs render correctly in all applies-switch blocks
    • No disconnected inline badges
    • 9.4/serverless tab shows correct settings
    • 9.0-9.3 tab shows correct settings
    • All anchors work

Relates to #4676, #5154

🤖 Generated with Claude Code

Replace inline {applies_to} directives with applies-switch/applies-item
blocks so version-specific instructions render as proper switchable tabs
instead of stacked badges with disconnected content.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@florent-leborgne florent-leborgne requested review from a team as code owners March 27, 2026 17:05
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 27, 2026

🔍 Preview links for changed docs

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 27, 2026

Vale Linting Results

Summary: 1 suggestion found

💡 Suggestions (1)
File Line Rule Message
explore-analyze/dashboards/add-controls.md 153 Elastic.Semicolons Use semicolons judiciously.

The Vale linter checks documentation changes against the Elastic Docs style guide.

To use Vale locally or report issues, refer to Elastic style guide for Vale.

florent-leborgne and others added 6 commits March 27, 2026 18:16
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Intro: convert standalone inline applies_to badges to note with
  :applies_to: option for pinned/unpinned concept
- Step 6: add missing search techniques (Prefix/Contains/Exact) to
  9.4 Options list tab (verified against codebase)
- Step 6: fix non-standard 9.0-9.3+ syntax to 9.0-9.3
- Steps: renumber 8-10 to 7-9 (step 7 was merged into step 6)
- Step 8: convert inline applies_to to applies-switch for chaining
- Time slider: convert step 2 to applies-switch; use :applies_to:
  option on warning callout
- Configure settings: clarify 9.4 tab with link to creation flow;
  fix 9.0-9.3+ syntax; remove stale serverless badge
- Variable controls: merge two inline badges into single badge on
  same line as paragraph text
- Fix "Pin to top" label to match codebase: "Pin to Dashboard"

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Edit controls: applies-switch for 9.4 (panel menu) vs 9.0-9.3
  (hover pencil icon), fix "Save and close" to "Save" (matches code)
- Fix inconsistent capitalization: "Control" → "control" in step 3
- Scope "ES|QL controls" version note to 9.0-9.1 with applies_to
- Remove duplicated filter scope paragraph from variable controls
  section (already covered in intro note)
- Add "Clear control" tip with eraser icon (exists in all versions)
- Add chaining behavior to "Configure controls" 9.4 tab so users
  who jump to this section via TOC understand controls are always
  chained

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Wrap comma-separated applies_to values in curly braces to prevent
the YAML parser from interpreting colons as mapping indicators.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Multiple conditions in applies-item arguments and inline applies_to
roles must use object notation with curly braces to prevent the YAML
parser from treating the second colon as an invalid mapping.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
florent-leborgne and others added 3 commits March 27, 2026 19:52
- Intro: make pinned/unpinned a core concept in the main paragraph
  (not a version-scoped note), with a note for 9.0-9.3 clarifying
  controls were always pinned to the header
- Variable controls: convert inline applies_to badge for ES|QL
  rename to a proper note callout scoped to 9.0-9.1

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@benironside benironside left a comment

Choose a reason for hiding this comment

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

Looks good! Left a few questions and suggestions. Hope they're helpful

* {applies_to}`stack: ga 9.4` **Unpinned** control: Lives in the dashboard body; when a control is inside a [collapsible section](arrange-panels.md#collapsible-sections), its filters apply only to panels within that section. Controls outside sections (or pinned) have global scope. Refer to [Organize dashboard panels](arrange-panels.md#collapsible-sections) for how section placement affects filter scope.
:::{note}
:applies_to: stack: ga 9.0-9.3
Up until version 9.3, controls are always pinned to the dashboard header and some settings such as chaining and validation apply to all controls at once. Refer to [Configure the controls settings](#configure-controls-settings) to manage these shared settings.
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.

Suggested change
Up until version 9.3, controls are always pinned to the dashboard header and some settings such as chaining and validation apply to all controls at once. Refer to [Configure the controls settings](#configure-controls-settings) to manage these shared settings.
Controls are always pinned to the dashboard header and some settings such as chaining and validation apply to all controls at once. Refer to [Configure the controls settings](#configure-controls-settings) to manage these shared settings.

Maybe redundant? I'm curious for your perspective though. When do you think it's helpful to reiterate what applies-to labels say?

In **Edit** mode, select **Add** > **Controls** > **Control** in the toolbar.
:::
:::{applies-item} stack: ga 9.0-9.1
In **Edit** mode, select **Controls** > **Add control** in the dashboard toolbar.
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.

Suggested change
In **Edit** mode, select **Controls** > **Add control** in the dashboard toolbar.
In **Edit** mode, select **Controls** > **Add control** in the toolbar.

Suggesting to remove this to match line 63

When you add a variable control from an {{esql}} panel, for example, by choosing **Create control** from the autocomplete menu, you can place it **beside** the panel so the control appears directly next to the visualization that uses it. This enables controls that only apply to specific panels in your dashboards, and exposes visualization configuration such as date histogram interval controls to dashboard users.

A control's filter scope depends on where you place it: controls inside a [collapsible section](arrange-panels.md#collapsible-sections) apply only to panels in that section, while controls outside sections or pinned to the dashboard apply to all panels.
{applies_to}`{ serverless: ga, stack: ga 9.4 }` When you add a variable control from an {{esql}} panel, for example, by choosing **Create control** from the autocomplete menu, you can place it **beside** the panel so the control appears directly next to the visualization that uses it. This enables controls that only apply to specific panels in your dashboards, and exposes visualization configuration such as date histogram interval controls to dashboard users.
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.

Something about the last sentence here isn't parsing easily for me. Maybe for one thing what "enables" means here is confusing. Is this saying that when you put a control beside the panel, that control only applies to specific panels in my dashboards?

* {applies_to}`serverless:` {applies_to}`stack: ga 9.2+` In **Edit** mode, select **Add** > **Controls** > **Time slider control** in the toolbar.
* {applies_to}`stack: ga 9.0-9.1` In **Edit** mode, select **Controls** > **Add time slider control**.
::::{applies-switch}
:::{applies-item} { serverless: ga, stack: ga 9.2 }
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.

Should this be 9.2+?


1. Configure the control settings.

* {applies_to}`serverless:` {applies_to}`stack: ga 9.2+` In **Edit** mode, select **Add** > **Controls** > **Settings** in the toolbar.
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.

These three lines each have an applies to, but none of them seem to have either a + or a 9.4, which seems to suggest that the future behavior isn't described here, is that right?

Change the settings for Options list and Range slider controls.

::::{applies-switch}
:::{applies-item} { serverless: ga, stack: ga 9.4 }
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.

should it be 9.4+ instead of 9.4?


::::{applies-switch}
:::{applies-item} stack: ga 9.4
:::{applies-item} { serverless: ga, stack: ga 9.4 }
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.

9.4 +?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Dashboards]: Controls as panels

2 participants