Skip to content

[9.3] [Console] Fix method suggestion order (#270787)#271632

Merged
kapral18 merged 1 commit into
elastic:9.3from
kapral18:backport/9.3/pr-270787
May 29, 2026
Merged

[9.3] [Console] Fix method suggestion order (#270787)#271632
kapral18 merged 1 commit into
elastic:9.3from
kapral18:backport/9.3/pr-270787

Conversation

@kapral18
Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 9.3:

Questions ?

Please refer to the Backport tool documentation

Closes elastic#259251

## Summary

- Pins Console HTTP method completion ordering with explicit `sortText`
values so Monaco does not fall back to alphabetical label sorting.
- Keeps the existing method set unchanged while ordering `GET` first and
`DELETE` last.

## Root Cause

- Monaco uses `sortText` for completion ordering and falls back to the
item label when `sortText` is missing, which can put `DELETE` before
safer/default verbs.

## Fix

- Assign stable `sortText` values to method completion items based on
the intended canonical order.
- Add a focused unit test that sorts method suggestions the same way and
verifies `GET` is first and `DELETE` is last.

## Before
<img width="723" height="466" alt="image"
src="https://github.com/user-attachments/assets/faf244b2-4207-483b-acbc-32b148441b18"
/>

## After
<img width="725" height="437" alt="image"
src="https://github.com/user-attachments/assets/782c0c60-6052-4c28-80bc-f45403fa1383"
/>

## Test Plan

- `node scripts/jest
--config=src/platform/plugins/shared/console/jest.config.js
src/platform/plugins/shared/console/public/application/containers/editor/monaco_editor_actions_provider.test.ts`
— passed.
- `node scripts/check_changes.ts` — passed.

## Release Note

- Fixes Console autocomplete so `GET` is shown before `DELETE` when
suggesting HTTP methods on an empty request line.

Assisted with Cursor using GPT-5.5

Made with [Cursor](https://cursor.com)

Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit 8849fcf)

# Conflicts:
#	src/platform/plugins/shared/console/public/application/containers/editor/monaco_editor_actions_provider.test.ts
@kapral18 kapral18 requested a review from kibanamachine as a code owner May 28, 2026 08:23
@kapral18 kapral18 added the backport This PR is a backport of another PR label May 28, 2026
@kapral18 kapral18 enabled auto-merge (squash) May 28, 2026 08:24
@kibanamachine kibanamachine requested review from SoniaSanzV and removed request for kibanamachine May 28, 2026 08:24
@kibanamachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Scout Lane #5 - stateful-classic / default / local-stateful-classic - APM integration not installed but setup completed - Admin user
  • [job] [logs] Scout Lane #5 - stateful-classic / default / local-stateful-classic - APM integration not installed but setup completed - Viewer user
  • [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 - Collector integration is not installed - Symbolizer integration is not installed
  • [job] [logs] Scout Lane #2 - stateful-classic / default / local-stateful-classic - Infrastructure Inventory - Onboarding - Renders no data page and redirects to onboarding page when no data is present

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
console 203.3KB 203.3KB +23.0B

@kapral18 kapral18 merged commit eb7f000 into elastic:9.3 May 29, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants