Skip to content

Fix: Keep Kick start your query button visible while typing in a new query editor - #87

Open
henrybrewer00-dotcom wants to merge 1 commit into
grafana:mainfrom
henrybrewer00-dotcom:fix/kickstart-button-visibility-118375
Open

Fix: Keep Kick start your query button visible while typing in a new query editor#87
henrybrewer00-dotcom wants to merge 1 commit into
grafana:mainfrom
henrybrewer00-dotcom:fix/kickstart-button-visibility-118375

Conversation

@henrybrewer00-dotcom

Copy link
Copy Markdown

Summary

The "Kick start your query" button in the Prometheus query editor disappears as soon as the user starts typing in a new editor. The button should only hide when the editor opens with an existing (saved) query.

  • Capture Boolean(props.query.expr) on mount via a useRef and gate the button on that initial value.
  • New editors keep the button visible regardless of typing; editors loaded with a saved query continue to hide it.
  • Adds three unit tests covering the new behavior in PromQueryEditorSelector.test.tsx.

Fixes #108 (restores the intent of grafana/grafana#113762 without the regression).

Test plan

  • jest — all 918 @grafana/prometheus tests pass, including 3 new cases in PromQueryEditorSelector.test.tsx:
    • shows the Kick start your query button for a new query editor
    • hides the Kick start your query button when the editor opens with an existing query
    • keeps the Kick start your query button visible after typing in a new query editor
  • yarn typecheck passes
  • Manual: open a new Prometheus query editor, type a partial query — button should remain visible. Open a saved dashboard panel with an existing Prometheus query — button should be hidden.

…query editor

Capture whether the editor was opened with an existing query in a ref on mount
so the Kickstart button only hides when the editor loads with a saved query
(e.g. from a panel or dashboard). New query editors keep the button visible
even after the user starts typing.

Fixes grafana/grafana#118375
@henrybrewer00-dotcom
henrybrewer00-dotcom requested a review from a team as a code owner May 12, 2026 04:37
@cla-assistant

cla-assistant Bot commented May 12, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@itsmylife

Copy link
Copy Markdown
Collaborator

@henrybrewer00-dotcom Thank you for your contribution. I'm reviewing it but I won't be able to merge it unless you sign your commits. Our CI dictates that all commits must be signed. Also you have to sign CLA: #87 (comment)

@itsmylife itsmylife self-assigned this Jul 3, 2026
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 2 weeks if no further activity occurs. Please feel free to give a status update or ping for review. Thank you for your contributions!

@github-actions github-actions Bot added the stale Issue with no recent activity label Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale Issue with no recent activity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix: Update "Kickstart your query" button behavior

4 participants