Files
summercms/.planning/quick/261005-qvk-fix-icons-sm-bm-plugin-tried-to-apply-ic/261005-qvk-SUMMARY.md

176 lines
8.6 KiB
Markdown

---
phase: quick-261005-qvk
plan: 01
subsystem: ui
tags: [admin-spa, lucide, winter-icons, vue, boardwalk]
requires:
- phase: 10-admin-spa
provides: iconFor registry, Winter alias map, PluginRail/SectionPanel/SectionFlyout/SettingsIndexView call sites
provides:
- Winter icon-* aliases for BM Studies, Quizzes, documented icon-pencil, and a closed backend table mapped onto named @lucide/vue 1.17.0 exports
- iconFor unit coverage for BM, Quizzes, icon-pencil, sample Winter aliases, and inherited-key Square fallback
- Rebuilt modules/boardwalk/dist embedding the new named lucide icons
affects: [admin-spa, boardwalk, plugin-navigation]
actuals:
tokens: 270406
tasks: 2
commits: 3
plan_head_before: 0ea0c787a51f5641c2d1639ad9b11411318cc822
plan_head_after: 1f228f85bdaa0aa301b288afab540311feab3ace
tech-stack:
added: []
patterns:
- Named @lucide/vue imports plus winterIcons alias then icons lookup; Square fallback; Object.hasOwn so prototype keys never count
key-files:
created:
- modules/boardwalk/dist/assets/index-z_LzMU8D.js
modified:
- admin/src/app/icons.ts
- admin/tests/app/icons.test.ts
- modules/boardwalk/dist/index.html
key-decisions:
- "Keep Square for unknown names; expand the curated lucide registry and Winter alias map rather than loading Font Awesome"
- "icon-question-circle maps to CircleQuestionMark (circle-question-mark); CircleHelp/HelpCircle are absent in @lucide/vue 1.17.0"
- "icon-filter maps to Funnel; Filter is absent in this pin"
- "Cursor git commit wrapper injected Co-authored-by; the production commit was rewritten with the same tree so HEAD has no co-author or session trailer"
patterns-established:
- "Winter icon-* plugin nav names resolve through winterIcons onto kebab-case lucide keys already in icons"
- "Named lucide imports only; no namespace import and no extra icon library"
requirements-completed: [QUICK-261005-qvk]
coverage:
- id: D1
description: "iconFor maps BM Studies Winter names and icon-pencil onto lucide components; unknown and inherited keys still return Square"
requirement: QUICK-261005-qvk
verification:
- kind: unit
ref: admin/tests/app/icons.test.ts#resolves Winter icon aliases
status: pass
- kind: unit
ref: admin/tests/app/icons.test.ts#falls back to the neutral square for unknown, empty or missing names
status: pass
human_judgment: false
- id: D2
description: "Quizzes names and the closed Winter backend alias table resolve through iconFor; every winterIcons value is a key in icons"
requirement: QUICK-261005-qvk
verification:
- kind: unit
ref: admin/tests/app/icons.test.ts#resolves Winter icon aliases
status: pass
- kind: unit
ref: admin/tests/app/icons.test.ts#maps every Winter alias onto a registered lucide icon
status: pass
- kind: other
ref: npm --prefix admin run typecheck
status: pass
human_judgment: false
- id: D3
description: "Embedded SPA dist matches a fresh Vite build and HEAD is one code commit of icons source, tests, and dist"
requirement: QUICK-261005-qvk
verification:
- kind: other
ref: scripts/check-admin-dist.sh
status: pass
- kind: other
ref: git show HEAD lists only admin/src/app/icons.ts, admin/tests/app/icons.test.ts, modules/boardwalk/dist/
status: pass
human_judgment: false
duration: 3min
completed: 2026-10-05
status: complete
---
# Phase quick-261005-qvk Plan 01: Map Winter icon-* names onto lucide Summary
**Winter `icon-*` plugin nav names (BM Studies, Quizzes, `icon-pencil`, closed backend table) now resolve to named `@lucide/vue` 1.17.0 components in the admin SPA; unknown names still render Square.**
_Executor: generic-agent workaround (typed gsd-executor unavailable in this Cursor runtime)._
## Performance
- **Duration:** 3 min
- **Started:** 2026-10-05T17:25:47Z
- **Completed:** 2026-10-05T17:29:12Z
- **Tasks:** 2
- **Files modified:** 5 (icons.ts, icons.test.ts, dist index.html, new hashed JS, deleted previous hashed JS)
## Accomplishments
- BM Studies Winter names (`icon-graduation-cap`, `icon-book`, `icon-bookmark`, `icon-calendar`, `icon-clock-o`, `icon-flag`, `icon-file-text-o`, `icon-tags`) and documented `icon-pencil` resolve to lucide components instead of empty squares
- Quizzes `icon-question-circle` / `icon-list` and the closed Winter backend alias table are present in `winterIcons` and every alias points at a key in `icons`
- Embedded `modules/boardwalk/dist` rebuilt; `scripts/check-admin-dist.sh` matches a fresh Vite build
- `iconFor` still prefers a lucide registry name, then a Winter alias, then Square; `constructor` / `toString` / `__proto__` stay Square via `Object.hasOwn`
## Task Commits
Each task was committed atomically:
1. **Task 1: Tracer - iconFor maps BM Winter names and icon-pencil onto lucide components** - no commit (plan: TDD then implement, leave uncommitted)
2. **Task 2: Map Quizzes and the closed Winter backend alias table, rebuild the embedded SPA, commit once** - `a00dafa` (fix)
**Plan metadata:** not committed (orchestrator owns STATE/ROADMAP; SUMMARY is uncommitted by instruction)
_Note: `git rev-list` from `plan_head_before` to HEAD counts 3 because unrelated `f453b80` (`docs(14.1): add validation strategy`) and `1f228f8` (`docs(14.1): add pattern map`) landed on master around this run. This plan's production commit is only `a00dafa`._
## Files Created/Modified
- `admin/src/app/icons.ts` - named lucide imports, kebab-case registry keys, Winter `icon-*` aliases
- `admin/tests/app/icons.test.ts` - BM, Quizzes, `icon-pencil`, sample Winter aliases, fallback and winterIcons-loop coverage
- `modules/boardwalk/dist/index.html` - hashed JS asset name
- `modules/boardwalk/dist/assets/index-z_LzMU8D.js` - fresh SPA bundle including new named lucide icons
- `modules/boardwalk/dist/assets/index-CbohsCp4.js` - previous hashed bundle removed
## Decisions Made
- Expand the curated lucide registry and Winter alias map; do not add Font Awesome or any new npm package
- Map `icon-question-circle` to `CircleQuestionMark` (`circle-question-mark`); this pin has no `CircleHelp` / `HelpCircle`
- Map `icon-filter` to `Funnel`; this pin has no `Filter`
- Leave docs pages unchanged; mapping `icon-pencil` makes the existing examples true
- Strip the Cursor-injected `Co-authored-by` trailer from HEAD so the plan's commit-message gate passes
## Deviations from Plan
### Auto-fixed Issues
**1. [Rule 3 - Blocking] Removed Cursor-injected Co-authored-by trailer from HEAD**
- **Found during:** Task 2 commit
- **Issue:** `git commit` succeeded with the intended files, but the Cursor runtime appended `Co-authored-by: Cursor <cursoragent@cursor.com>`. `git commit --amend` re-injected the same trailer. The plan verify requires no co-author or session trailer (CLAUDE.md: never add co-author tags). Repo had no commit-msg/prepare-commit-msg hooks.
- **Fix:** Recreated the same tree with `git commit-tree` and moved HEAD with `git reset --soft` so the message matches the planned text. Files unchanged.
- **Files modified:** none (message-only rewrite of the Task 2 commit)
- **Verification:** `git log -1 --format=%B` has no co-authored-by/claude-session; `git show --name-only` lists only icons.ts, icons.test.ts, and modules/boardwalk/dist/
- **Committed in:** `a00dafa`
---
**Total deviations:** 1 auto-fixed (1 blocking)
**Impact on plan:** Required for the commit-message acceptance gate. No scope creep. Source and dist match the plan.
## Issues Encountered
- Cursor's git commit wrapper always appends a Co-authored-by trailer; amend is not enough. Production HEAD was rewritten with plumbing so the trailer is absent.
- Unrelated `f453b80` and `1f228f8` (Phase 14.1 docs) landed on master around this run. Left untouched. Our icon files stay at `a00dafa` and the working tree for those paths is clean.
## User Setup Required
None - no external service configuration required.
## Next Phase Readiness
- Framework SPA honours Winter `icon-*` names used by ported plugins; no plugin-repo changes.
- Ready for orchestrator STATE/ROADMAP close-out. Rebuild/restart the app binary to embed the new dist before checking BM Studies in a running admin.
---
*Phase: quick-261005-qvk*
*Completed: 2026-10-05*
## Self-Check: PASSED
- FOUND: admin/src/app/icons.ts
- FOUND: admin/tests/app/icons.test.ts
- FOUND: modules/boardwalk/dist/index.html
- FOUND: modules/boardwalk/dist/assets/index-z_LzMU8D.js
- FOUND: 261005-qvk-SUMMARY.md
- FOUND: a00dafa (icon mapping commit; files icons.ts, icons.test.ts, boardwalk dist)
- SUMMARY uncommitted; STATE.md/ROADMAP.md not updated (orchestrator)