Root cause: xterm.js attaches its own pointerdown handler inside the
terminal and calls e.stopPropagation(), which prevents the .leaf
div's onpointerdown from firing for any click landing inside the
terminal body. That's why clicking pane bodies never moved the blue
active border — the event simply never reached our handler.
Fix: register a document-level CAPTURE-phase pointerdown listener
in App.svelte. Capture fires before xterm.js's bubble-phase handler
runs (and before it can stop propagation), so we always see the
click. The handler walks up via Element.closest('[data-leaf-id]')
to find which pane was clicked, then calls orch.setActive.
- LeafPane.svelte: add data-leaf-id={leaf.id} attribute so the
document handler can identify the clicked pane.
- App.svelte: $effect attaches document.addEventListener('pointerdown',
..., true) and cleans up on teardown.
- Keep the per-leaf onpointerdown as a redundant backup for clicks
on toolbar buttons (which sit outside the xterm subtree). Cheap
+ idempotent.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
20 lines
2.3 KiB
Text
20 lines
2.3 KiB
Text
node.exe : $ tauri "dev"
|
||
At C:\Program Files\nodejs\pnpm.ps1:16 char:5
|
||
+ & "$basedir/node$exe" "$basedir/node_modules/corepack/dist/pnpm. ...
|
||
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||
+ CategoryInfo : NotSpecified: ($ tauri "dev":String) [], RemoteException
|
||
+ FullyQualifiedErrorId : NativeCommandError
|
||
|
||
Running BeforeDevCommand (`pnpm dev`)
|
||
$ vite
|
||
|
||
[32m[1mVITE[22m v5.4.21[39m [2mready in [0m[1m482[22m[2m[0m ms[22m
|
||
|
||
[32mÔ×£[39m [1mLocal[22m: [36mhttp://127.0.0.1:[1m1420[22m/[39m
|
||
Running DevCommand (`cargo run --no-default-features --color always --`)
|
||
Info Watching D:\dev\tiletopia\src-tauri for changes...
|
||
[1m[92m Finished[0m `dev` profile [unoptimized + debuginfo] target(s) in 0.28s
|
||
[1m[92m Running[0m `target\debug\tiletopia.exe`
|
||
[2m14:34:16[22m [36m[1m[vite][22m[39m [32mhmr update [39m[2m/src/App.svelte[22m
|
||
[2m14:34:25[22m [36m[1m[vite][22m[39m [32mhmr update [39m[2m/src/App.svelte[22m
|
||
[2m14:34:29[22m [36m[1m[vite][22m[39m [32mhmr update [39m[2m/src/lib/layout/LeafPane.svelte[22m
|