Skip to content

docs: add privacy policies and minimize analytics data - #2518

Open
rophec wants to merge 3 commits into
mainfrom
docs/privacy-cookie-policy-draft-20260728
Open

docs: add privacy policies and minimize analytics data#2518
rophec wants to merge 3 commits into
mainfrom
docs/privacy-cookie-policy-draft-20260728

Conversation

@rophec

@rophec rophec commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Dependency

Depends on #2489. Merge #2489 first. This PR deliberately does not change the consent banner component introduced there.

What changed

  • Add detailed privacy and cookie policy pages in English, Simplified Chinese, and Japanese.
  • Add unobtrusive privacy and cookie links to the documentation footer.
  • Remove dates, implementation identifiers, event names, cookie names, storage keys, query-parameter names, and external citations from the visible policy copy.
  • Minimize analytics payloads by preserving only approved campaign attribution, dropping unrelated query data and fragments, normalizing the Steam destination, and no longer sending link text.
  • Add regression coverage for URL sanitization and outbound destination normalization.

Why

The documentation needs clear, localized privacy explanations without exposing implementation-specific identifiers. Analytics should also avoid forwarding arbitrary URL data or visible link labels.

User impact

Visitors get complete privacy and cookie explanations plus footer access to both pages. Consent behavior remains unchanged, while analytics events carry less potentially sensitive context.

Validation

  • npm run test:analytics — 11/11 passed
  • npm run build:check — passed
  • SEO validation — 302 indexable pages, 31 noindex pages, 1152 hreflang links
  • git diff --check — passed

Summary by CodeRabbit

  • 新功能
    • 新增并更新中、日、英的《隐私政策》和《Cookie 政策》页面。
    • 页脚增加“隐私政策 / Cookie 政策”入口;并提供底部常驻的“Cookie 设置”控件管理偏好。
  • 改进
    • 未获得许可前不加载分析统计;拒绝后不影响文档访问。
    • 分析上报链接进行清理与规范化(仅保留白名单 UTM 参数、去除敏感与查询/片段)。
  • 文档
    • 调整隐私/Cookie 内容结构,细化同意、撤回与联系入口说明。
  • 测试
    • 补充分析 URL 清理与 GA4 上报行为的断言用例。

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3efef31c-9e8c-4aab-9bb2-4ff738994a9b

📥 Commits

Reviewing files that changed from the base of the PR and between 025697d and 2dc1c05.

📒 Files selected for processing (2)
  • docs/.vitepress/theme/analytics-consent.mjs
  • docs/scripts/analytics-consent.test.mjs
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • Project-N-E-K-O/N.E.K.O.-PC (manual)

Walkthrough

Changes

分析与隐私政策

Layer / File(s) Summary
分析 URL 清理与埋点更新
docs/.vitepress/theme/analytics-consent.mjs, docs/scripts/analytics-consent.test.mjs
新增 UTM 参数白名单、页面 URL 清理和目的地 URL 归一化,并应用于页面浏览与 Steam CTA 事件;测试覆盖敏感参数移除、长度截断及片段清除喵。
多语言隐私与 Cookie 政策页面
docs/privacy.md, docs/ja/privacy.md, docs/zh-CN/privacy.md, docs/cookies.md, docs/ja/cookies.md, docs/zh-CN/cookies.md
新增三种语言的 Cookie 政策页面,并重写隐私政策中的分析许可、信息处理、数据保留与选择撤回说明喵。
多语言页脚政策链接
docs/.vitepress/config.ts
英文、日文和简体中文页脚分别链接到对应语言的隐私政策与 Cookie 政策页面喵。

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested labels: enhancement

Poem

URL 脱去敏感衣,喵
Cookie 政策排队齐喵。
多语页脚牵新路,喵
分析同意更清晰喵。
隐私页面轻轻闪,喵
小猫守护每次浏览喵。

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed 标题准确概括了新增隐私/ Cookie 政策页并收紧分析数据的主要改动喵。
Description check ✅ Passed 描述包含摘要、原因、用户影响和验证,且未触发回归报告或不拆分理由的必填条件喵。
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
⚔️ Resolve merge conflicts 💡
  • Resolve merge conflict in branch docs/privacy-cookie-policy-draft-20260728

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot added the enhancement New feature or request label Jul 28, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/.vitepress/theme/analytics-consent.mjs`:
- Around line 214-223: 更新事件参数构建逻辑中的 cta_location,使其从已由 sanitizeAnalyticsPageUrl
生成的 pageUrl 读取 utm_content,而不是从原始 linkUrl 读取;保留 unspecified 默认值,并为超长 utm_content
补充回归测试,验证清理后的值不会超过 100 个字符或泄露原始数据。
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c53dbe97-b233-4997-a13b-310b8044e261

📥 Commits

Reviewing files that changed from the base of the PR and between 92ed281 and 8a1fcdc.

📒 Files selected for processing (9)
  • docs/.vitepress/config.ts
  • docs/.vitepress/theme/analytics-consent.mjs
  • docs/cookies.md
  • docs/ja/cookies.md
  • docs/ja/privacy.md
  • docs/privacy.md
  • docs/scripts/analytics-consent.test.mjs
  • docs/zh-CN/cookies.md
  • docs/zh-CN/privacy.md
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • Project-N-E-K-O/N.E.K.O.-PC (manual)

Comment thread docs/.vitepress/theme/analytics-consent.mjs
@MingTianSang

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8a1fcdcfb4

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread docs/cookies.md Outdated
@rophec
rophec marked this pull request as ready for review July 30, 2026 08:43
@rophec

rophec commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@greptile-apps

greptile-apps Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

本次 PR 新增三种语言的隐私与 Cookie 政策,并减少分析事件携带的数据喵。

  • 为英文、简体中文和日文文档页脚添加隐私政策与 Cookie 政策入口喵。
  • 页面浏览事件仅保留获准的 UTM 参数,并限制参数长度喵。
  • Steam CTA 事件移除链接文本,清除目标地址中的查询参数和片段,并净化当前页面地址喵。
  • 增加 URL 清理、目标地址规范化及 CTA 参数最小化的回归测试喵。

Confidence Score: 5/5

当前没有符合本次跟进审查范围且会阻止合并的故障,因此该 PR 看起来可以安全合并喵。

当前没有仍会阻止合并的故障喵。

Important Files Changed

Filename Overview
docs/.vitepress/theme/analytics-consent.mjs 页面浏览和 Steam CTA 上报现在会净化 URL、规范化目标地址并省略链接文本喵。
docs/.vitepress/config.ts 三种语言的文档页脚均增加了对应的隐私政策与 Cookie 政策链接喵。
docs/scripts/analytics-consent.test.mjs 新增了敏感查询数据移除、双斜杠路径处理、目标地址规范化和 CTA 参数截断测试喵。
docs/privacy.md 英文隐私说明被扩展为完整政策,并与新的分析数据最小化行为保持一致喵。
docs/cookies.md 新增英文 Cookie 政策,说明偏好存储、可选分析 Cookie 与选择管理方式喵。
docs/zh-CN/privacy.md 简体中文隐私政策已更新,并说明分析数据处理和撤回选择的方式喵。
docs/zh-CN/cookies.md 新增简体中文 Cookie 政策喵。
docs/ja/privacy.md 日文隐私政策已更新,并说明分析数据处理和撤回选择的方式喵。
docs/ja/cookies.md 新增日文 Cookie 政策喵。

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Consent[Visitor grants analytics consent] --> PageView[Page view]
  Consent --> SteamClick[Steam CTA click]
  PageView --> SanitizePage[Retain path and approved UTM parameters]
  SteamClick --> SanitizeCurrent[Sanitize current page URL]
  SteamClick --> NormalizeTarget[Remove destination query and fragment]
  SanitizePage --> GA4[GA4 event]
  SanitizeCurrent --> GA4
  NormalizeTarget --> GA4
Loading

Reviews (2): Last reviewed commit: "fix(docs): preserve analytics URL origin..." | Re-trigger Greptile

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 025697dfe7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/.vitepress/theme/analytics-consent.mjs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants