Skip to content

Hooks & React 19

Custom Hooks (hooks/)

HookPurpose
useSakuraNavOrchestratorOrchestrator Hook (Composition Root), integrates all hook calls, state management and effects, provides data to the application-level Context
useThemeTheme switching and appearance config
useSiteListSite list management (paginated loading, infinite scroll)
useAppearanceAppearance config management
useDragSortDrag & drop sorting (tags/sites)
useSearchBarSearch bar state management (engine switching, suggestions, AI recommendations)
useSearchEngineConfigCustom search engine config (localStorage persisted)
useAiRecommendAI smart recommendations
useToastNotifyToast notifications (works with undo stack)
useUndoStackOperation undo stack (push/pop/clear, works with Ctrl+Z and Toast)
useConfigActionsConfig import/export/reset operations, AI bookmark analysis import
useCardTagEditorSite tag editor (includes undo logic for create/edit/delete)
useSiteNameSite name management
useOnlineCheckBatch online check (manual trigger, refreshes page state via syncNavigationData())
useEditorConsoleEditor console (batch manage tags and sites)
useTagDeleteTag deletion (normal tag three-option confirmation + social tag dedicated dialog)
useSocialCardsSocial card management (CRUD, click behavior, in-place refresh via updateSiteInCache after edit)
useNoteCardsNote card management (CRUD, view dialog checkbox interaction, attachment delayed persistence)
useSwitchUserUser switching (persisted list, dialog state)
useSessionExpiredSession expiry detection and dialog management (SSR detection, API 401 interception)
useSnapshotsSnapshot management (create/list/restore/delete/rename + edit mode tracking + page unload sendBeacon save)

React 19 Features

FeatureUsage LocationDescription
useEffectEventuse-site-list.ts, use-appearance.tsSafely reference latest state inside Effects
useTransitionPage switchingLow-priority transitions
React Compilernext.config.tsreactCompiler: true, automatic component memoization