refactor(ui): the design system moves out — Kagaku.UI, shared by all Kagaku apps (ADR 0044) #197
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refactor/extract-kagaku-ui"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
src/Kagura.UIandtests/Kagura.UI.Testsleave the monorepo for TeamAI/Kagaku.UI — extracted with full git history (104 commits) — and come back as the third vendored submodule atexternal/Kagaku.UI,ProjectReference'd like the other org libraries (ADR 0004 pattern; decision recorded in ADR 0044).The rename follows the org, not the app
Namespace
Kagaku.UI, assets at_content/Kagaku.UI/, stylesheetkagaku-ui.css, JS interop globalskagaku*,data-kagaku-*attributes,kagaku-themestorage key. CSS classes and tokens were already unprefixed, so the surface change is exactly those seams — 52 app files touched mechanically.Ownership boundaries
Kagura.BlazorAdapter.Tests): it guards Kagura's icon literals against the now org-global catalog. Kagaku.UI runs the same scan over its own components.TreatWarningsAsErrors.Verification
kagakuThemeplumbing (stored underkagaku-theme; nothing writes the old key).df81a2c) is the pushed tip of Kagaku.UI's main, whose content byte-matches whatsrc/Kagura.UIheld on this repo's main.🤖 Generated with Claude Code
Summary
Summary
Coverage
Kagura.BlazorAdapter - 88.2%
Kagura.Domain - 96.3%
D04ADFED3A21D401C2764A1D17367E35BEB556CBB3B4B0B74__NonSlugChars_0
Kagura.Infrastructure - 97.9%
n
on
C689CA5BBE6D1849B2CA79581BBB07D40636D85790C0E51A9__ArtifactTimestampRegex_2
C689CA5BBE6D1849B2CA79581BBB07D40636D85790C0E51A9__ProjectRoute_0
C689CA5BBE6D1849B2CA79581BBB07D40636D85790C0E51A9__TabQuery_1
Kagura.Kernel - 90%
Kagura.Server - 83%
Kagura.UseCases - 95.9%
🔮 fufu~ Jibril reviewed your code!
Oh? Oh! Oh! ♪ A library graduating from the nest — 8,646 lines walking out the door and coming back as a tidy submodule pointer. Jibril is delighted, this is exactly how a mature design system leaves home! And you even brought it back with full git history (104 commits preserved), renamed the whole namespace after the org, and recorded the decision in a proper ADR. Wonderful~ ♡
I tore this PR apart looking for a broken seam — a
kagura*JS global the BlazorAdapter still calls that the submodule no longer exposes, a leftover_content/Kagura.UI/asset path that would 404 at runtime, adata-kagura-themeattribute the theme switcher can't find... fufu~ I found nothing. ♡ The rename is immaculate.Verdict: ✅ Looks good to me~
I verified locally (CI status absent for the head SHA): build 0 warnings / 0 errors (TreatWarningsAsErrors didn't trip the AngleSharp pin), 1,523 tests pass / 0 fail (653 + 564 + 306 — matches your claim exactly), and the relocated
IconCatalogCompletenessTests(both cases) pass, meaning the vendored catalog still resolves every icon literal in Kagura's source.✅ What I liked~
App.razorreadslocalStorage.getItem('kagaku-theme')and loads_content/Kagaku.UI/css/kagaku-ui.css+ 8kagaku*JS modules; the submodule'swwwroot/js/theme.jsdeclareswindow.kagakuTheme,KEY = "kagaku-theme",data-kagaku-themeattributes, and all interop globals (kagakuAssistant,kagakuAudio,kagakuOverlay,kagakuQuicklink,kagakuRegion,kagakuTitle) arekagaku*.AssistantPanel.razorandPlayerPage.razorcall the new names. Nothing writes the old key. Chef's kiss.Kagura.UI/kagura*references in runtime code. Grep oversrc/+external/Kagaku.UI/wwwroot/is clean — the onlyKagura.UImentions left are in historical docs (older ADRs 0003/0023/0030/0031 anddocs/stories/*), which is correct ADR hygiene: those record decisions made when the component was named that. ADR 0044 amends the list, and the living docs (ARCHITECTURE.md,PROJECT_PLAN.md,design-system.md) were updated. ♪LorePageTests,NovelAiSettingsSectionTests,TtsSettingsSectionTests,OutfitEditorPageTests,ConnectionsPanelTests) useAngleSharp.Dom.IElementdirectly — it was relying on bunit's transitivity. 1.4.0 carries GHSA-pgww-w46g-26qg andTreatWarningsAsErrorswould have turned the next fresh restore red. Explicit CPM pin at 1.5.0 closes the hole. Fufu~ you caught a security paper-cut hiding behind a "transitive" label~ ♡Markdigusages remain in app code; it's gone fromDirectory.Packages.propsand now lives inKagaku.UI.csproj. Clean divorce, no alimony.ci.ymlcorrectly extends to-Kagaku.UI*, matching the existingNovelAI.ImageGen*/OpenRouter.Net*exclusion pattern. No dilution.IconCatalogCompletenessTests.csmovedtests/Kagura.UI.Tests/→tests/Kagura.BlazorAdapter.Tests/, now scanssrc/againstKagaku.UI.IconCatalog, and both assertions pass (theThe_scan_actually_sees_the_source_it_claims_to_guardself-guard is the detail I love — it can't go green-for-wrong-reasons). Kagaku.UI carries its own copy for its components. ADR 0044's ownership split ("each repo scans its own literals") is realized exactly.df81a2cis the rename commit at Kagaku.UI's main tip;.gitmodulesuses the same relative-URL pattern as the other two vendored libs; theProjectReferencepath..\..\external\Kagaku.UI\src\Kagaku.UI\Kagaku.UI.csprojresolves and builds.Kagura.slnxcleanly drops both the library and its test project from the solution; no dangling references.💡 Little ideas (non-blocking)~
Directory.Packages.props:68— the comment says "Transitive of bunit", but given five test files now depend onAngleSharp.Domdirectly (not via a bunit facade), it's really a first-party test dependency that happens to also flow through bunit. Consider adjusting the comment to "Used directly by bunit-based component tests; also transitive of bunit — pinned at 1.5.0 to dodge GHSA-pgww-w46g-26qg." so a future reader doesn't think the pin is purely precautionary. Purely cosmetic. ♡This is a textbook extraction — disciplined seams, ADR-backed, security pin as a bonus catch, tests moved (not dropped), tripwires relocated (not duplicated). Meticulous work, scarlet~ ♡
Automated review by Jibril · 2026-07-21
CI/CD: absent for head SHA
4d3f5ac· Local checks: build clean (0/0), 1,523 tests pass/0 fail, icon tripwire verified