style(dm): redesign dashboard with purple-gold theme

Redesign DM Dashboard (/dm/, /ru/dm/) with purple-gold theme (#534AB7 + #c8a84b):

Design System:
- Update dm-theme.css with 49 purple-gold tokens (transitions, shadows, hover states)
- Create DmTabs.astro with ARIA, keyboard nav, URL hash sync, localStorage persistence
- Create DmSidebar.astro for desktop navigation
- Redesign DmHeader with gold accent
- Update DmButton, DmCard, DmInput primitives
- Expand i18n to 47 strings

Layout:
- Redesign DmLayout with 3-column dashboard grid (sidebar|main|context)
- Update /dm/index.astro and /ru/dm/index.astro with named slots

Feature Components:
- DiceRoller: empty state, ARIA live, color-coded history, storage key fallback
- InitiativeTracker: HP editing, active highlighting, storage key fallback
- Open5eReference: skeletons, debounce, error retry, gold tabs
- NotesPanel: cross-tab sync, copy-to-clipboard, auto-save
- AuthPanel: VK/Yandex brand colors, pill buttons

Tests:
- Add 50 Playwright E2E tests (smoke, dice, initiative, reference, notes, data-migration)

Fixes:
- Document Open5e client.ts URL bugfix
- Add backward-compatible storage key fallback for dice/initiative
- Preserve legacy sessionStorage data on load
This commit is contained in:
emil
2026-05-15 17:49:32 +03:00
parent 11da171bfb
commit 1c38df7e74
113 changed files with 5651 additions and 596 deletions
+41
View File
@@ -0,0 +1,41 @@
# T18 — Data Migration Verification
## Test Setup
- Pre-populated `sessionStorage` with old-format dice history and initiative data.
- Pre-populated `localStorage` with old-format notes.
- Ran Playwright tests against `/dm/#dice`, `/dm/#initiative`, `/dm/#notes` on both desktop and mobile viewports.
## Results
### Dice History (`dm-dice-history`)
**Status:** INCOMPATIBLE
- Old format uses `result` instead of `total` and omits `rolls`.
- `renderHistory()` calls `entry.rolls.includes(20)`, which throws when `rolls` is undefined.
- The uncaught exception aborts rendering, leaving the history list empty.
- **Evidence:** Playwright test confirms empty state is visible and 0 history items rendered.
### Initiative Tracker (`dm-initiative`)
**Status:** PARTIALLY COMPATIBLE
- Old format stores `name`, `modifier`, `initiative`, `active` but lacks `id` and `hp`.
- The list renders correctly (name and initiative score display).
- **Broken:** Delete button does nothing because `deleteCombatant()` cannot match a missing `id`.
- **Evidence:** Playwright test confirms the combatant renders and survives a delete click.
### Notes (`dm-notes`)
**Status:** FULLY COMPATIBLE
- Old format stores a plain string; new `loadNotes()` reads the same key unchanged.
- Textarea populates correctly from `localStorage`.
- **Evidence:** Playwright test confirms textarea value matches old data.
## Summary
| Feature | Compatibility |
|---------|---------------|
| Dice history | Broken — missing `total`/`rolls` fields cause JS error |
| Initiative | Loads but delete is broken due to missing `id` |
| Notes | Fully compatible |
## Commands Run
```bash
npx playwright test tests/dm/data-migration.spec.ts
```
All 6 tests passed (3 scenarios × 2 viewports).