Skip to content

feat(web): expand read-only Vim navigation - #1376

Open
hilander wants to merge 16 commits into
JetBrains:mainfrom
hilander:add-vim-editor-mode
Open

hilander wants to merge 16 commits into
JetBrains:mainfrom
hilander:add-vim-editor-mode

Conversation

@hilander

@hilander hilander commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Problem

ThinkRail's desktop Monaco source editor provided standard Monaco navigation only. Vim-oriented users lacked familiar motions, Visual selection, marks, jump history, and search while reviewing source files.

The source editor is intentionally read-only, so the feature must not turn source files into editable buffers.

Approach

Add a renderer-local, opt-in Vim controller around the existing desktop Monaco editor. Keep Vim disabled by default, preserve standard Monaco behavior while disabled, and expose only a narrow public hook so the web shell can toggle the focused editor from the command palette without coupling the renderer to shell internals.

The supported command set follows the high-value navigation subset documented by Vim and available in compact Linux Vim builds such as Debian vim.tiny. Mutation operators, registers, clipboard, Ex commands, undo/redo, macros, terminal behavior, and mobile Pierre rendering remain out of scope because the source surface is read-only.

Changes

  • Added Normal, Insert, and Visual modes with character, line, and block selection.
  • Added Vim tiny-style motions and viewport commands: word/line/character/bracket navigation, gg/G, H/M/L, zt/zz/zb, page movement, counts, marks, and jump history.
  • Added /, ?, n, Shift+N, *, and # search behavior.
  • Added visible Vim toggle and command-palette integration for the focused Monaco editor.
  • Added unit and browser coverage, README instructions, CHANGELOG.md, and durable spec updates.

Screenshots

Before: desktop Monaco source editor on the base branch, Vim control absent.

Vim mode before

After: same scenario and viewport with the Vim control enabled.

Vim mode after

Related issues

Closes #1373

Checklist

  • Fast gates pass: bun run lint, bun run typecheck, bun run test — bun run lint and targeted package typechecks pass; root bun run typecheck is blocked by installed Node v22.23.2 while the repository requires >=22.23.4; bun run test has unrelated baseline/environment failures (one UI IME scan, one web focus-indicator scan, and five server git/process tests).
  • E2E suite passes for app-affecting changes (bun run e2e)
  • Before/after screenshots are included for frontend changes, or marked not applicable
  • Relevant SPEC.md / top-level specs updated to reflect any boundary, contract, or behavior change
  • I have read the Contributing guide and agree to the Code of Conduct

@jetbrains-air jetbrains-air Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Requesting changes — please address the blocking inline findings.

hilander and others added 2 commits November 14, 2026 14:26
…etBrains#1370)

* feat(web): run tab layout actions from the palette and chords

Tab menu availability moves into one pure tabActions source that the context menu and a new Active tab palette group both read. New chords: Mod+Alt+W closes the active tab (Mod+W stays desktop-owned and display-only), Mod+\ splits right, Ctrl+Alt+Left/Right (Ctrl+Cmd on macOS) moves the tab to the adjacent group. Shift+F10 / Menu opens tab and rail menus. Chords can be platform-specific or display-only, and no Alt chord matches under AltGraph.

* feat(web): navigate the sidebar trees with the keyboard

Files, Changes, Specs, Chats and Projects share one DOM-driven tree model: one Tab stop per tree on the current row, arrows, Home/End, type-ahead, Enter and Mod+Enter, Shift+F10 for every row menu, Delete through the existing confirmations and F2 for project and workspace rename. The current row carries data-focus-default, so F6 and the focus chords land on it.

* fix(web): land a focus chord on the loaded tree, not the toolbar above its skeleton

* fix(web): land on the tree's current row and keep tree markup valid

A remembered treeitem or tab that stopped being its roving container's tab stop no longer wins the landing. Pointer-only row controls inside a tree are aria-hidden. The AltGraph guard applies only off Apple, where Firefox reports Option as AltGraph.

* fix(web): let Mod+Alt+W dismiss an open layer before closing the tab

@jetbrains-air jetbrains-air Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Requesting changes — please address the blocking inline findings.

This branch has not been deployed

No deployments
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.

Add optional read-only Vim navigation mode to Monaco source editor

2 participants