atagen

malice

public
Star0
Watch0

Commit 8e8f1cef327b

tarball

atagen <boss@atagen.co>2026-10-25 09:09 UTC

2 files changed+24-0
web: hide the pointer while typing

The pointer sat over the composer and timeline while writing. Moving or clicking brings it back. Movement is checked because Chrome sends zero-delta pointermove events when layout shifts under a still pointer, which would unhide it as the composer grows.
Modified file: web/src/App.svelte+22 additions
@@ -363,17 +363,39 @@
363363 }
364364 }
365365
366+ function isEditable(target: EventTarget | null): boolean {
367+ if (!(target instanceof HTMLElement)) return false;
368+ return target instanceof HTMLTextAreaElement || target instanceof HTMLInputElement || target.isContentEditable;
369+ }
370+
366371 onMount(() => {
367372 const onPopState = () => void restoreRoute();
368373 const onAttention = () => queueReadReceipt();
374+ const hidePointer = (e: KeyboardEvent) => {
375+ if (e.ctrlKey || e.metaKey || e.altKey || !isEditable(e.target)) return;
376+ if (e.key.length === 1 || e.key === 'Backspace' || e.key === 'Delete' || e.key === 'Enter') {
377+ document.documentElement.classList.add('pointer-hidden');
378+ }
379+ };
380+ const showPointer = () => document.documentElement.classList.remove('pointer-hidden');
381+ const movePointer = (e: PointerEvent) => {
382+ if (e.movementX !== 0 || e.movementY !== 0) showPointer();
383+ };
369384 window.addEventListener('popstate', onPopState);
370385 window.addEventListener('focus', onAttention);
371386 document.addEventListener('visibilitychange', onAttention);
387+ window.addEventListener('keydown', hidePointer, true);
388+ window.addEventListener('pointermove', movePointer);
389+ window.addEventListener('pointerdown', showPointer);
372390 void boot();
373391 return () => {
374392 window.removeEventListener('popstate', onPopState);
375393 window.removeEventListener('focus', onAttention);
376394 document.removeEventListener('visibilitychange', onAttention);
395+ window.removeEventListener('keydown', hidePointer, true);
396+ window.removeEventListener('pointermove', movePointer);
397+ window.removeEventListener('pointerdown', showPointer);
398+ showPointer();
377399 disconnectEvents();
378400 stopTyping();
379401 if (readTimer !== null) window.clearTimeout(readTimer);
Modified file: web/src/app.css+2 additions
@@ -154,6 +154,8 @@ html, body, #app {
154154 :root { --pop: 0s; }
155155 }
156156
157+html.pointer-hidden, html.pointer-hidden * { cursor: none !important; }
158+
157159 body {
158160 background: var(--bg);
159161 color: var(--text);