Skip to content

test(user-input): assert dismissed mention stays closed across repeated clicks#5466

Merged
waleedlatif1 merged 1 commit into
stagingfrom
strengthen-mention-menu-dismiss-test
Jul 7, 2026
Merged

test(user-input): assert dismissed mention stays closed across repeated clicks#5466
waleedlatif1 merged 1 commit into
stagingfrom
strengthen-mention-menu-dismiss-test

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Follow-up to fix(user-input): stop @mention/skill menu from reopening after dismiss #5464 (already merged), which fixed the @mention/skill menu reopening after a click-away/Escape dismiss
  • That PR's final commit (a test-only strengthening) landed after the squash-merge cut, so it never made it to staging — this re-adds it
  • Strengthens the click-away regression test to click the same position three times after a dismiss, not just once, proving the suppression holds for the exact reported repro (repeatedly clicking the same trailing spot) rather than just a single follow-up click

Type of Change

  • Chore (test-only, no production code change)

Testing

Ran the full use-prompt-editor.test.tsx suite (5 tests, all passing) plus typecheck/lint.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

…ed clicks

Follow-up to #5464: strengthens the click-away regression test to click
the same position three times after a dismiss, not just once, proving
the suppression holds for the exact reported repro (repeatedly clicking
the same trailing spot) rather than just a single follow-up click.
@vercel

vercel Bot commented Jul 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jul 7, 2026 6:52am

Request Review

@cursor

cursor Bot commented Jul 7, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
No production code changes; only test coverage and naming in use-prompt-editor.test.tsx.

Overview
Test-only follow-up to the merged @mention dismiss fix: the production behavior is unchanged; this PR re-lands a stronger regression test that missed the squash-merge.

The click-away case in use-prompt-editor.test.tsx now simulates three handleSelectAdjust calls at the same caret position after handlePlusMenuClose, instead of one. The test title was updated to match that intent. Expectations are unchanged: mentionQuery stays null and openMenu.open is still only called once when the menu was first opened.

Reviewed by Cursor Bugbot for commit 78a13c0. Configure here.

@greptile-apps

greptile-apps Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This is a test-only follow-up to #5464 that strengthens the click-away regression test for the @mention/skill menu dismissal. It re-adds a test commit that was cut off when the parent PR was squash-merged.

  • The test description is updated to reflect that suppression is checked across three repeated clicks, matching the originally reported repro scenario of clicking the same trailing spot multiple times.
  • A single act() block is replaced with a three-iteration for loop, each wrapped in its own act() call, verifying that mentionQuery stays null and openMenu.open is still only called once after all repeated clicks.

Confidence Score: 5/5

Test-only change with no production code modifications; safe to merge.

The change is confined to a single test file and only adds loop iterations to an existing assertion. No production logic is touched, the new loop wraps each act() correctly, and the assertions after the loop (mentionQuery is null, open called exactly once) are exactly the right invariants to prove the suppression holds under repeated clicks.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/prompt-editor/use-prompt-editor.test.tsx Test strengthened to assert that the dismissed mention stays closed across three repeated clicks at the same caret position, not just one; test description updated to match.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant Test
    participant usePromptEditor
    participant plusMenuRef

    Test->>usePromptEditor: "typeInto(textarea, "@f") + handleInputChange()"
    usePromptEditor->>plusMenuRef: "open() [call #1]"
    usePromptEditor-->>Test: "mentionQuery = "f""

    Test->>usePromptEditor: handlePlusMenuClose()
    usePromptEditor-->>Test: "mentionQuery = null"

    loop 3 times (repeated clicks at same position)
        Test->>usePromptEditor: setSelectionRange(2,2) + handleSelectAdjust()
        usePromptEditor-->>Test: mentionQuery stays null (no re-open)
    end

    Test->>plusMenuRef: assert open() called exactly once
    Test->>usePromptEditor: assert mentionQuery still null
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant Test
    participant usePromptEditor
    participant plusMenuRef

    Test->>usePromptEditor: "typeInto(textarea, "@f") + handleInputChange()"
    usePromptEditor->>plusMenuRef: "open() [call #1]"
    usePromptEditor-->>Test: "mentionQuery = "f""

    Test->>usePromptEditor: handlePlusMenuClose()
    usePromptEditor-->>Test: "mentionQuery = null"

    loop 3 times (repeated clicks at same position)
        Test->>usePromptEditor: setSelectionRange(2,2) + handleSelectAdjust()
        usePromptEditor-->>Test: mentionQuery stays null (no re-open)
    end

    Test->>plusMenuRef: assert open() called exactly once
    Test->>usePromptEditor: assert mentionQuery still null
Loading

Reviews (1): Last reviewed commit: "test(user-input): assert dismissed menti..." | Re-trigger Greptile

@waleedlatif1 waleedlatif1 merged commit 3ddf254 into staging Jul 7, 2026
18 checks passed
@waleedlatif1 waleedlatif1 deleted the strengthen-mention-menu-dismiss-test branch July 7, 2026 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant