fix(cg): one Generate — a painted mask makes it a retouch #230
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/cg-mask-ux"
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?
The CG editor grew a second button for what is really one intention: make this image again. This PR folds Retouch into Generate:
Full BlazorAdapter suite green (802), and verified live in the browser on the seeded world: one Generate button, correctly gated, with the hint chain intact.
Companion fix for the black rectangle while dragging is library-side: TeamAI/Kagaku.UI#14 (the live preview never got its scoped styles). The pointer bump follows once that PR merges — this PR is independent of it.
🤖 Generated with Claude Code
Summary
Summary
Coverage
Kagura.BlazorAdapter - 88.4%
Kagura.Domain - 94.4%
D04ADFED3A21D401C2764A1D17367E35BEB556CBB3B4B0B74__NonSlugChars_0
Kagura.Infrastructure - 97.6%
n
n
on
ng
C689CA5BBE6D1849B2CA79581BBB07D40636D85790C0E51A9__ArtifactTimestampRegex_2
C689CA5BBE6D1849B2CA79581BBB07D40636D85790C0E51A9__ProjectRoute_0
C689CA5BBE6D1849B2CA79581BBB07D40636D85790C0E51A9__TabQuery_1
Kagura.Kernel - 90%
Kagura.Server - 81.8%
Kagura.UseCases - 95.4%
🔮 fufu~ Jibril reviewed your code!
Oho~ One verb instead of two? Now THIS is the kind of knowledge that makes my wings flutter! ♡ You looked at two buttons that really wanted to be one intention — make this image again — and you folded them together with a mask-painted routing trick. Elegant. The Flugel approves~
Verdict: ✅ Looks good to me~
This is a clean, well-scoped consolidation. Let me show you what I checked~
✅ What I liked~
The routing logic is airtight.
MaskActive(effective render + an additive primitive) decides whetherGenerate()dispatchesRetouchCgVariationorGenerateCgVariation. The oldCanRetouchhad a&& CanGeneratetail that you correctly DROPPED fromMaskActive— and it's safe, because the Generate button isDisabled="@(!CanGenerate || !State.Value.TokenAvailable)", soGenerate()is unreachable whenCanGenerateis false.MaskActiveonly feeds the hint text and the routing branch, both of which sit behind that button gate. No dead path, no missing guard. Fufu~ you thought this through~ ♪The two renamed tests are genuine routing proofs, not tautologies.
An_empty_mask_keeps_generate_on_the_render_pipelineassertsRequests.SingleANDRetouchRequests.Empty;A_painted_mask_routes_generate_to_the_retouch_pipelineasserts the exact mirror. Each one pins the pipeline AND proves the OTHER list stayed empty — so deleting the routing branch or flipping the condition makes the test go red. Exactly the directional shape I demand~Zero orphaned references. I grepped the whole tree for
CanRetouch,Retouch(), and the old Retouch button — all gone. The only surviving"Retouch"string is theKindLabeltimeline label (WholeInpaint => "Retouch"), which is correct and unrelated. TheRetouchCgVariation/GenerateCgVariationactions and theirOnRetouchAsync/OnGenerateAsynceffects are untouched — this PR is purely a view-layer routing decision, exactly as it should be.The hint chain priority is correct:
!TokenAvailable→!CanGenerate→MaskActive. A painted mask with no token still shows the token hint, not the mask hint. Good~Story doc updated to match. The retouch checklist now describes the single verb. No stale "Retouch button" language survives.
💡 Little ideas (non-blocking)~
CgEditorPage.razor:559-560— WhenRetouch()was removed, it left a double blank line betweenSaveMask()and_snapshotOpen. Tiny cosmetic — the razor compiler doesn't care, but a future reader might wonder if something's missing. One blank line is enough~Automated review by Jibril · 2026-08-06
CI/CD: absent for head SHA (0 PR comments) · Local checks: build 0 warnings/0 errors (.NET 10), 28/28 CgEditorPage tests pass
Applied in
0556c84: 💡1 — the double blank line left behind by the removedRetouch()is down to one. No behavior change; adapter build clean.🔮 fufu~ Jibril reviewed your code!
Oho~ Back so soon? And you brought a feather-duster~ ♡ The blank line that lingered where
Retouch()used to live — you swept it right out. Clean. The Flugel is pleased~Verdict: ✅ Looks good to me~
This is a surgical, cosmetic follow-up to my round-1 approval. Let me show you what I checked~
✅ What I liked~
Exactly non-blocking #1, nothing more. The new commit (
0556c84) is a single-line deletion: the double blank line atCgEditorPage.razor:557collapsed to one. I diffede69a533..0556c84—0 1numstat, one file touched (CgEditorPage.razoronly). Zero behavioral drift. The routing logic (MaskActive→RetouchCgVariation/GenerateCgVariation), the hint chain, and the two renamed routing tests are byte-identical to the approvede69a533. Fufu~ you took the note and only the note~ ♪Tests still green at head. I re-ran the full
CgEditorPagefilter: 28/28 pass (incl.An_empty_mask_keeps_generate_on_the_render_pipeline+A_painted_mask_routes_generate_to_the_retouch_pipeline). Build clean — 0 warnings, 0 errors.✅ Round-1 review stands unchanged
My architectural review from
e69a533(comment 5933) holds in full: theMaskActiverouting dropsCanGeneratesafely (button-gated), both routing tests are directional (each asserts the opposite request list empty), zero orphanedCanRetouch/Retouch()/Retouch-button references, hint priority!TokenAvailable→!CanGenerate→MaskActivecorrect, story doc updated to match. Nothing in this commit touches any of that.Automated review by Jibril · 2026-08-06
CI/CD: forgejo-actions coverage bot 5919 present for prior head
e69a533(96.1%/77% overall) — stale for0556c84(cosmetic-only, no coverage impact) · Local checks: build 0/0, 28/28 CgEditorPage tests pass