Skip to content

fix: quicktools behaviour in read only more - #2747

Merged
deadlyjack merged 1 commit into
mainfrom
fix/readonly-quicktools
Aug 14, 2026
Merged

fix: quicktools behaviour in read only more#2747
deadlyjack merged 1 commit into
mainfrom
fix/readonly-quicktools

Conversation

@deadlyjack

Copy link
Copy Markdown
Member

No description provided.

@greptile-apps

greptile-apps Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR improves read-only editor interaction by allowing unfocused cursor placement and adding one-shot Android keyboard capture for QuickTools modifier commands.

  • Adds a visible, static read-only cursor and permits cursor placement on ordinary short taps.
  • Normalizes keydown, input, beforeinput, and composition events for read-only QuickTools commands while suppressing duplicate events.
  • Adds unit coverage for read-only cursor behavior, IME event sequences, duplicate suppression, and selection-safe shortcuts.
  • Disables compact Babel output.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete blocking or independently actionable non-blocking issue identified.

The new cursor placement remains guarded by CodeMirror read-only enforcement, while QuickTools capture validates its target, executes only the first normalized character, suppresses duplicate IME events, and clears or replaces pending sessions through the relevant lifecycle paths.

Important Files Changed

Filename Overview
src/cm/editorReadOnly.ts Adds an unfocused static cursor theme and generalizes read-only cursor placement while preserving document and focus guards.
src/cm/touchSelectionMenu.js Extends short-tap handling to place a read-only cursor even when no range was previously selected.
src/handlers/quickTools.js Integrates one-shot read-only keyboard capture into QuickTools and validates target connectivity and read-only state before command dispatch.
src/handlers/readOnlyQuickToolsCapture.ts Introduces pure event normalization and duplicate suppression for Android keyboard and composition event sequences.
.babelrc Changes Babel output generation from compact to non-compact form without altering runtime semantics.
tests/unit/editorReadOnly.test.ts Covers cursor visibility, placement, clamping, focus preservation, and read-only reconfiguration.
tests/unit/quickToolsReadOnly.test.ts Adds integration coverage proving a composed read-only shortcut runs once without editing or focusing the document.
tests/unit/readOnlyQuickToolsCapture.test.ts Thoroughly covers capture sources, ambiguous input, composition sequences, pass-through keys, and duplicate events.

Sequence Diagram

sequenceDiagram
    participant User
    participant QuickTools
    participant Capture as ReadOnly Capture
    participant Commands
    participant Editor
    User->>QuickTools: Activate modifier
    QuickTools->>Capture: Create session for read-only view
    User->>QuickTools: Type shortcut character
    QuickTools->>Capture: Normalize keyboard/IME event
    Capture-->>QuickTools: First character
    QuickTools->>Commands: Resolve character + modifier
    Commands->>Editor: Run selection-safe command
    QuickTools->>Capture: Absorb duplicate IME events
    QuickTools->>Editor: Keep read-only editor unfocused
Loading

Reviews (1): Last reviewed commit: "fix: quicktools behaviour in read only m..." | Re-trigger Greptile

@deadlyjack
deadlyjack added this pull request to the merge queue Aug 14, 2026
Merged via the queue into main with commit 60cd223 Aug 14, 2026
9 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in The Code Board - Acode Aug 14, 2026
@deadlyjack
deadlyjack deleted the fix/readonly-quicktools branch August 14, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant