refactor(lib): move generic hooks, DnD engine, shortcut contract to lib

Continue M4 lib/ de-flattening with domain-agnostic infra:
- lib/hooks/: 9 pure generic hooks (useDebouncedValue, useIsMobile,
  useLongPressAction, useRangeSelection, useResizeClientHeight,
  useWindowVisibility, useSystemPrefersDark, useVirtualizerScrollMargin,
  useRemeasureGridVirtualizer) — all PURE (only react/zustand/tanstack deps).
- lib/dnd/DragDropContext.tsx: the generic mouse-event DnD engine (WebKitGTK
  HTML5-DnD workaround, ~24 importers, self-contained) — empties src/contexts/.
- lib/shortcuts/: shortcutActions + shortcutTypes (the action-id + binding
  contract; registry/dispatch/bindings stay app-level and import the contract,
  app->lib direction).

useWindowFullscreenState deliberately NOT moved — kept in hooks/ as app-shell
per the handoff iron-rule list (overrides its pure-helper appearance).

Pure move via deep @/lib/* specifiers. tsc 0, lint 0/0, full suite 319 files /
2353 tests green.
This commit is contained in:
Psychotoxical
2026-06-30 08:20:11 +02:00
parent 209dd61442
commit 7ad196711e
74 changed files with 78 additions and 78 deletions
@@ -1,5 +1,5 @@
import React from 'react';
import { useDragSource } from '@/contexts/DragDropContext';
import { useDragSource } from '@/lib/dnd/DragDropContext';
import type { NpCardId } from '@/features/nowPlaying/store/nowPlayingLayoutStore';
interface NpCardWrapProps {
+1 -1
View File
@@ -13,7 +13,7 @@ import { useAuthStore } from '@/store/authStore';
import { useLyricsStore } from '@/store/lyricsStore';
import { songToTrack } from '@/utils/playback/songToTrack';
import { useRadioMetadata } from '@/features/radio';
import { useDragDrop } from '@/contexts/DragDropContext';
import { useDragDrop } from '@/lib/dnd/DragDropContext';
import OverlayScrollArea from '@/ui/OverlayScrollArea';
import {
useNpLayoutStore, NP_CARD_IDS,