Repository navigation
Add terms/no-guarantee disclaimer and agreement checkbox before purchase - #14
Conversation
|
reviewer: code review passed -- Two holds, both process not code:
|
New #termsScreen, reusing the existing .menuContainer/.screen pattern
(same as #aboutScreen/#subscribeScreen) and the showScreen()/
data-back-to idiom -- reachable from step 3 via a new termsLink
button (styled inline via .linkButton, wired through the existing
menuButtonTargets map), returns to setupStep3Screen on Back.
Adds an unchecked-by-default #termsAgreeCheckbox in #unlockForm.
Both purchase entry points are inert until it's checked:
plain external link, no native disabled state) via a new .inert
CSS class (opacity + pointer-events:none). refreshTermsGate() derives
both from the checkbox's current state and also runs after the
unlock-verification round trip, so a mid-verification uncheck can't
leave the button wrongly re-enabled.
Terms text is a drafted placeholder, not vetted -- flagged in the PR
description for owner review before merge. No changes to isUnlocked/
license-key verification logic.
Closes Men-in-Black-5/ideas#165
4f995dc to
4017404
Compare
|
reviewer: owner signed off on the terms text (ideas#165, 👍 on 2026-08-19) and this is now rebased clean against main with tests/build green. Merging. |
Closes Men-in-Black-5/ideas#165. Independent of #27 (payment-gating backend) — frontend-only, doesn't need it live.
What
New
#termsScreen, reusing the exact same.menuContainer/.screenpattern as#aboutScreen/#subscribeScreen, and the existingshowScreen()/data-back-toidiom. Reachable from step 3 via a new "Terms" link (styled as inline text via a new.linkButtonclass, since it needs a click handler rather than a real navigation — wired through the existingmenuButtonTargetsmap, no new JS pattern). Back returns tosetupStep3Screen.Agreement checkbox (
#termsAgreeCheckbox) in#unlockForm, unchecked by default. Both purchase entry points are inert until it's checked:#unlockButton— nativedisabledattribute.#purchaseLink— a plain external link has no native disabled state, so it gets a new.inertclass (opacity: 0.45; pointer-events: none;), same visual treatment as the existing#startButton:disabledstyle.refreshTermsGate()derives both from the checkbox's current state, and also runs after the unlock-verification round trip (replacing the old hardcodedunlockButton.disabled = false) so a mid-verification uncheck can't leave the button wrongly re-enabled.No changes to
isUnlocked, license-key handling, or any verification logic — this only adds a gate in front of the existing entry points.Terms text — please review before merge
This is placeholder, plain-language text (not legal advice), drafted per the tracking issue:
Testing
npx tsc --noEmit— clean.npx vitest run— 171 passed, unaffected (this is DOM-wiring, not pure logic — same as the existing untestedunlockButton/startButtonclick handlers).npm run build— clean,dist/app.jsincluded.chromium+ puppeteer-core) against a local static server:unlockButton.disabled === true,purchaseLinkhas.inert(pointer-events: none).#termsScreen, confirmed it mentions Gumroad's refund policy. Clicked Back: returned to step 3.unlockButton.disabled === false,purchaseLinkpointer-events back toauto).Merge-order note
This, #163, and #164 are three independent branches off the same
mainpoint, all touching nearby lines inindex.html/src/app.ts(the setup wizard area). Whichever merges last will likely need a routine conflict resolution against the other two — flagging so it's not a surprise, not because of anything unusual in this diff.