Commit graph

3 commits

Author SHA1 Message Date
suryo12
d571cb23fa refactor(web): use last-seen-tick comparison for slideout listener
Replace the boolean "skip first render" ref with a ref that stores the
previously-seen tick value. The effect now compares against the stored
value and only fires when it differs, which makes the dependency
naturally used (removes the `void slideoutOpenedTick;` acknowledgement)
and self-documents the intent of the guard.

Behavior is unchanged — both forms preserve the one-shot-per-event
semantics of the prior window-event implementation. The JSDoc on
`slideoutOpenedTickAtom` is updated to describe the new pattern.
2026-05-24 18:13:36 +07:00
suryo12
ddae506631 refactor(web): replace slideout panel window event with jotai atom (fixes #1358)
Replace the `SLIDEOUT_PANEL_OPENED_EVENT` window event with a
`slideoutOpenedTickAtom` jotai atom. The dispatcher in
`SidebarSlideOutPanel` now bumps the tick via `useSetAtom`, and the
listener in `Thread` reads it via `useAtomValue` and reacts on change
behind a ref guard that skips the initial render — preserving the
one-shot-per-open semantics of the previous event.

This removes the implicit cross-module string contract, makes the
signal traceable through React DevTools / jotai inspector, and lets
TypeScript catch typos that the string-based event API silently
swallowed.
2026-05-24 16:41:47 +07:00
Oscar Zhou
d37417cbe9 refactor: move pure utility functions out of UI components (#1194) 2026-04-14 17:39:11 +09:30