Skip to content

[Lens as code] Styling alignment#262927

Merged
nickofthyme merged 9 commits into
elastic:mainfrom
nickofthyme:styling-fixes
Apr 15, 2026
Merged

[Lens as code] Styling alignment#262927
nickofthyme merged 9 commits into
elastic:mainfrom
nickofthyme:styling-fixes

Conversation

@nickofthyme
Copy link
Copy Markdown
Contributor

@nickofthyme nickofthyme commented Apr 14, 2026

Summary

Aligns all config schemas around using top-level styling prop for global visual styles

Closes #262852

Checklist

  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
  • Review the backport guidelines and apply applicable backport:* labels.

Adds a new `styling` object in the datatable configuration, consolidating density, paging, sorting, and row number visibility settings. The changes include:

- Moved `density`, `paging`, `sort_by`, and `row_numbers` under the `styling` key in the datatable schema.
- Updated related tests and mock configurations to reflect the new structure.
- Refactored API transformation functions to accommodate the new styling schema.
This update introduces a new `styling` object across various chart schemas, including pie, treemap, waffle, and mosaic. The changes include:

- Consolidation of visual configuration options such as labels, values, and donut hole settings under the `styling` key.
- Adjustments to validation tests to reflect the new structure.
- Updates to API transformation functions to accommodate the unified styling schema.

These modifications enhance consistency and maintainability across chart configurations.
This update modifies the gauge chart schema to incorporate a new `styling` object, consolidating visual configuration options such as shape and orientation. Key changes include:

- Transition from a `shape` property to a `styling.shape` property in the gauge schema.
- Updates to validation tests to reflect the new styling structure.
- Adjustments in API transformation functions to accommodate the unified styling schema.

These enhancements improve consistency and maintainability across gauge chart configurations.
@nickofthyme nickofthyme added release_note:skip Skip the PR/issue when compiling release notes backport:version Backport to applied version labels v9.4.0 v9.5.0 labels Apr 14, 2026
This update introduces a new `styling` object in the tag cloud schema, consolidating visual configuration options such as orientation, font size, and caption visibility. Key changes include:

- Transition from individual properties for orientation, font size, and caption to a unified `styling` object.
- Updates to validation tests and mock configurations to reflect the new structure.
- Adjustments in API transformation functions to accommodate the unified styling schema.

These enhancements improve consistency and maintainability across tag cloud configurations.
This update introduces a new `styling` object in the heatmap schema, consolidating visual configuration options for cell labels. Key changes include:

- Addition of `heatmapStylingSchema` to define styling options for cells.
- Updates to API transformation functions to accommodate the new `styling` structure.
- Adjustments in the visualization state building process to reference the new styling configuration.

These enhancements improve consistency and maintainability across heatmap configurations.
@nickofthyme nickofthyme marked this pull request as ready for review April 14, 2026 02:51
@nickofthyme nickofthyme requested a review from a team as a code owner April 14, 2026 02:51
Copy link
Copy Markdown
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 LGTM

@elastic elastic deleted a comment from elasticmachine Apr 15, 2026
@nickofthyme nickofthyme merged commit ddcc639 into elastic:main Apr 15, 2026
17 checks passed
@nickofthyme nickofthyme deleted the styling-fixes branch April 15, 2026 18:40
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 9.4

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

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Apr 15, 2026
## Summary

Aligns all config schemas around using top-level `styling` prop for
global visual styles

Closes elastic#262852

### Checklist

- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

(cherry picked from commit ddcc639)
@kibanamachine
Copy link
Copy Markdown
Contributor

💚 All backports created successfully

Status Branch Result
9.4

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 Apr 15, 2026
# Backport

This will backport the following commits from `main` to `9.4`:
- [[Lens as code] Styling alignment
(#262927)](#262927)

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

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

<!--BACKPORT [{"author":{"name":"Nick
Partridge","email":"nicholas.partridge@elastic.co"},"sourceCommit":{"committedDate":"2026-04-15T18:40:26Z","message":"[Lens
as code] Styling alignment (#262927)\n\n## Summary\n\nAligns all config
schemas around using top-level `styling` prop for\nglobal visual
styles\n\nCloses #262852\n\n### Checklist\n\n- [x] The PR description
includes the appropriate Release Notes section,\nand the correct
`release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*`
labels.","sha":"ddcc6394faabb65984c86d13bfe6835f8031478f","branchLabelMapping":{"^v9.5.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:version","v9.4.0","v9.5.0"],"title":"[Lens
as code] Styling
alignment","number":262927,"url":"https://github.com/elastic/kibana/pull/262927","mergeCommit":{"message":"[Lens
as code] Styling alignment (#262927)\n\n## Summary\n\nAligns all config
schemas around using top-level `styling` prop for\nglobal visual
styles\n\nCloses #262852\n\n### Checklist\n\n- [x] The PR description
includes the appropriate Release Notes section,\nand the correct
`release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*`
labels.","sha":"ddcc6394faabb65984c86d13bfe6835f8031478f"}},"sourceBranch":"main","suggestedTargetBranches":["9.4"],"targetPullRequestStates":[{"branch":"9.4","label":"v9.4.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.5.0","branchLabelMappingKey":"^v9.5.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/262927","number":262927,"mergeCommit":{"message":"[Lens
as code] Styling alignment (#262927)\n\n## Summary\n\nAligns all config
schemas around using top-level `styling` prop for\nglobal visual
styles\n\nCloses #262852\n\n### Checklist\n\n- [x] The PR description
includes the appropriate Release Notes section,\nand the correct
`release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*`
labels.","sha":"ddcc6394faabb65984c86d13bfe6835f8031478f"}}]}]
BACKPORT-->

Co-authored-by: Nick Partridge <nicholas.partridge@elastic.co>
florent-leborgne added a commit that referenced this pull request Apr 28, 2026
…pes (Viz PR B) (#263571)

## Summary

Part of the Lens Visualizations API documentation series (Viz PR B).
Adds descriptions to all 12 chart type schemas and all supporting
schemas.

**Series:**
- PR 1/4: Introduction overlay — merged (#262595)
- PR 2/4: Endpoint + field descriptions (#263151)
- PR 3/4: Code samples + response examples (#262874)
- **Viz PR B (this PR):** Schema descriptions for all 12 chart types +
supporting schemas

## Approach

Descriptions only — no schema types, validation constraints, or field
names changed. Rebased onto main to pick up #262927 (styling alignment
restructuring).

## What changed

### Operation schemas
- `metric_ops.ts`: object-level descriptions on
`metricOperationDefinitionSchema`,
`fieldMetricOrFormulaOperationDefinitionSchema`
- `bucket_ops.ts`: descriptions on `bucketOperationDefinitionSchema` and
all bucket operation fields; `When \`true\`,` pattern applied throughout
- `shared.ts`: fixed tautological `collapseBySchema` description; fixed
`ignore_global_filters` and `sampling` descriptions; fixed
`axisTitleSchemaProps`

### Chart schemas — all 12 types
Object-level descriptions on DSL variant, ES|QL variant, and union
schema for every chart type. "DSL data source" consistently replaced
with "data view". Additional field-level descriptions on chart-specific
fields (shape, alignment, icon, palette, etc.).

### Supporting schemas
- `color.ts`: descriptions on all color variant schemas; full palette
name list on all palette fields with correct defaults per context
- `format.ts`: descriptions on all format variant schemas
- `filter.ts`: descriptions on `filterSchema` and
`filterWithLabelSchema`
- `index.ts`: description on `lensApiStateSchema` top-level union
- `xy.ts`: `aggregate_first` description fixed

### Style quality pass
- All descriptions standardised to noun phrases (no verb-first
descriptions)
- `A/An` added to concrete countable noun descriptions
- Dropped valid enum values restored (alignment, slice label position,
donut hole size)
- Redundant numeric min/max removed from description text (auto-rendered
by OAS)
- `may` → `can` throughout

### Reverted
Object-level descriptions added to `@kbn/as-code-data-views-schema`
(`dataViewReferenceSchema`, `dataViewSpecSchema`, `runtimeFieldSchema`,
etc.) were **reverted** — object-level `meta.description` on schema
objects in shared packages does not surface in the OAS output. Will use
overlay fallback.

## Test plan
- [x] Rebased onto main; conflicts from #262927 resolved
- [x] Descriptions verified in combined OAS preview on Bump

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: florent-leborgne <10208282+florent-leborgne@users.noreply.github.com>
Co-authored-by: Marco Vettorello <vettorello.marco@gmail.com>
kibanamachine added a commit that referenced this pull request Apr 28, 2026
…art types (Viz PR B) (#263571) (#265997)

# Backport

This will backport the following commits from `main` to `9.4`:
- [[Docs][Visualizations API] Add schema descriptions to all 12 chart
types (Viz PR B)
(#263571)](#263571)

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

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

<!--BACKPORT [{"author":{"name":"Florent
LB","email":"florent.leborgne@elastic.co"},"sourceCommit":{"committedDate":"2026-04-28T09:59:20Z","message":"[Docs][Visualizations
API] Add schema descriptions to all 12 chart types (Viz PR B)
(#263571)\n\n## Summary\n\nPart of the Lens Visualizations API
documentation series (Viz PR B).\nAdds descriptions to all 12 chart type
schemas and all supporting\nschemas.\n\n**Series:**\n- PR 1/4:
Introduction overlay — merged (#262595)\n- PR 2/4: Endpoint + field
descriptions (#263151)\n- PR 3/4: Code samples + response examples
(#262874)\n- **Viz PR B (this PR):** Schema descriptions for all 12
chart types +\nsupporting schemas\n\n## Approach\n\nDescriptions only —
no schema types, validation constraints, or field\nnames changed.
Rebased onto main to pick up #262927 (styling
alignment\nrestructuring).\n\n## What changed\n\n### Operation
schemas\n- `metric_ops.ts`: object-level descriptions
on\n`metricOperationDefinitionSchema`,\n`fieldMetricOrFormulaOperationDefinitionSchema`\n-
`bucket_ops.ts`: descriptions on `bucketOperationDefinitionSchema`
and\nall bucket operation fields; `When \\`true\\`,` pattern applied
throughout\n- `shared.ts`: fixed tautological `collapseBySchema`
description; fixed\n`ignore_global_filters` and `sampling` descriptions;
fixed\n`axisTitleSchemaProps`\n\n### Chart schemas — all 12
types\nObject-level descriptions on DSL variant, ES|QL variant, and
union\nschema for every chart type. \"DSL data source\" consistently
replaced\nwith \"data view\". Additional field-level descriptions on
chart-specific\nfields (shape, alignment, icon, palette, etc.).\n\n###
Supporting schemas\n- `color.ts`: descriptions on all color variant
schemas; full palette\nname list on all palette fields with correct
defaults per context\n- `format.ts`: descriptions on all format variant
schemas\n- `filter.ts`: descriptions on `filterSchema`
and\n`filterWithLabelSchema`\n- `index.ts`: description on
`lensApiStateSchema` top-level union\n- `xy.ts`: `aggregate_first`
description fixed\n\n### Style quality pass\n- All descriptions
standardised to noun phrases (no verb-first\ndescriptions)\n- `A/An`
added to concrete countable noun descriptions\n- Dropped valid enum
values restored (alignment, slice label position,\ndonut hole size)\n-
Redundant numeric min/max removed from description text
(auto-rendered\nby OAS)\n- `may` → `can` throughout\n\n###
Reverted\nObject-level descriptions added to
`@kbn/as-code-data-views-schema`\n(`dataViewReferenceSchema`,
`dataViewSpecSchema`, `runtimeFieldSchema`,\netc.) were **reverted** —
object-level `meta.description` on schema\nobjects in shared packages
does not surface in the OAS output. Will use\noverlay fallback.\n\n##
Test plan\n- [x] Rebased onto main; conflicts from #262927 resolved\n-
[x] Descriptions verified in combined OAS preview on Bump\n\n🤖 Generated
with [Claude
Code](https://claude.com/claude-code)\n\n---------\n\nCo-authored-by:
Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
copilot-swe-agent[bot]
<198982749+Copilot@users.noreply.github.com>\nCo-authored-by:
florent-leborgne
<10208282+florent-leborgne@users.noreply.github.com>\nCo-authored-by:
Marco Vettorello
<vettorello.marco@gmail.com>","sha":"187a8e0c74b9cd78b0b963e3abf92211bc0a7939","branchLabelMapping":{"^v9.5.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Docs","release_note:skip","docs","APIDocs","backport:version","v9.4.0","v9.5.0"],"title":"[Docs][Visualizations
API] Add schema descriptions to all 12 chart types (Viz PR
B)","number":263571,"url":"https://github.com/elastic/kibana/pull/263571","mergeCommit":{"message":"[Docs][Visualizations
API] Add schema descriptions to all 12 chart types (Viz PR B)
(#263571)\n\n## Summary\n\nPart of the Lens Visualizations API
documentation series (Viz PR B).\nAdds descriptions to all 12 chart type
schemas and all supporting\nschemas.\n\n**Series:**\n- PR 1/4:
Introduction overlay — merged (#262595)\n- PR 2/4: Endpoint + field
descriptions (#263151)\n- PR 3/4: Code samples + response examples
(#262874)\n- **Viz PR B (this PR):** Schema descriptions for all 12
chart types +\nsupporting schemas\n\n## Approach\n\nDescriptions only —
no schema types, validation constraints, or field\nnames changed.
Rebased onto main to pick up #262927 (styling
alignment\nrestructuring).\n\n## What changed\n\n### Operation
schemas\n- `metric_ops.ts`: object-level descriptions
on\n`metricOperationDefinitionSchema`,\n`fieldMetricOrFormulaOperationDefinitionSchema`\n-
`bucket_ops.ts`: descriptions on `bucketOperationDefinitionSchema`
and\nall bucket operation fields; `When \\`true\\`,` pattern applied
throughout\n- `shared.ts`: fixed tautological `collapseBySchema`
description; fixed\n`ignore_global_filters` and `sampling` descriptions;
fixed\n`axisTitleSchemaProps`\n\n### Chart schemas — all 12
types\nObject-level descriptions on DSL variant, ES|QL variant, and
union\nschema for every chart type. \"DSL data source\" consistently
replaced\nwith \"data view\". Additional field-level descriptions on
chart-specific\nfields (shape, alignment, icon, palette, etc.).\n\n###
Supporting schemas\n- `color.ts`: descriptions on all color variant
schemas; full palette\nname list on all palette fields with correct
defaults per context\n- `format.ts`: descriptions on all format variant
schemas\n- `filter.ts`: descriptions on `filterSchema`
and\n`filterWithLabelSchema`\n- `index.ts`: description on
`lensApiStateSchema` top-level union\n- `xy.ts`: `aggregate_first`
description fixed\n\n### Style quality pass\n- All descriptions
standardised to noun phrases (no verb-first\ndescriptions)\n- `A/An`
added to concrete countable noun descriptions\n- Dropped valid enum
values restored (alignment, slice label position,\ndonut hole size)\n-
Redundant numeric min/max removed from description text
(auto-rendered\nby OAS)\n- `may` → `can` throughout\n\n###
Reverted\nObject-level descriptions added to
`@kbn/as-code-data-views-schema`\n(`dataViewReferenceSchema`,
`dataViewSpecSchema`, `runtimeFieldSchema`,\netc.) were **reverted** —
object-level `meta.description` on schema\nobjects in shared packages
does not surface in the OAS output. Will use\noverlay fallback.\n\n##
Test plan\n- [x] Rebased onto main; conflicts from #262927 resolved\n-
[x] Descriptions verified in combined OAS preview on Bump\n\n🤖 Generated
with [Claude
Code](https://claude.com/claude-code)\n\n---------\n\nCo-authored-by:
Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
copilot-swe-agent[bot]
<198982749+Copilot@users.noreply.github.com>\nCo-authored-by:
florent-leborgne
<10208282+florent-leborgne@users.noreply.github.com>\nCo-authored-by:
Marco Vettorello
<vettorello.marco@gmail.com>","sha":"187a8e0c74b9cd78b0b963e3abf92211bc0a7939"}},"sourceBranch":"main","suggestedTargetBranches":["9.4"],"targetPullRequestStates":[{"branch":"9.4","label":"v9.4.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.5.0","branchLabelMappingKey":"^v9.5.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/263571","number":263571,"mergeCommit":{"message":"[Docs][Visualizations
API] Add schema descriptions to all 12 chart types (Viz PR B)
(#263571)\n\n## Summary\n\nPart of the Lens Visualizations API
documentation series (Viz PR B).\nAdds descriptions to all 12 chart type
schemas and all supporting\nschemas.\n\n**Series:**\n- PR 1/4:
Introduction overlay — merged (#262595)\n- PR 2/4: Endpoint + field
descriptions (#263151)\n- PR 3/4: Code samples + response examples
(#262874)\n- **Viz PR B (this PR):** Schema descriptions for all 12
chart types +\nsupporting schemas\n\n## Approach\n\nDescriptions only —
no schema types, validation constraints, or field\nnames changed.
Rebased onto main to pick up #262927 (styling
alignment\nrestructuring).\n\n## What changed\n\n### Operation
schemas\n- `metric_ops.ts`: object-level descriptions
on\n`metricOperationDefinitionSchema`,\n`fieldMetricOrFormulaOperationDefinitionSchema`\n-
`bucket_ops.ts`: descriptions on `bucketOperationDefinitionSchema`
and\nall bucket operation fields; `When \\`true\\`,` pattern applied
throughout\n- `shared.ts`: fixed tautological `collapseBySchema`
description; fixed\n`ignore_global_filters` and `sampling` descriptions;
fixed\n`axisTitleSchemaProps`\n\n### Chart schemas — all 12
types\nObject-level descriptions on DSL variant, ES|QL variant, and
union\nschema for every chart type. \"DSL data source\" consistently
replaced\nwith \"data view\". Additional field-level descriptions on
chart-specific\nfields (shape, alignment, icon, palette, etc.).\n\n###
Supporting schemas\n- `color.ts`: descriptions on all color variant
schemas; full palette\nname list on all palette fields with correct
defaults per context\n- `format.ts`: descriptions on all format variant
schemas\n- `filter.ts`: descriptions on `filterSchema`
and\n`filterWithLabelSchema`\n- `index.ts`: description on
`lensApiStateSchema` top-level union\n- `xy.ts`: `aggregate_first`
description fixed\n\n### Style quality pass\n- All descriptions
standardised to noun phrases (no verb-first\ndescriptions)\n- `A/An`
added to concrete countable noun descriptions\n- Dropped valid enum
values restored (alignment, slice label position,\ndonut hole size)\n-
Redundant numeric min/max removed from description text
(auto-rendered\nby OAS)\n- `may` → `can` throughout\n\n###
Reverted\nObject-level descriptions added to
`@kbn/as-code-data-views-schema`\n(`dataViewReferenceSchema`,
`dataViewSpecSchema`, `runtimeFieldSchema`,\netc.) were **reverted** —
object-level `meta.description` on schema\nobjects in shared packages
does not surface in the OAS output. Will use\noverlay fallback.\n\n##
Test plan\n- [x] Rebased onto main; conflicts from #262927 resolved\n-
[x] Descriptions verified in combined OAS preview on Bump\n\n🤖 Generated
with [Claude
Code](https://claude.com/claude-code)\n\n---------\n\nCo-authored-by:
Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
copilot-swe-agent[bot]
<198982749+Copilot@users.noreply.github.com>\nCo-authored-by:
florent-leborgne
<10208282+florent-leborgne@users.noreply.github.com>\nCo-authored-by:
Marco Vettorello
<vettorello.marco@gmail.com>","sha":"187a8e0c74b9cd78b0b963e3abf92211bc0a7939"}}]}]
BACKPORT-->

Co-authored-by: Florent LB <florent.leborgne@elastic.co>
Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: florent-leborgne <10208282+florent-leborgne@users.noreply.github.com>
Co-authored-by: Marco Vettorello <vettorello.marco@gmail.com>
smith pushed a commit to smith/kibana that referenced this pull request Apr 28, 2026
…pes (Viz PR B) (elastic#263571)

## Summary

Part of the Lens Visualizations API documentation series (Viz PR B).
Adds descriptions to all 12 chart type schemas and all supporting
schemas.

**Series:**
- PR 1/4: Introduction overlay — merged (elastic#262595)
- PR 2/4: Endpoint + field descriptions (elastic#263151)
- PR 3/4: Code samples + response examples (elastic#262874)
- **Viz PR B (this PR):** Schema descriptions for all 12 chart types +
supporting schemas

## Approach

Descriptions only — no schema types, validation constraints, or field
names changed. Rebased onto main to pick up elastic#262927 (styling alignment
restructuring).

## What changed

### Operation schemas
- `metric_ops.ts`: object-level descriptions on
`metricOperationDefinitionSchema`,
`fieldMetricOrFormulaOperationDefinitionSchema`
- `bucket_ops.ts`: descriptions on `bucketOperationDefinitionSchema` and
all bucket operation fields; `When \`true\`,` pattern applied throughout
- `shared.ts`: fixed tautological `collapseBySchema` description; fixed
`ignore_global_filters` and `sampling` descriptions; fixed
`axisTitleSchemaProps`

### Chart schemas — all 12 types
Object-level descriptions on DSL variant, ES|QL variant, and union
schema for every chart type. "DSL data source" consistently replaced
with "data view". Additional field-level descriptions on chart-specific
fields (shape, alignment, icon, palette, etc.).

### Supporting schemas
- `color.ts`: descriptions on all color variant schemas; full palette
name list on all palette fields with correct defaults per context
- `format.ts`: descriptions on all format variant schemas
- `filter.ts`: descriptions on `filterSchema` and
`filterWithLabelSchema`
- `index.ts`: description on `lensApiStateSchema` top-level union
- `xy.ts`: `aggregate_first` description fixed

### Style quality pass
- All descriptions standardised to noun phrases (no verb-first
descriptions)
- `A/An` added to concrete countable noun descriptions
- Dropped valid enum values restored (alignment, slice label position,
donut hole size)
- Redundant numeric min/max removed from description text (auto-rendered
by OAS)
- `may` → `can` throughout

### Reverted
Object-level descriptions added to `@kbn/as-code-data-views-schema`
(`dataViewReferenceSchema`, `dataViewSpecSchema`, `runtimeFieldSchema`,
etc.) were **reverted** — object-level `meta.description` on schema
objects in shared packages does not surface in the OAS output. Will use
overlay fallback.

## Test plan
- [x] Rebased onto main; conflicts from elastic#262927 resolved
- [x] Descriptions verified in combined OAS preview on Bump

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: florent-leborgne <10208282+florent-leborgne@users.noreply.github.com>
Co-authored-by: Marco Vettorello <vettorello.marco@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 release_note:skip Skip the PR/issue when compiling release notes v9.4.0 v9.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Lens as code] Align stylings schemas across charts

4 participants