Fix stacked Ask AI Enter replays and light-mode code contrast - #3055
Merged
Merged
Conversation
A second Enter while waiting used to start another interval, and uninstall left those timers running, so submit could fire more than once or after the listener was gone. Co-authored-by: Cursor <cursoragent@cursor.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d118984. Configure here.
DocSearch renders answer code as `<pre><code class="language-js">`, which the site's Prism theme claimed with `!important` and painted in the light gray meant for the dark code blocks on doc pages, leaving it near-invisible on DocSearch's light code background. Co-authored-by: Cursor <cursoragent@cursor.com>
The catch-up poll was only replaced when Enter was intercepted again. A later Enter that the guard let through (option already caught up, or no longer highlighted) left that interval running, so a replay could still fire after DocSearch had already handled the question. Co-authored-by: Cursor <cursoragent@cursor.com>
shahbaz17
approved these changes
Sep 14, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
<pre><code class="language-js">, which the site's Prism theme claims with!importantand paints in the light gray it uses on the dark code blocks of doc pages. DocSearch backs its code blocks with the modal surface instead, so in light mode that gray landed on near-white (#c8cedaon#f5f5fa, roughly 1.3:1). Ask AI code blocks now take their color from--docsearch-text-color.Measured after the change: light modal
#36395aon#f5f5fa(~9:1), dark modal#e3e3e3on#36395a. The sidepanel was already covered by existing light and dark overrides and is unchanged.Test plan
Note
Low Risk
Client-side DocSearch keyboard workaround and scoped CSS override; no auth, API, or data-path changes.
Overview
Fixes double Ask AI submits when Enter is pressed before the highlighted option catches up to the search input. The stale-question guard now keeps at most one catch-up poll: each new Enter clears any in-flight wait, and teardown clears the interval so a replay cannot fire after navigation or after the user already submitted.
Separately, Ask AI markdown code blocks in DocSearch (modal and sidepanel) now use
--docsearch-text-colorinstead of the site Prism theme’s light gray, which was nearly illegible on the light modal surface.Reviewed by Cursor Bugbot for commit 0d30752. Bugbot is set up for automated code reviews on this repo. Configure here.