Brand kit: upload-time alpha sniff picks the sign-in mono-mask strategy from actual image bytes #316
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#316
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Follow-up from the S3 brand-kit polish arc (DDR 0130, commits
8ee9492/eead829onprivate-standup-polish).The sign-in preview renders the uploaded mark one-colour via a CSS mask. Root cause of the original missing-mark bug: default
mask-mode: alpharecovers no shape from an opaque source. The shipped fix scopes a luminance-subtract mask to JPEG uploads (sniffed from the data URL mime — JPEG structurally cannot carry alpha) and keeps the plain alpha mask for everything else.Residual, documented limitations (
app/src/components/founding/FoundingBrandKit.vue,.oc-prev__logo--mono*comments):.pngkeeps the alpha mask (mime is trusted, not bytes);Durable fix: at logo-choice time the renderer already reads the file bytes (DDR 0124 byte carriage) — decode once (canvas/ImageBitmap), detect whether a real alpha channel with variance exists, and carry that fact with the draft so the preview (and any later consumer) picks alpha vs luminance masking from evidence instead of mime. Cheap at upload time; removes all three residual cases.
Worth folding in while in the file (deferred minor from the same arc): the
--mono/--mono-opaqueSCSS override relies on source order; the source-regex regression tests do not guard a reordering that silently kills the JPEG path — harden the selector or pin the order.Shipped in
b3b7463(onorigin/main).The sign-in mono-mask strategy is now picked from the logo's decoded bytes, not its mime string. On upload the renderer decodes the mark once (2-D canvas) and carries the verdict with the draft:
logoAlphaHasVariance— a real alpha channel with variance keeps the plain alpha mask;deriveLogoMonoMask— an opaque source (flat PNG, any JPEG, a JPEG renamed.png) gets a luminance-derived mono mask whose alpha is each pixel's distance from the sampled background. Polarity-agnostic, so a light mark on a dark JPEG recovers too.Both facts (
BrandDraft.logoHasAlpha+logoMaskData) travel with the draft and surviveresume; the sign-in masks fromlogoMaskData || logoData— one CSS mask strategy, retiring the source-order fragility of a second--monooverride (the deferred minor). Where no 2-D canvas is offered (headless) it degrades to the mime heuristic + alpha mask, fail-soft.All three residual cases from the issue are removed: opaque PNG, JPEG-renamed-
.png, and the inverted light-on-dark JPEG.Evidence:
app/src/lib/founding.ts(pure detection/synthesis),app/src/components/founding/FoundingBrandKit.vue(decode glue + carry/consume). Red-first tests inapp/tests/unit/founding.test.ts(alpha-variance true/opaque/veil; mask recovery both polarities) andapp/tests/unit/foundingWizard.test.ts(upload records verdict; opaque draft masks from derived mask, alpha draft from source; Remove clears).vue-tsc+eslintclean; app suite 628 passed (unrelated pre-existingboot.test.tsneeds Go on PATH).