Tags: zion-off/giggles
Tags
perf(code-block): memoize Prism tokenization and token color merge Both Prism.tokenize() and the defaultTokenColors spread ran unconditionally on every render. Wrap colors in useMemo keyed on tokenColors, and content in useMemo keyed on children/grammar/colors, so re-tokenization is skipped when the code and language haven't changed.
refactor(ui): use TextInput in CommandPalette instead of reimplementi… …ng input Replace manual character/backspace handling and cursor rendering with TextInput. Navigation keys (up/down/enter/escape) bubble from TextInput to a parent FocusScope. Fixes cursor appearing at end of placeholder.
fix(focus): eliminate focus flash on mount by registering nodes durin… …g render Move node registration from useEffect to the render phase so that useSyncExternalStore's getSnapshot returns the correct hasFocus value on the first render. This eliminates the visible one-frame lag when opening collapsible sections or returning to router screens. - Register nodes silently during render (no subscriber notifications) - Flush deferred notifications in useLayoutEffect before paint - Extract passive-clearing into a shared helper for both silent and normal focus transitions - Track focusKey on FocusNode to handle key changes without destroying the node's children - Re-register in useLayoutEffect setup for React Strict Mode compat
fix(command-palette): make useKeybindingRegistry reactive Add version counter to FocusStore and subscribe via useSyncExternalStore so HintsBar updates on focus/node changes. Deduplicate available bindings by key to prevent duplicates from ancestor scopes.
PreviousNext