Everyone has the Notebooks chooser
From the development repository at 1ccf212. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
ba6791455b
commit
bc3c9bb886
6 files changed
+73
-25
No files matched your search
+15
-2
@@ -9,6 +9,8 @@
|
||||
* are covered too, since the listeners are on the document.
|
||||
*/
|
||||
|
||||
import { trace } from './log.js';
|
||||
|
||||
const DELAY_MS = 2000;
|
||||
const GAP_PX = 6;
|
||||
|
||||
@@ -55,6 +57,9 @@ function hide() {
|
||||
}
|
||||
|
||||
export function enableTooltips() {
|
||||
// Traced into the Session window's log (2026-10-11: Andy's Wacom pen
|
||||
// hovering over a button on Hollis showed no tooltip, and the log is
|
||||
// the way to see what the browser delivers for a hovering pen).
|
||||
document.addEventListener('pointerover', (event) => {
|
||||
const element = helpElement(event.target);
|
||||
if (!element) {
|
||||
@@ -63,9 +68,17 @@ export function enableTooltips() {
|
||||
}
|
||||
if (element === shownFor) return;
|
||||
hide();
|
||||
timer = setTimeout(() => { timer = null; show(element); }, DELAY_MS);
|
||||
trace(`Hover: ${event.pointerType} over ${element.textContent?.trim() || element.id}`);
|
||||
timer = setTimeout(() => {
|
||||
timer = null;
|
||||
trace(`Tooltip: ${element.textContent?.trim() || element.id}`);
|
||||
show(element);
|
||||
}, DELAY_MS);
|
||||
});
|
||||
document.addEventListener('pointerleave', (event) => {
|
||||
if (timer !== null || shownFor) trace(`Hover: ${event.pointerType} left the document`);
|
||||
hide();
|
||||
});
|
||||
document.addEventListener('pointerleave', hide);
|
||||
// Focus that comes from a click brings no tooltip: the user is already
|
||||
// acting on the element, and a list it opens would be covered (Andy,
|
||||
// 2026-10-07, the notebook list). Focus from the keyboard does.
|
||||
|
||||
Reference in new issue
Block a user