Letrec. index in stdlib. fixing NaNs when measuring things without gaps, w or h. more window management stuff in OS

This commit is contained in:
Dustin Swan 2026-02-12 17:26:55 -07:00
parent db4abfa450
commit 5f592f40bf
No known key found for this signature in database
GPG key ID: 30D46587E2100467
5 changed files with 89 additions and 15 deletions

View file

@ -24,6 +24,7 @@ export function runAppCompiled(canvas: HTMLCanvasElement, store: any) {
function setFocus(componentKey: string | null) {
if (focusedComponentKey === componentKey) return;
const oldFocus = focusedComponentKey;
focusedComponentKey = componentKey;
@ -36,6 +37,15 @@ export function runAppCompiled(canvas: HTMLCanvasElement, store: any) {
if (componentKey && componentInstances.has(componentKey)) {
handleComponentEvent(componentKey, { _tag: 'Focused' });
}
// Notify ancestors
if (componentKey) {
for (const key of componentInstances.keys()) {
if (key !== componentKey && componentKey.startsWith(key + '.')) {
handleComponentEvent(key, { _tag: 'ChildFocused' });
}
}
}
}
function handleComponentEvent(componentKey: string, event: any) {