From 2e3ffbb7cd7337f7fa9adaf5304e25f6605df6f3 Mon Sep 17 00:00:00 2001 From: Tyler Hallada Date: Tue, 17 Nov 2026 16:11:24 -0500 Subject: [PATCH] Mouse layer: one helper per repeated pointer lookup, dead hooks and options out MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - A click (App) and a right-click or ⋯ (Mouse focusAt) each worked out the pane under the pointer, its article host and the words dragged over; they share pointedPane, dragged and wtextRow now. - The page's Act lives with the menus that use it (Mouse.tsx), so actions.ts is the pure builders its header says it is. - App's key handler: one openCommand for the prompt hook and the key handler, dropPopup instead of a copy of it, closeMenu without the menuShown check it makes itself. - Gone: the "page" menu place (it took the same branches as "auto"), Key's shift prop and the arrow keys' text (never passed), isFirstRun, HistoryPanel's lastType (implied by the set of heads), and DOM attributes nothing reads (data-libs-trigger, data-conflict, data-popup, data-source, lib-new). Exports used only in their file are not exported. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_014yB6q4BHMwptTX3YFtkRab --- src/ui/App.tsx | 60 ++++++++++----------------- src/ui/Menu.tsx | 9 ++-- src/ui/Mouse.tsx | 102 +++++++++++++++++++++++++++++++--------------- src/ui/actions.ts | 33 +-------------- src/ui/keys.ts | 3 +- src/ui/usage.ts | 2 +- 6 files changed, 99 insertions(+), 110 deletions(-) diff --git a/src/ui/App.tsx b/src/ui/App.tsx index 6eeb384..272ab3b 100644 --- a/src/ui/App.tsx +++ b/src/ui/App.tsx @@ -10,10 +10,10 @@ import { LinkCard, LinkPicker, LinksPanel, NodeBacklinks, NodeRelated, TargetRow import { NodeBody, Outline, PendingSections, TopMatter } from "./Node"; import { Panes } from "./Panes"; import { PaneMap, Trail } from "./Pages"; -import { PANES_MIN_WIDTH, store, type Aux, type WRow } from "./store"; +import { PANES_MIN_WIDTH, store, type Aux } from "./store"; import { WikiPage, WikiView } from "./Wiki"; import { Usage } from "./Usage"; -import { FirstRun, Hints, Key, MenuHost, SelBar, closeMenu, hideBar, locate, locateIn, menuAt, menuShown, setCard, setPrompt, showBar, touch, type Hint } from "./Mouse"; +import { FirstRun, Hints, Key, MenuHost, SelBar, closeMenu, dragged, hideBar, locate, locateIn, menuAt, pointedPane, setCard, setPrompt, showBar, touch, wtextRow, type Hint } from "./Mouse"; import { press } from "./press"; function Page() { @@ -45,7 +45,7 @@ function ConflictCard({ c, selected }: { c: Conflict; selected: boolean }) { const kind = { "edit-edit": "both sides rewrote this", "edit-delete": "edited on one side, deleted on the other", contradiction: "contradicts another node" }[c.type]; const other = c.other && store.snap.nodes[c.other] ? label(store.snap, c.other) : null; return ( -
+
{c.title || "(untitled)"} {c.status} @@ -95,14 +95,13 @@ function HistoryPanel({ verdict }: { verdict: string }) { ref.current?.querySelector(".selected")?.scrollIntoView({ block: "nearest" }); }); const heads = new Set(); - let lastType = ""; const live = store.doc.snap(); const filter = store.historyFilter && live.nodes[store.historyFilter] ? store.historyFilter : null; const onRoot = isLibraryRoot(live, store.activeNode); return (