Skip to content

fix(xiaohongshu): adapt publish to new two-step creator center UI#490

Merged
jackwener merged 2 commits intojackwener:mainfrom
Astro-Han:worktree-fix-xhs-publish
Mar 27, 2026
Merged

fix(xiaohongshu): adapt publish to new two-step creator center UI#490
jackwener merged 2 commits intojackwener:mainfrom
Astro-Han:worktree-fix-xhs-publish

Conversation

@Astro-Han
Copy link
Contributor

@Astro-Han Astro-Han commented Mar 27, 2026

Description

Adapt xiaohongshu publish to the new creator center two-step UI where images must be uploaded before the title/content editor form appears. Previously the command failed with "Could not find title input" because the editor only renders after image upload.

Related issue: #460

Type of Change

  • 🐛 Bug fix

Checklist

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

Screenshots / Output

Before (failing):

📭 Could not find title input. Debug screenshot: /tmp/xhs_publish_title_debug.png

After (working):

  xiaohongshu/publish
┌───────────────────────────────┬──────────────────────────────────┐
│ Status                        │ Detail                           │
├───────────────────────────────┼──────────────────────────────────┤
│ ⚠️ 操作完成,请在浏览器中确认 │ "测试标题" · 1张图片             │
└───────────────────────────────┴──────────────────────────────────┘

…ckwener#460)

The creator center now requires image upload before showing the
title/content editor form. This caused the publish command to fail
with "Could not find title input".

- Add waitForEditForm() to poll for editor after image upload
- Extract TITLE_SELECTORS constant shared by waitForEditForm and fillField
- Add contenteditable title selectors for new UI
- Make images required (new UI mandates images before editor)
- Update draft button to match both '暂存离开' and '存草稿'
- Exclude title placeholder from content fallback selector
- Update tests to match new flow
@jackwener
Copy link
Owner

Thanks for the contribution! I also pushed a small follow-up refactor on your branch to make the publish-surface detection state-based and keep the tests aligned. The new two-step creator center flow support looks solid.

@jackwener jackwener merged commit 39eec0d into jackwener:main Mar 27, 2026
23 checks passed
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