mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-11-10 21:07:03 +01:00
App.tsx owned the inventory as well as rendering it: resolving a shared link against this browser's storage at mount, deferring persistence until the visitor consents, clearing the URL fragment, and three mutators. Moved all of it to a useInventoryState hook (163) beside the existing useSolver. The two inline handlers that only set state became named keep/replace callbacks, so the view no longer touches setPersist or setSaved; Clear, Discard and onImport all go through replace. Coverage held at 100% -- totals moved 863/375/181/810 -> 864/375/182/811, exactly the one statement and one function that promoting the Keep handler adds. Branches unchanged, so nothing conditional left test reach. That was the metric that would have caught an over-large extraction here, since the hook has no dedicated test and rides on the four App test files. No kcd2_dice_solver file is over the 250-line cap now. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011w2Pj4Ek3ZNMQVYcFHgXDY |
||
|---|---|---|
| .. | ||
| contracts | ||
| evidence | ||
| memory | ||
| plans | ||
| sessions | ||
| specs | ||
| workflows | ||