Skip to content

fix(renderer-vecto): split panes re-layout on box change + Vim floor click mapping#8

Merged
Xuepoo merged 2 commits into
mainfrom
fix/interaction-audit
Jul 16, 2026
Merged

fix(renderer-vecto): split panes re-layout on box change + Vim floor click mapping#8
Xuepoo merged 2 commits into
mainfrom
fix/interaction-audit

Conversation

@Xuepoo

@Xuepoo Xuepoo commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Fixes the two vem-side renderer bugs from the 2026-07-16 interaction audit (vem-docs/reports/2026-07-16-interaction-audit.md):

  • Split panes never re-laid out after :vsp/:sp: WorkspaceLayout.update() wrote layoutRoot.width/height bare, and a PanelGroup does not redistribute on bare writes — opening the Explorer/PluginLab or resizing the window left panes at stale sizes overflowing off-screen (devtools audit: "EditorPane escapes Panel by right 549px"). Now calls PanelGroup.resize() when the box actually changed; leaf panes keep the cheap direct write.
  • Clicks landed one cell right on a character's right half: the x→column mapping used Math.round; Vim mouse=a puts the cursor on the cell containing the pointer. Now Math.floor, clamped at 0 (left-padding clicks).

Tests: new WorkspaceLayout redistribute case + two click-mapping cases (all failed before the fix); one legacy pointer test updated — its coordinate sat inside cell 3 and only mapped to 4 through the old rounding. Full suite: 181 pass. oxlint --deny-warnings and repo prettier clean.

Changeset: @vemjs/renderer-vecto patch (bundles with the pending keydown-double-input changeset).

🤖 Generated with Claude Code

Xuepoo and others added 2 commits July 14, 2026 08:04
VemEditorEntity's keydown handler already fed every non-composing key to
handleKey() unconditionally, but only called preventDefault() for a
whitelist of navigation/control keys — letters, digits, punctuation,
Enter, and Delete were left unprevented. That let the keystroke also
reach the focused a11y shadow <textarea> natively, mutating its .value
and firing the 'change' handler added for IME support, redelivering the
same character a second time once the mode had already flipped to
INSERT. Repeated/held 'a' compounded on every press for the same reason.

preventDefault() now covers every single printable character plus
Enter/Delete, so the shadow textarea's 'change' event is reserved for
genuine IME composition commits only.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
…lick mapping

Two interaction-audit findings (vem-docs reports/2026-07-16-interaction-audit.md):

- WorkspaceLayout.update() wrote layoutRoot width/height bare; a PanelGroup
  never redistributes on bare writes, so :vsp/:sp panes kept stale sizes and
  overflowed off-screen when the Explorer/PluginLab opened or the window
  resized. It now calls PanelGroup.resize() when the box actually changed.
- cellAt used Math.round for the x->column mapping, sending clicks on a
  character's right half one cell right. Vim mouse=a puts the cursor on the
  cell containing the pointer: floor, clamped at 0.

Co-Authored-By: Claude Fable 5 <[email protected]>
@Xuepoo Xuepoo merged commit b361f5b into main Jul 16, 2026
1 check passed
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