Skip to content

feat(zhihu): add interaction commands#868

Merged
jackwener merged 3 commits intojackwener:mainfrom
Astro-Han:feat/zhihu-interactions
Apr 7, 2026
Merged

feat(zhihu): add interaction commands#868
jackwener merged 3 commits intojackwener:mainfrom
Astro-Han:feat/zhihu-interactions

Conversation

@Astro-Han
Copy link
Copy Markdown
Contributor

Description

Add core Zhihu interaction commands for logged-in browser sessions:

  • zhihu follow
  • zhihu like
  • zhihu favorite
  • zhihu comment
  • zhihu answer

Also adds typed target parsing, shared write-safety helpers, adapter tests, and Zhihu adapter docs updates.

Related issue: #857

Type of Change

  • ✨ New feature
  • 🌐 New site adapter
  • 📝 Documentation
  • 🐛 Bug fix
  • ♻️ Refactor
  • 🔧 CI / build / tooling

Checklist

  • I ran the checks relevant to this PR
  • I updated tests or docs if needed
  • I included output or screenshots when useful

Documentation (if adding/modifying an adapter)

  • Added doc page under docs/adapters/ (if new adapter)
  • Updated docs/adapters/index.md table (if new adapter)
  • Updated sidebar in docs/.vitepress/config.mts (if new adapter)
  • Updated README.md / README.zh-CN.md when command discoverability changed
  • Used positional args for the command's primary subject unless a named flag is clearly better
  • Normalized expected adapter failures to CliError subclasses instead of raw Error

Screenshots / Output

Verified locally:

  • pnpm typecheck
  • pnpm test
  • pnpm test:adapter
  • pnpm docs:build
  • npx vitest run tests/e2e/browser-public.test.ts -t "zhihu hot returns trending questions|zhihu search returns results"

Known limitation during verification:

  • pnpm test:e2e is not fully green in this environment because two existing external-site tests are flaky / environment-sensitive:
    • tieba read limit counts replies instead of consuming the main post slot
    • imdb top returns chart data
  • These failures are not introduced by this branch. The same targeted tests pass when rerun individually on both main and this branch.

@Astro-Han Astro-Han force-pushed the feat/zhihu-interactions branch from b46c2b3 to aad015f Compare April 7, 2026 14:50
@jackwener jackwener merged commit ce559da into jackwener:main Apr 7, 2026
11 checks passed
@Astro-Han Astro-Han deleted the feat/zhihu-interactions branch April 7, 2026 23:46
@jackwener jackwener mentioned this pull request Apr 8, 2026
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.

2 participants