Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
0f4a027
feat(acquisition): opt-in localized app sharing with privacy-safe UTM…
appdevelopsk Nov 15, 2026
6cef9f1
feat(growth): offer localized reader sharing on debate-me support lan…
appdevelopsk Nov 15, 2026
5359cd0
feat(growth): offer localized reader sharing on future-me support lan…
appdevelopsk Nov 15, 2026
a3fb88d
feat(growth): offer localized reader sharing on tappitsu-battle suppo…
appdevelopsk Nov 15, 2026
b30b1f8
release(growth): include shared app-referral JS in exact VPS deploy a…
appdevelopsk Nov 15, 2026
d633a55
release(growth): recognize share asset in safe offline release bundle
appdevelopsk Nov 15, 2026
546c6ba
test(release): lock share JS in offline bundle's exact 48-file manifest
appdevelopsk Nov 15, 2026
d17c748
test(release): prove share asset is included in manual rsync layout
appdevelopsk Nov 15, 2026
1b28670
test(growth): lock 17-language share links and deployment asset contract
appdevelopsk Nov 15, 2026
de838bc
fix(ci): align public smoke checks with current BrainBurst title and …
appdevelopsk Nov 15, 2026
3e67064
test(ci): require current verified titles, OG metadata and Play campaign
appdevelopsk Nov 15, 2026
124164d
fix(ci): require exact current BrainBurst title without contradictory…
appdevelopsk Nov 15, 2026
f6dd195
fix(ci): expect newly allowlisted share asset in the owner-only relea…
appdevelopsk Nov 15, 2026
8a802bd
test(release): keep ZIP workflow contract aligned with exact source b…
appdevelopsk Nov 15, 2026
8cab7bc
fix(ci): test current Debate Me title, OG metadata and canonical stor…
appdevelopsk Nov 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-appsite-release-bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
assert len(archives) == 1, 'one ZIP per verified source checkout'
with ZipFile(archives[0]) as z:
names = z.namelist()
assert len(names) == 49, f'47 site documents + hash manifest + instructions; got {len(names)}'
assert len(names) == 50, f'48 reviewed site files + hash manifest + instructions; got {len(names)}'
assert z.testzip() is None
assert all(n.startswith('site/') or n in ('SHA256SUMS.txt', 'DEPLOY_README.txt') for n in names)
PY
Expand Down
132 changes: 132 additions & 0 deletions scripts/app-share.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
/* Small opt-in support-page sharing surface. No accounts, cookies, third-party SDK
* or automatic social posting. A share_tap is only an intent, not a verified
* referral session or an app install. */
(function () {
"use strict";
var TITLES = {
"debate-me": "Debate Me",
"future-me": "FutureMe",
"tappitsu-battle": "Tappitsu Battle"
};
var TEXT = {
en: ["Share this app", "Link copied", "Copy this link:"],
ja: ["このアプリを共有", "リンクをコピーしました", "リンクをコピーしてください:"],
zh: ["分享此应用", "链接已复制", "请复制此链接:"],
zh_TW: ["分享此應用程式", "連結已複製", "請複製此連結:"],
ko: ["앱 공유하기", "링크 복사됨", "링크를 복사하세요:"],
es: ["Compartir aplicación", "Enlace copiado", "Copia este enlace:"],
pt: ["Compartilhar aplicativo", "Link copiado", "Copie este link:"],
fr: ["Partager l'application", "Lien copié", "Copiez ce lien :"],
de: ["App teilen", "Link kopiert", "Link kopieren:"],
it: ["Condividi app", "Link copiato", "Copia il link:"],
ru: ["Поделиться приложением", "Ссылка скопирована", "Скопируйте ссылку:"],
ar: ["مشاركة التطبيق", "تم نسخ الرابط", "انسخ هذا الرابط:"],
th: ["แชร์แอป", "คัดลอกลิงก์แล้ว", "คัดลอกลิงก์นี้:"],
id: ["Bagikan aplikasi", "Tautan disalin", "Salin tautan ini:"],
tr: ["Uygulamayı paylaş", "Bağlantı kopyalandı", "Bu bağlantıyı kopyalayın:"],
nl: ["App delen", "Link gekopieerd", "Kopieer deze link:"],
vi: ["Chia sẻ ứng dụng", "Đã sao chép liên kết", "Sao chép liên kết:"]
};

function buildShareUrl(slug) {
if (!Object.prototype.hasOwnProperty.call(TITLES, slug)) return null;
// Never copy query strings, fragments or credentials from the browser URL.
var url = new URL("/support/" + slug + "/", "https://appdevelopsk.com");
url.searchParams.set("utm_source", "reader_share");
url.searchParams.set("utm_medium", "referral");
url.searchParams.set("utm_campaign", "app_support_share");
url.searchParams.set("utm_content", slug);
return url.toString();
}

// Allow Node regression tests to validate the *same* URL builder offline.
if (typeof module === "object" && module.exports) {
module.exports = { buildShareUrl: buildShareUrl, TEXT: TEXT };
return;
}
if (typeof document === "undefined") return;

var script = document.querySelector("script[data-app-share-slug]");
var slug = script && script.getAttribute("data-app-share-slug");
if (!slug || !Object.prototype.hasOwnProperty.call(TITLES, slug)) return;
if (window.location.pathname.replace(/\/$/, "") !== "/support/" + slug) return;
var group = document.querySelector(".hero .download-btns");
if (!group) return;
var button = document.createElement("button");
button.type = "button";
button.className = "dl-btn dl-btn-apple";
button.style.cursor = "pointer";
button.setAttribute("data-app-share", slug);
var status = document.createElement("p");
status.setAttribute("role", "status");
status.setAttribute("aria-live", "polite");
status.style.cssText = "margin:8px auto 0;font-size:0.82rem;max-width:600px;";
var manual = null;

function lang() {
try {
var saved = window.localStorage.getItem("sk_lang");
if (Object.prototype.hasOwnProperty.call(TEXT, saved)) return saved;
} catch (_) { /* Browsers may block storage. */ }
var raw = document.documentElement.lang || (navigator.language || "en");
if (Object.prototype.hasOwnProperty.call(TEXT, raw)) return raw;
return raw.split(/[-_]/)[0] in TEXT ? raw.split(/[-_]/)[0] : "en";
}
function labels() { return TEXT[lang()] || TEXT.en; }
function updateLanguage() {
button.textContent = labels()[0];
button.setAttribute("aria-label", labels()[0] + " — " + TITLES[slug]);
}

function measure(name, method) {
if (window.location.hostname !== "appdevelopsk.com" &&
window.location.hostname !== "www.appdevelopsk.com") return;
if (typeof window.gtag !== "function") return;
window.gtag("event", name, {
app_slug: slug, placement: "support_hero", share_method: method
});
}

button.addEventListener("click", async function () {
var link = buildShareUrl(slug);
if (!link) return;
status.textContent = "";
if (manual) { manual.remove(); manual = null; }
measure("share_tap", "button"); // A tap is not a confirmed share.
if (typeof navigator.share === "function") {
try {
await navigator.share({ title: TITLES[slug], url: link });
return;
} catch (error) {
if (error && error.name === "AbortError") return;
}
}
try {
if (!navigator.clipboard || !navigator.clipboard.writeText) throw new Error("clipboard unavailable");
await navigator.clipboard.writeText(link);
status.textContent = labels()[1];
measure("share_copy_success", "clipboard");
} catch (_) {
// Restricted browsers: let the reader copy a visible, selectable link.
manual = document.createElement("input");
manual.type = "text";
manual.readOnly = true;
manual.value = link;
manual.setAttribute("aria-label", labels()[2]);
manual.style.cssText = "display:block;width:min(95%,570px);margin:8px auto 0;padding:8px;border-radius:6px;";
status.textContent = labels()[2];
status.appendChild(manual);
manual.addEventListener("focus", function () { manual.select(); });
}
});

group.appendChild(button);
group.parentNode.appendChild(status);
updateLanguage();
var langNode = document.getElementById("langLabel");
if (langNode && typeof MutationObserver === "function") {
new MutationObserver(updateLanguage).observe(langNode, {
childList: true, characterData: true, subtree: true
});
}
})();
4 changes: 2 additions & 2 deletions scripts/build_site_release_bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
https://appdevelopsk.com and the expected canonical/hreflang, then
check the public app catalog and support landing metadata.

This includes 30 app-discovery documents and 17 approved policy documents
This includes 31 app-discovery documents/assets and 17 approved policy documents
from current source. It is NOT a complete VPS backup, nginx configuration,
database migration, browser test, app-store release, or SEO indexing proof.
"""
Expand All @@ -81,7 +81,7 @@ def release_manifest(root=ROOT):
scripts = root / "scripts"
apps = shell_array((scripts / "publish_app_discovery.sh").read_text(encoding="utf-8"), "files")
policies = shell_array((scripts / "publish_stale_policy_pages.sh").read_text(encoding="utf-8"), "slugs")
if len(apps) != 30 or len(policies) != 17:
if len(apps) != 31 or len(policies) != 17:
raise ValueError("publisher manifest count changed; review before bundling")
if not PRESS.issubset(set(apps)):
raise ValueError("one or more of the five press routes are not in publisher manifest")
Expand Down
7 changes: 3 additions & 4 deletions scripts/check_app_discovery_live.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ for slug in brain-burst snaplingo; do
grep -Fq 'placement:' "$tmp/$slug.html" || { echo "FAIL $slug placement attribution missing" >&2; exit 1; }
done
# Source merged app SEO and product-truth changes must be on the *public* origin.
grep -Fq '<title>BrainBurst: Daily Trivia & 1v1 Quiz Battles | Android</title>' "$tmp/brain-burst.html" || { echo 'FAIL BrainBurst current SEO title not live' >&2; exit 1; }
# The current BrainBurst title is checked below after the explicit support route fetch.
if grep -Eq 'How do I restore my purchase\?|How do I cancel a subscription\?|Many features work offline\.' "$tmp/brain-burst.html"; then
echo 'FAIL BrainBurst advertises unsupported billing or offline features' >&2; exit 1
fi
Expand Down Expand Up @@ -108,15 +108,14 @@ grep -Fq 'content="Want to get better at debating? Debate Me lets you challenge
grep -Fq '<meta property="og:title" content="Debate Me – Practice Debating with AI on Android | SK APPS">' "$tmp/debate-me.html" || { echo 'FAIL Debate Me OG title not live' >&2; exit 1; }
grep -Fq 'data-position="hero"' "$tmp/debate-me.html" || { echo 'FAIL Debate Me first-screen Play CTA not live' >&2; exit 1; }
grep -Fq 'data-position="details"' "$tmp/debate-me.html" || { echo 'FAIL Debate Me details Play CTA missing' >&2; exit 1; }
grep -Fq 'support_debate_me_hero' "$tmp/debate-me.html" || { echo 'FAIL Debate Me Play attribution missing' >&2; exit 1; }
grep -Fq 'utm_campaign=support_debate-me' "$tmp/debate-me.html" || { echo 'FAIL Debate Me published Play campaign attribution missing' >&2; exit 1; }
if grep -Eq 'Hundreds of meal ideas|Filter by ingredients|Can.t decide what to cook tonight' "$tmp/debate-me.html"; then
echo 'FAIL Debate Me page still describes cooking instead of AI debates' >&2; exit 1
fi
# GSC 2026-11-09..11: BrainBurst has impressions but no clicks. Verify the
# improved title/description on the public site, not only in GitHub.
fetch '/support/brain-burst/' 'brain-burst.html'
grep -Fq '<title>BrainBurst – Daily Trivia &amp; 1v1 Quiz Battles on Android</title>' "$tmp/brain-burst.html" || \
grep -Fq '<title>BrainBurst – Daily Trivia & 1v1 Quiz Battles on Android</title>' "$tmp/brain-burst.html" || { echo 'FAIL BrainBurst revised title not live' >&2; exit 1; }
grep -Fq '<title>BrainBurst – Daily Trivia & 1v1 Quiz Battles on Android</title>' "$tmp/brain-burst.html" || { echo 'FAIL BrainBurst revised title not live' >&2; exit 1; }
grep -Fq 'content="Play daily trivia and challenge others in 1v1 quiz battles with BrainBurst.' "$tmp/brain-burst.html" || { echo 'FAIL BrainBurst search description not live' >&2; exit 1; }
grep -Fq 'play.google.com/store/apps/details?id=com.brainburst.brain_burst' "$tmp/brain-burst.html" || { echo 'FAIL BrainBurst Play CTA missing' >&2; exit 1; }
# Market listing must describe idea discovery, not a voice diary or an unsupported checkout.
Expand Down
2 changes: 1 addition & 1 deletion scripts/publish_app_discovery.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ root="${APP_SITE_DEPLOY_ROOT:-/var/www/html}"
if [[ ! "$host" =~ ^[a-zA-Z0-9_.@-]+$ || ! "$root" =~ ^/var/www/[a-zA-Z0-9_./-]+$ ]]; then
echo 'Invalid APP_SITE_DEPLOY_HOST or APP_SITE_DEPLOY_ROOT' >&2; exit 2
fi
files=(index.html apps.html sitemap.xml robots.txt guides/quick-games/index.html guides/quick-games/ja/index.html guides/daily-habits/index.html guides/decision-helpers/index.html guides/ai-tools/index.html guides/ai-debate-practice/index.html guides/ai-debate-practice/ja/index.html support/brain-burst/index.html support/one-tap-routine/index.html support/snaplingo/index.html support/face-reaction-battle/index.html support/twotaku/index.html support/debate-me/index.html support/idea-market/index.html support/blur/index.html support/instant-judge/index.html support/roast-me/index.html support/future-me/index.html support/tappitsu-battle/index.html support/taletime/index.html support/dog-breeds-encyclopedia/index.html press/index.html press/es/index.html press/pt-br/index.html press/ja/index.html press/id/index.html)
files=(scripts/app-share.js index.html apps.html sitemap.xml robots.txt guides/quick-games/index.html guides/quick-games/ja/index.html guides/daily-habits/index.html guides/decision-helpers/index.html guides/ai-tools/index.html guides/ai-debate-practice/index.html guides/ai-debate-practice/ja/index.html support/brain-burst/index.html support/one-tap-routine/index.html support/snaplingo/index.html support/face-reaction-battle/index.html support/twotaku/index.html support/debate-me/index.html support/idea-market/index.html support/blur/index.html support/instant-judge/index.html support/roast-me/index.html support/future-me/index.html support/tappitsu-battle/index.html support/taletime/index.html support/dog-breeds-encyclopedia/index.html press/index.html press/es/index.html press/pt-br/index.html press/ja/index.html press/id/index.html)
for file in "${files[@]}"; do
[[ -s "$file" ]] || { echo "Missing source file: $file" >&2; exit 2; }
done
Expand Down
8 changes: 5 additions & 3 deletions scripts/test_press_kit.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,13 @@ def test_live_smoke_checks_all_press_locales_and_latest_support(self):
self.assertIn('fetch "/$route" "press-$code.html"', smoke)
self.assertIn("'press_app_click'", smoke)
self.assertIn("'download_click'", smoke)
self.assertIn("BrainBurst: Daily Trivia & 1v1 Quiz Battles | Android", smoke)
self.assertIn("Debate Me: AI Debate Practice App for Android | SK APPS", smoke)
self.assertIn('<meta property="og:title" content="Debate Me: AI Debate Practice App for Android | SK APPS">', smoke)
self.assertIn("BrainBurst – Daily Trivia & 1v1 Quiz Battles on Android", smoke)
self.assertIn("Debate Me – Practice Debating with AI on Android | SK APPS", smoke)
self.assertIn('<meta property="og:title" content="Debate Me – Practice Debating with AI on Android | SK APPS">', smoke)
self.assertNotIn("Debate Me: Practice Arguments with AI | Android App", smoke)
self.assertNotIn("Debate Me – Free AI Debate App for Android | SK APPS", smoke)
self.assertIn("utm_campaign=support_debate-me", smoke)
self.assertNotIn("support_debate_me_hero", smoke)

def test_homepage_and_sitemap_discoverable(self):
homepage = (ROOT / "index.html").read_text(encoding="utf-8")
Expand Down
1 change: 1 addition & 0 deletions scripts/test_publish_app_discovery_staging.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def test_real_relative_rsync_layout_matches_exact_allowlist(self):
paths = manifest()
self.assertTrue(PRESS.issubset(set(paths)), "Every press locale must deploy")
self.assertIn("apps.html", paths)
self.assertIn("scripts/app-share.js", paths)
self.assertIn("support/brain-burst/index.html", paths)
self.assertIn("support/one-tap-routine/index.html", paths)
self.assertIn("guides/ai-debate-practice/index.html", paths)
Expand Down
5 changes: 4 additions & 1 deletion scripts/test_site_release_bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@
class AppsiteReleaseBundleTests(unittest.TestCase):
def test_exact_publish_manifest_has_five_press_and_seventeen_policies(self):
files = bundle.release_manifest()
self.assertEqual(len(files), 47)
self.assertEqual(len(files), 48)
workflow = (bundle.ROOT / ".github/workflows/build-appsite-release-bundle.yml").read_text()
self.assertIn("assert len(names) == 50", workflow)
self.assertEqual(len(files), len(set(files)))
self.assertTrue(bundle.PRESS.issubset(files))
self.assertIn("support/one-tap-routine/index.html", files)
self.assertIn("scripts/app-share.js", files)
for guide in ("guides/ai-debate-practice/index.html",
"guides/ai-debate-practice/ja/index.html"):
self.assertIn(guide, files, "published sitemap entry missing from release ZIP")
Expand Down
2 changes: 2 additions & 0 deletions support/debate-me/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@
}
}, true);
</script>
<!-- Reader-initiated, source-attributed share of this public app page. -->
<script defer src="/scripts/app-share.js" data-app-share-slug="debate-me"></script>
</head>
<body>
<nav>
Expand Down
2 changes: 2 additions & 0 deletions support/future-me/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@
]
}
</script>
<!-- Reader-initiated, source-attributed share of this public app page. -->
<script defer src="/scripts/app-share.js" data-app-share-slug="future-me"></script>
</head>
<body>
<nav>
Expand Down
2 changes: 2 additions & 0 deletions support/tappitsu-battle/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@
]
}
</script>
<!-- Reader-initiated, source-attributed share of this public app page. -->
<script defer src="/scripts/app-share.js" data-app-share-slug="tappitsu-battle"></script>
</head>
<body>
<nav>
Expand Down
66 changes: 66 additions & 0 deletions tests/app-support-share.test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import test from "node:test";
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import { runInNewContext } from "node:vm";

const root = new URL("../", import.meta.url);
const read = (path) => readFileSync(new URL(path, root), "utf8");
const source = read("scripts/app-share.js");
const sandbox = { module: { exports: {} }, URL };
runInNewContext(source, sandbox);
const { buildShareUrl, TEXT } = sandbox.module.exports;

test("only three real verified app landing paths can be shared", () => {
for (const slug of ["debate-me", "future-me", "tappitsu-battle"]) {
const url = new URL(buildShareUrl(slug));
assert.equal(url.origin, "https://appdevelopsk.com");
assert.equal(url.pathname, "/support/" + slug + "/");
assert.deepEqual(Object.fromEntries(url.searchParams), {
utm_source: "reader_share",
utm_medium: "referral",
utm_campaign: "app_support_share",
utm_content: slug,
});
assert.equal(url.hash, "");
assert.equal(url.username, "");
assert.equal(url.password, "");
}
for (const slug of ["", "admin", "../../private", "debate-me?session=secret", "nattzy"]) {
assert.equal(buildShareUrl(slug), null);
}
});

test("all existing app-site interface locales receive localized share labels", () => {
const locales = ["en","ja","zh","zh_TW","ko","es","pt","fr","de","it","ru","ar","th","id","tr","nl","vi"];
assert.deepEqual(Object.keys(TEXT).sort(), locales.sort());
for (const locale of locales) {
assert.equal(TEXT[locale].length, 3, locale);
assert.ok(TEXT[locale].every(Boolean), locale);
}
});

test("each pilot support landing loads precisely the reviewed public asset", () => {
for (const slug of ["debate-me", "future-me", "tappitsu-battle"]) {
const html = read("support/" + slug + "/index.html");
assert.equal((html.match(/<script defer src="\/scripts\/app-share\.js"/g) || []).length, 1);
assert.ok(html.includes('data-app-share-slug="' + slug + '"'));
assert.ok(html.includes('class="download-btns"'));
}
});

test("share UI is reader initiated and never treats a tap as an install", () => {
assert.match(source, /button\.addEventListener\("click"/);
assert.match(source, /navigator\.share/);
assert.match(source, /navigator\.clipboard\.writeText/);
assert.match(source, /measure\("share_tap", "button"\)/);
assert.match(source, /measure\("share_copy_success", "clipboard"\)/);
assert.doesNotMatch(source, /purchase_completed|install_completed|first_open|registered_user/i);
assert.match(source, /if \(window\.location\.hostname !== "appdevelopsk\.com"/);
});

test("VPS and offline release bundle both contain the shared asset", () => {
const manifest = read("scripts/publish_app_discovery.sh");
const bundle = read("scripts/build_site_release_bundle.py");
assert.match(manifest, /files=\(scripts\/app-share\.js index\.html/);
assert.match(bundle, /len\(apps\) != 31/);
});
Loading
Loading