Skip to content

fix(xiaohongshu): detect current draft save success#1060

Merged
jackwener merged 1 commit intojackwener:mainfrom
Astro-Han:fix/xhs-draft-title-r
Apr 16, 2026
Merged

fix(xiaohongshu): detect current draft save success#1060
jackwener merged 1 commit intojackwener:mainfrom
Astro-Han:fix/xhs-draft-title-r

Conversation

@Astro-Han
Copy link
Copy Markdown
Contributor

Description

Fix xiaohongshu/publish --draft for the current creator-center UI.

The current UI shows 保存成功 after a successful draft save while staying on /publish/publish?...target=image. The adapter did not treat that as success, so it returned a warning even though the draft was saved.

This change:

  • makes success detection mode-specific
  • accepts 保存成功 for draft saves
  • keeps publish-mode success detection unchanged
  • adds regression coverage for both the draft case and the publish-mode guard

Related issue:
#1047

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 🌐 New site adapter
  • 📝 Documentation
  • ♻️ 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

  • npx tsc --noEmit
    • exit code 0
  • npx vitest run clis/xiaohongshu/publish.test.js clis/xiaohongshu/navigation.test.js
    • 2 files passed, 22 tests passed
  • Live repro:
    • node dist/src/main.js xiaohongshu publish --title 'T8' 'draft body t8' --images /tmp/opencli-xhs-repro.loZBiY/repro.png --draft
    • Result:
      - status: ✅ 暂存成功
        detail: '"T8" · 1张图片 · 保存成功'

@jackwener jackwener merged commit bc06d99 into jackwener:main Apr 16, 2026
10 of 11 checks passed
@Astro-Han Astro-Han deleted the fix/xhs-draft-title-r branch April 17, 2026 01:56
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