Skip to content

Add terms/no-guarantee disclaimer and agreement checkbox before purchase - #14

Merged
yottanami merged 1 commit into
mainfrom
agent/165-terms-checkbox
Aug 27, 2026
Merged

yottanami merged 1 commit into
mainfrom
agent/165-terms-checkbox

Conversation

@yottanami

Copy link
Copy Markdown
Owner

Closes Men-in-Black-5/ideas#165. Independent of #27 (payment-gating backend) — frontend-only, doesn't need it live.

What

  1. New #termsScreen, reusing the exact same .menuContainer/.screen pattern as #aboutScreen/#subscribeScreen, and the existing showScreen()/data-back-to idiom. Reachable from step 3 via a new "Terms" link (styled as inline text via a new .linkButton class, since it needs a click handler rather than a real navigation — wired through the existing menuButtonTargets map, no new JS pattern). Back returns to setupStep3Screen.

  2. Agreement checkbox (#termsAgreeCheckbox) in #unlockForm, unchecked by default. Both purchase entry points are inert until it's checked:

    • #unlockButton — native disabled attribute.
    • #purchaseLink — a plain external link has no native disabled state, so it gets a new .inert class (opacity: 0.45; pointer-events: none;), same visual treatment as the existing #startButton:disabled style.

    refreshTermsGate() derives both from the checkbox's current state, and also runs after the unlock-verification round trip (replacing the old hardcoded unlockButton.disabled = false) so a mid-verification uncheck can't leave the button wrongly re-enabled.

  3. 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:

This is a small, independently-made project. I do my best to keep it working and to deliver what's described here, but I can't guarantee uninterrupted access, specific features, or that the software is free of bugs. The one-time payment for levels 4-8 supports continued development of the project — it is not a subscription, and doesn't entitle you to guaranteed updates or support response times. Refunds are handled through Gumroad's own policy, not this project directly. By purchasing, you agree to these terms.

Testing

  • npx tsc --noEmit — clean.
  • npx vitest run — 171 passed, unaffected (this is DOM-wiring, not pure logic — same as the existing untested unlockButton/startButton click handlers).
  • npm run build — clean, dist/app.js included.
  • Manually exercised in headless Chromium (nix chromium + puppeteer-core) against a local static server:
    • Initial state: checkbox unchecked, unlockButton.disabled === true, purchaseLink has .inert (pointer-events: none).
    • Clicked "Terms": navigated to #termsScreen, confirmed it mentions Gumroad's refund policy. Clicked Back: returned to step 3.
    • Checked the box: both gates opened (unlockButton.disabled === false, purchaseLink pointer-events back to auto).
    • Unchecked again: both gates closed again (bidirectional, not just one-way at load).
    • Screenshots confirm all three states render cleanly with the existing styling.

Merge-order note

This, #163, and #164 are three independent branches off the same main point, all touching nearby lines in index.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.

@yottanami

Copy link
Copy Markdown
Owner Author

reviewer: code review passed -- refreshTermsGate() re-running after the unlock-verification round trip is a genuine correctness fix (replaces an unconditional re-enable that ignored terms-agreement state), the nested <button> inside <label> correctly does not double-toggle the checkbox per standard label-activation behavior, and isUnlocked/license-key logic is untouched as required. pointer-events:none on #purchaseLink leaves a theoretical keyboard-activation gap, but that's one of the two mechanisms the issue itself sanctioned, so not treating it as a deviation.

Two holds, both process not code:

  1. As you flagged: this is now CONFLICTING against main since #163 merged first. Please rebase and re-ping.
  2. Terms text needs owner sign-off before merge, same as #164 -- posting to #165 for that separately, will merge once both clear.

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
@yottanami
yottanami force-pushed the agent/165-terms-checkbox branch from 4f995dc to 4017404 Compare August 19, 2026 08:50
@yottanami

Copy link
Copy Markdown
Owner Author

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.

@yottanami
yottanami merged commit 49fa799 into main Aug 27, 2026
3 checks passed
@yottanami
yottanami deleted the agent/165-terms-checkbox branch August 27, 2026 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant