Skip to content

Improve selection menu UX and plugin action overflow - #2813

Open
bajrangCoder wants to merge 3 commits into
mainfrom
feat/improve-selection-menu-ux
Open

Improve selection menu UX and plugin action overflow#2813
bajrangCoder wants to merge 3 commits into
mainfrom
feat/improve-selection-menu-ux

Conversation

@bajrangCoder

Copy link
Copy Markdown
Member

Summary

Improves the editor selection menu.

Changes

  • Keep common actions in a compact, stable toolbar:
    • Copy
    • Cut
    • Paste
    • Select all
  • Use an icon-only overflow button.
  • Use a horizontal action strip for small overflow sets.
  • Automatically switch large action sets to a vertically scrollable icon grid.
  • Preserve icon-only plugin actions without requiring names.
  • Show Code actions only when an LSP code-action provider is available.
  • Prevent the selection menu from blinking or immediately reopening after an action.
  • Improve pointer and accessibility activation handling.
  • Add smooth Motion animations with reduced-motion support.
  • Preserve the existing:
    • Theme-controlled border radius
    • Action sizing
    • Colors
    • Pressed and active states
  • Keep the selection-menu registration API backward compatible.

@greptile-apps

greptile-apps Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR reorganizes the touch selection menu into stable primary and overflow action groups, adds accessible pointer and keyboard activation, and conditionally exposes code actions.

  • Adds movement and final-displacement guards that prevent scroll gestures from activating actions.
  • Adds compact and grid overflow layouts with animation and reduced-motion handling.
  • Preserves plugin action compatibility while adding action metadata and LSP capability filtering.
  • Adds unit coverage for action partitioning and pointer cancellation behavior.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
src/cm/selectionMenuUtils.ts Adds action metadata, primary/overflow partitioning, and pointer activation that checks movement both during the gesture and at release.
src/cm/touchSelectionMenu.js Reworks menu rendering, overflow presentation, animation, action dismissal, positioning, and code-action availability.
src/lib/selectionMenu.js Adds stable IDs and accessible labels while preserving the existing registration arguments and making metadata optional.
src/main.scss Defines compact toolbar, horizontal overflow, scrollable grid, pressed-state, and focus-visible styling.
tests/unit/selectionMenuButton.test.ts Covers single activation, cancellation, movement suppression, and final pointer displacement.
tests/unit/selectionMenuUtils.test.ts Covers primary and overflow partitioning for selection and caret states.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  S[Selection state] --> F[Filter available actions]
  F --> P[Partition primary and overflow]
  P --> T[Compact primary toolbar]
  P --> O[Scrollable overflow]
  O --> G{More than ten actions?}
  G -->|No| H[Horizontal strip]
  G -->|Yes| V[Vertical icon grid]
  T --> A[Pointer or keyboard activation]
  H --> A
  V --> A
  A --> M{Pointer moved beyond tolerance?}
  M -->|Yes| C[Cancel activation]
  M -->|No| E[Execute action and dismiss menu]
Loading

Reviews (3): Last reviewed commit: "fix(editor): validate pointer displaceme..." | Re-trigger Greptile

Comment thread src/cm/selectionMenuUtils.ts
@bajrangCoder

This comment was marked as outdated.

Comment thread src/cm/selectionMenuUtils.ts
@bajrangCoder

This comment was marked as outdated.

@RohitKushvaha01 RohitKushvaha01 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@RohitKushvaha01 RohitKushvaha01 added the CI: RUN ON-DEMAND PREVIEW RELEASES Triggers an on-demand preview build for this pull request via CI workflow. label Aug 26, 2026
@github-actions github-actions Bot removed the CI: RUN ON-DEMAND PREVIEW RELEASES Triggers an on-demand preview build for this pull request via CI workflow. label Aug 26, 2026
@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown

Preview Release for this, has been built.

Click here to view that github actions build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants