Skip to content

feat(app): add the Microsoft Clarity tag to the app shell - #53

Merged
sarthakagrawal927 merged 1 commit into
mainfrom
feat/microsoft-clarity
Aug 23, 2026
Merged

feat(app): add the Microsoft Clarity tag to the app shell#53
sarthakagrawal927 merged 1 commit into
mainfrom
feat/microsoft-clarity

Conversation

@sarthakagrawal927

Copy link
Copy Markdown
Member

What this is

One line added to app.html: the Microsoft Clarity tag (session replay + heatmaps).

app.html is not a landing page. It is the Vite entry for the authenticated SPA that the
worker serves at /app (vite.config.tsapp: path.resolve(__dirname, 'app.html');
src/worker.ts "Assets serves app.html at /app"). So this loads inside the reading and
annotating surface, on every session.

⚠️ This one needs a real decision before it merges

1. It contradicts the privacy page.src/pages/PrivacyPage.tsx, under "What we don't do":

<li>No third-party tracking pixels or marketing tags.</li>

Clarity is a third-party tag. That line stops being true the moment this ships.

2. Session replay in the app shell can record the library itself. Clarity replays capture
DOM content unless masking is set to strict. The DOM here contains exactly what the product
promises to keep private, per its own privacy page and description:

  • saved article and PDF text ("Articles and PDFs you save — title, URL, extracted content, and
    your annotations")
  • the annotations themselves
  • board contents
  • chat questions typed against the library

The product is described as "Research library: capture, annotate, and AI-chat over your
reading — private by default."
Recording replays of that is a different privacy posture, not
a metrics addition.

Masking is a Clarity dashboard setting, not a repo setting — I cannot verify it from here.
If masking is strict for project y6budslpbi, this is much narrower than the above; if it is
not, replays of private reading material start accumulating on merge.

So there are two things only you can settle: whether masking is strict, and what
PrivacyPage.tsx should say. I did not edit the privacy copy — that is a statement to your
users about their own documents, not something to guess at in a PR that adds a script tag.

This PR is left open for that reason, not because anything failed. Merge does not deploy —
deploy.yml is workflow_dispatch: only — so there is no time pressure.

For reference, the sibling setline repo enforces the disclosure rule in CI ("the privacy
notice discloses every third-party script the site loads"
). reader has no equivalent test,
which is why nothing failed here.

Verification

pnpm format:check -> Checked 168 files in 37ms. No fixes applied.
pnpm lint -> Lint: 0 errors, 38 warnings across 194 files.
(unchanged from main; app.html is excluded from Biome by "!**/*.html")
pnpm typecheck -> tsconfig.app.json + tsconfig.worker.json — clean
pnpm test -> Test Files 18 passed (18) | Tests 97 passed (97)
pnpm build -> ✓ built in 474ms

The tag reaches the built shell rather than only the source:

dist/app.html 1 × clarity.ms/tag/y6budslpbi

I did not run the whole pnpm quality chain (it also builds the extension, runs docs checks
and the CF build); CI runs it on this PR.

The Clarity project id is a public client-side site key, not a secret. Nothing else in the
diff; no package.json change.

🤖 Generated with Claude Code

Adds Microsoft Clarity (session replay + heatmaps) to app.html, the entry
point for the authenticated SPA served at /app.
Not merged as-is on purpose — see the PR. Two things need a decision first:
1. src/pages/PrivacyPage.tsx says "No third-party tracking pixels or
marketing tags." Clarity is a third-party tag, so that line stops being
true the moment this ships.
2. app.html is the app shell, not a landing page. Session replay there can
record what the reader is actually reading — saved article and PDF
content, annotations, board contents, and chat questions — which is the
private material the product exists to keep private ("Research library:
capture, annotate, and AI-chat over your reading — private by default").
Whether Clarity's content masking is set to strict for this project
determines whether that happens, and that is a setting in the Clarity
dashboard, not in this repo. I cannot verify it from here.
Verified locally (Node 24.19.0):
pnpm format:check Checked 168 files in 37ms. No fixes applied.
pnpm lint Lint: 0 errors, 38 warnings across 194 files.
(unchanged from main — app.html is excluded from Biome
by "!**/*.html")
pnpm typecheck tsconfig.app.json + tsconfig.worker.json — clean
pnpm test Test Files 18 passed (18), Tests 97 passed (97)
pnpm build ✓ built in 474ms
the tag reaches the built shell:
dist/app.html 1 occurrence of clarity.ms/tag/y6budslpbi
The Clarity project id is a public client-side site key, not a secret.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with Cloudflare Workers Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

StatusNameLatest CommitUpdated (UTC)
✅ Deployment successful!
View logs
reader6bb0b79Aug 22 2026, 11:00 PM

@sarthakagrawal927
sarthakagrawal927 merged commit de3a01b into mainAug 23, 2026
2 checks passed
@sarthakagrawal927
sarthakagrawal927 deleted the feat/microsoft-clarity branch August 23, 2026 06:23
Sign up for freeto 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

@sarthakagrawal927