fix(webapp): the wiki editor's [[ menu opens at the caret (#1261) #1262

Closed
claude-bot wants to merge 0 commits from fix/1261-editor-link-menu into main
Collaborator

Closes #1261. For v4.6.2.

The [[ link menu (.ed-ac) stood at a fixed spot under the text box's top edge. On any page with text it covered the first lines and the link being typed (the owner's screenshot: [[Vel on line 2, with the menu over line 1).

  • src/wiki/caretPoint.js: the caret's pixel position in a textarea, measured with a hidden mirror that has the same box, font and wrapping. Returns null where there is no layout.
  • EditorPane: in a layout effect (and on the text box's scroll), the menu goes 4px under the caret's line, is clamped inside the pane, and flips above the line when there isn't room below. With null, the stylesheet's old place stands, which is also what jsdom gets.
  • Test EditorPane.linkmenu.test.jsx stubs caretPoint and the box sizes and checks below, clamp, flip and the null fallback. Two of its three tests fail on the old code. Editor.test.jsx and EditorPane.bringin.test.jsx still pass (51 tests). eslint: no errors.

Not verified in a real browser. No browser is available in this session. The rc on dev is where to see it, since the mirror measurement is the part jsdom can't exercise.

🤖 Generated with Claude Code

Closes #1261. For **v4.6.2**. The `[[` link menu (`.ed-ac`) stood at a fixed spot under the text box's top edge. On any page with text it covered the first lines and the link being typed (the owner's screenshot: `[[Vel` on line 2, with the menu over line 1). - `src/wiki/caretPoint.js`: the caret's pixel position in a textarea, measured with a hidden mirror that has the same box, font and wrapping. Returns `null` where there is no layout. - `EditorPane`: in a layout effect (and on the text box's scroll), the menu goes 4px under the caret's line, is clamped inside the pane, and flips above the line when there isn't room below. With `null`, the stylesheet's old place stands, which is also what jsdom gets. - Test `EditorPane.linkmenu.test.jsx` stubs `caretPoint` and the box sizes and checks below, clamp, flip and the null fallback. Two of its three tests fail on the old code. `Editor.test.jsx` and `EditorPane.bringin.test.jsx` still pass (51 tests). eslint: no errors. **Not verified in a real browser.** No browser is available in this session. The rc on dev is where to see it, since the mirror measurement is the part jsdom can't exercise. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(webapp): the wiki editor's [[ menu opens at the caret (#1261)
All checks were successful
CI / Bot/backend version sync (pull_request) Successful in 23s
CI / Backend lint (ruff) (pull_request) Successful in 31s
CI / Which journeys does this change need? (pull_request) Successful in 18s
CI / Does this change touch the recording path? (pull_request) Successful in 18s
CI / Feedback site tests (pull_request) Successful in 44s
CI / Synthetic session harness (no GPU, no LLM) (pull_request) Has been skipped
CI / Summarisation accuracy eval harness (stub provider) (pull_request) Successful in 1m4s
CI / Bot tests and audit (pull_request) Successful in 2m8s
CI / Docker image build (pull_request) Successful in 4m47s
CI / Frontend (shard 2/2) (pull_request) Successful in 7m41s
CI / Frontend (shard 1/2) (pull_request) Successful in 9m15s
CI / End-to-end journeys (desktop) (pull_request) Successful in 13m26s
CI / Backend migration, tests, and audit (pull_request) Successful in 32m46s
884d962130
.ed-ac stood at a fixed spot under the text box's top edge, so on a page
with text it covered the first lines and the link being typed. caretPoint()
measures the caret with a hidden mirror of the textarea, and EditorPane
places the menu under that line, inside the pane, flipping above the line
when there is no room below and following the box as it scrolls. Where
nothing can be measured the stylesheet's place stands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Collaborator

Closing as landed. This branch has no commits that aren't on main: src/wiki/caretPoint.js and EditorPane.linkmenu.test.jsx are in main, they reached it with 4.6.2, and #1261 is closed.

Closing as landed. This branch has no commits that aren't on main: `src/wiki/caretPoint.js` and `EditorPane.linkmenu.test.jsx` are in main, they reached it with 4.6.2, and #1261 is closed.
claude-bot closed this pull request 2026-11-05 18:31:57 +00:00
All checks were successful
CI / Bot/backend version sync (pull_request) Successful in 23s
Required
Details
CI / Backend lint (ruff) (pull_request) Successful in 31s
Required
Details
CI / Which journeys does this change need? (pull_request) Successful in 18s
Required
Details
CI / Does this change touch the recording path? (pull_request) Successful in 18s
Required
Details
CI / Feedback site tests (pull_request) Successful in 44s
Required
Details
CI / Synthetic session harness (no GPU, no LLM) (pull_request) Has been skipped
Required
Details
CI / Summarisation accuracy eval harness (stub provider) (pull_request) Successful in 1m4s
Required
Details
CI / Bot tests and audit (pull_request) Successful in 2m8s
Required
Details
CI / Docker image build (pull_request) Successful in 4m47s
Required
Details
CI / Frontend (shard 2/2) (pull_request) Successful in 7m41s
Required
Details
CI / Frontend (shard 1/2) (pull_request) Successful in 9m15s
Required
Details
CI / End-to-end journeys (desktop) (pull_request) Successful in 13m26s
Required
Details
CI / Backend migration, tests, and audit (pull_request) Successful in 32m46s
Required
Details

Pull request closed

Sign in to join this conversation.
No description provided.