Skip to content

ux imrovoements#243

Open
aidenybai wants to merge 5 commits intomainfrom
ux-imrovoements
Open

ux imrovoements#243
aidenybai wants to merge 5 commits intomainfrom
ux-imrovoements

Conversation

@aidenybai
Copy link
Owner

@aidenybai aidenybai commented Mar 15, 2026

  • www
  • www
  • vite+

Note

Medium Risk
Medium risk due to breaking public API/theme changes (removal of crosshair-related options/state/hook) and UI behavior changes around prompt cancel/dismiss flows that could affect user interactions.

Overview
Removes the crosshair overlay feature end-to-end: drops theme.crosshair, onCrosshair hook, and isCrosshairVisible/crosshairVisible state/props; deletes crosshair rendering and pointermove tracking from OverlayCanvas, and updates e2e coverage accordingly.

Improves selection label UX: adds selectionLabelShakeCount to trigger a shake animation on cancel-to-dismiss, refocuses the input when dismiss is canceled, and updates label positioning logic to account for visualViewport offsets/scroll/resize for better behavior with zoom/virtual keyboards.

Tweaks toolbar history indicator: replaces the unread dot with a numeric badge that shows historyItemCount (only when unread and count > 0).

Written by Cursor Bugbot for commit 0c67391. This will update automatically on new commits. Configure here.


Summary by cubic

Removes the crosshair overlay and related theme/hook/state APIs to simplify the UI, improves selection label positioning and cancel behavior, and replaces the toolbar history unread dot with a numeric badge.

  • New Features

    • Cancel now shakes the selection label and, if not already pending, opens the discard prompt; canceling the prompt re-focuses the input.
    • Better label positioning with zoom/virtual keyboards using visualViewport offsets and scroll/resize listeners.
    • Toolbar history shows a numeric unread badge only when hasUnreadHistoryItems and historyItemCount > 0.
  • Migration

    • Remove theme.crosshair (no replacement).
    • Remove onCrosshair hook and CrosshairContext types.
    • Remove isCrosshairVisible from ReactGrabState and crosshairVisible prop from the renderer/overlay.
    • Update code/tests that referenced the crosshair overlay; the cursor still becomes a crosshair when active.

Written for commit 0c67391. Summary will update on new commits.

@pullfrog
Copy link
Contributor

pullfrog bot commented Mar 15, 2026

Error

agent completed without reporting progress

Pullfrog  | Rerun failed job ➔View workflow run | Triggered by Pullfrogpullfrog.com𝕏

@vercel
Copy link
Contributor

vercel bot commented Mar 15, 2026

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

Project Deployment Actions Updated (UTC)
react-grab-website Ready Ready Preview, Comment Mar 15, 2026 10:31am

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 15, 2026

Open in StackBlitz

@react-grab/cli

npm i https://pkg.pr.new/aidenybai/react-grab/@react-grab/cli@243

grab

npm i https://pkg.pr.new/aidenybai/react-grab/grab@243

@react-grab/amp

npm i https://pkg.pr.new/aidenybai/react-grab/@react-grab/amp@243

@react-grab/claude-code

npm i https://pkg.pr.new/aidenybai/react-grab/@react-grab/claude-code@243

@react-grab/codex

npm i https://pkg.pr.new/aidenybai/react-grab/@react-grab/codex@243

@react-grab/copilot

npm i https://pkg.pr.new/aidenybai/react-grab/@react-grab/copilot@243

@react-grab/cursor

npm i https://pkg.pr.new/aidenybai/react-grab/@react-grab/cursor@243

@react-grab/droid

npm i https://pkg.pr.new/aidenybai/react-grab/@react-grab/droid@243

@react-grab/gemini

npm i https://pkg.pr.new/aidenybai/react-grab/@react-grab/gemini@243

@react-grab/opencode

npm i https://pkg.pr.new/aidenybai/react-grab/@react-grab/opencode@243

react-grab

npm i https://pkg.pr.new/aidenybai/react-grab@243

@react-grab/relay

npm i https://pkg.pr.new/aidenybai/react-grab/@react-grab/relay@243

@react-grab/utils

npm i https://pkg.pr.new/aidenybai/react-grab/@react-grab/utils@243

commit: 0c67391

Comment on lines +1624 to +1627
if (!isPendingDismiss()) {
actions.setPendingDismiss(true);
return;
}

actions.clearInputText();
actions.clearReplySessionId();
deactivateRenderer();
setSelectionLabelShakeCount((count) => count + 1);
Copy link
Contributor

@vercel vercel bot Mar 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Escape key behavior broken - always triggers shake animation even when dismiss is already pending, breaks the expected two-press escape flow

Fix on Vercel

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 18 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/react-grab/src/core/index.tsx">

<violation number="1" location="packages/react-grab/src/core/index.tsx:1624">
P1: `handleInputCancel` no longer has any path that calls `deactivateRenderer`. Two regressions:

1. **Empty input shows unnecessary discard prompt** — the old `currentInput` check is gone, so canceling with an empty input now shows a "Discard?" prompt instead of immediately deactivating.
2. **Mouse/touch users are trapped** — when `isPendingDismiss` is already `true`, subsequent cancel triggers (e.g., clicking outside the selection) just increment the shake count and never deactivate. Keyboard users can still escape via the `DiscardPrompt` buttons, but mouse-only users have no way out.

Restore the empty-input fast-path and the second-cancel deactivation path.</violation>
</file>

<file name="packages/react-grab/src/components/selection-label/index.tsx">

<violation number="1" location="packages/react-grab/src/components/selection-label/index.tsx:445">
P2: Add `onAnimationCancel` to ensure the `isShaking` state resets if the animation is aborted.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

style={{
display: isCompletedStatus() && !props.error ? "none" : undefined,
}}
onAnimationEnd={() => setIsShaking(false)}
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Mar 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Add onAnimationCancel to ensure the isShaking state resets if the animation is aborted.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/react-grab/src/components/selection-label/index.tsx, line 445:

<comment>Add `onAnimationCancel` to ensure the `isShaking` state resets if the animation is aborted.</comment>

<file context>
@@ -418,10 +437,12 @@ export const SelectionLabel: Component<SelectionLabelProps> = (props) => {
           style={{
             display: isCompletedStatus() && !props.error ? "none" : undefined,
           }}
+          onAnimationEnd={() => setIsShaking(false)}
         >
           <Show when={props.status === "copying" && !props.isPendingAbort}>
</file context>
Suggested change
onAnimationEnd={() => setIsShaking(false)}
onAnimationEnd={() => setIsShaking(false)}
onAnimationCancel={() => setIsShaking(false)}
Fix with Cubic

style={{
display: isCompletedStatus() && !props.error ? "none" : undefined,
}}
onAnimationEnd={() => setIsShaking(false)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing onAnimationCancel handler leaves isShaking=true when animation is cancelled by display property change

Fix on Vercel

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