Skip to content

Keep the end of an API path visible in search results - #4890

Merged
reakaleek merged 2 commits into
mainfrom
fix-truncated-api-path-se-5eee810f
Nov 17, 2026
Merged

reakaleek merged 2 commits into
mainfrom
fix-truncated-api-path-se-5eee810f

Conversation

@reakaleek

Copy link
Copy Markdown
Member

An API search result now truncates a long route like the search breadcrumb does. The end of the path stays visible and the shared start shrinks first.

Affects: Site UI

Prompt summary: Searching "insights by id" cuts the API path in the results with an ellipsis in an odd place. The author asked for a better way to show it and suggested truncating it the same way as the breadcrumbs in search results.

Why

The route line cut every long path at its end with text-overflow: ellipsis. The end is the only part that tells operations apart. Two Insights results both read /v1/monitoring/{resourceType}/{resourceId}/in…, so a reader cannot tell "Get insight by ID" from "Search insights".

What

Route truncation

A long route now splits into three parts, like the search breadcrumb. The first segment never shrinks. The middle gives up its width first. The last literal segment, with any parameters after it, shrinks last. The row from the report reads GET /v1…/insights/{insightId} at the same width. A path that fits looks the same as before.

Path splitting

splitRoutePath finds the last segment that is not a {parameter} and splits the path around it. A path with no literal segment, or with one segment, has no first or middle part and renders whole.

Tests

RouteLine.test.tsx checks the split for four paths against literal values. The existing .route-line assertions in SearchResultsList.test.tsx pass unchanged.

Out of scope The id token still highlights the Id in resourceId. Property rows highlight the same way, and changing it affects every highlighted surface.

Verify

mise run site:test
mise run site:check

🤖 Generated with Claude Code

The route line cut long paths at the end with an ellipsis, which hid the
only part that tells operations apart. Two Insights results both read
`/v1/monitoring/{resourceType}/{resourceId}/in…`. The row now truncates
like the search breadcrumb: the first segment stays, the middle shrinks
first, and the last literal segment shrinks last.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@reakaleek
reakaleek requested a review from a team as a code owner November 17, 2026 11:46
@reakaleek
reakaleek requested a review from theletterf November 17, 2026 11:46
…by Libra)

The route line highlighted each of its three parts on its own, so a
query like `/api/fleet` matched nothing in `/api/fleet/agents`. Matches
are now found on the whole path and clipped to each part.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@reakaleek
reakaleek enabled auto-merge (squash) November 17, 2026 11:55
@github-actions

Copy link
Copy Markdown
Contributor

@reakaleek
reakaleek merged commit 4774466 into main Nov 17, 2026
44 checks passed
@reakaleek
reakaleek deleted the fix-truncated-api-path-se-5eee810f branch November 17, 2026 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants