Skip to content

Show one underline under optional API path segments - #5009

Merged
reakaleek merged 1 commit into
mainfrom
double-underline-cluster-c530a706
Nov 23, 2026
Merged

reakaleek merged 1 commit into
mainfrom
double-underline-cluster-c530a706

Conversation

@reakaleek

@reakaleek reakaleek commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Optional path segments in an API operation's request line now show one dotted underline, the same as required segments, instead of a dashed and a dotted line stacked together.

Affects: API reference, Site UI

Prompt summary: Find out why the request lines on the operation-cluster-state page still show a double underline. Fix it at the source, and use the second request line's dotted underline as the single style for every placeholder.

Why

The first request line, GET /_cluster/state/{metric}/{index}, wraps each optional segment in a .api-url-optional span. That span draws a dashed border-bottom. The a.api-url-param link inside it draws a dotted text-decoration. Both paint under the same text, so the reader sees two lines. Required segments have no wrapper and show only the dotted line.

What

One element per segment

_EndpointPath.cshtml renders each placeholder as a single element: <a class="api-url-param api-url-optional"> when the parameter is documented on the page, a <span class="api-url-optional"> when it is not. The / stays outside that element, so no segment underlines its slash.

One underline style

api-docs.css gives .api-url-optional and a.api-url-param the same dotted underline in one rule. The dashed border and the muted optional colour are gone. The "Optional. Leave it out to call …" tooltip and the help cursor stay on optional segments, and they are now the only cue that a segment is optional. api-reference.css gets the same dotted cue.

Test

Render_OptionalSegments_AreOneElementEach snapshots a linked and an unlinked optional segment. It fails on the old markup. The existing placeholder-link regex now accepts the optional class.

Verify

dotnet test --project tests/Elastic.ApiExplorer.Tests
mise run serve
# open /api/elasticsearch/operation/operation-cluster-state
# every placeholder has one dotted underline and the slashes have none

Check on the preview

  • Elasticsearch: Get the cluster state — the first request line has two optional segments. Each shows one dotted underline, and the slashes show none, the same as the second line.

An optional segment in the request line was a `.api-url-optional` span with a dashed border around an `a.api-url-param` with a dotted underline, so two lines stacked under the same text. Each segment is now one element, and optional segments use the same dotted underline as required ones.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@reakaleek
reakaleek requested a review from a team as a code owner November 23, 2026 14:04
@reakaleek reakaleek added the bug label Nov 23, 2026
@reakaleek
reakaleek requested a review from technige November 23, 2026 14:04
@github-actions

Copy link
Copy Markdown
Contributor

@reakaleek
reakaleek merged commit 8899c5c into main Nov 23, 2026
49 of 50 checks passed
@reakaleek
reakaleek deleted the double-underline-cluster-c530a706 branch November 23, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant