mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-10 23:47:12 +02:00
f1ba39a65ec5fe02075717704b2958886327bdc2
Problem: - Saving active spellbooks was creating duplicates each time - No deduplication logic for spellbooks with same slug + pubkey Solution: - Add findExistingSpellbook() to match by slug and pubkey - Update saveSpellbook() to detect and update existing spellbooks: * For local-only: match by slug (no pubkey) * For published: match by slug AND pubkey * For updates: use provided ID - SaveSpellbookDialog now passes existing ID in update mode Testing: - Added comprehensive spellbook-storage.test.ts - Tests verify deduplication logic (requires jsdom environment) - Existing tests still pass (14/14 for publish-spellbook) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Languages
TypeScript
98.9%
CSS
0.8%
JavaScript
0.3%