Skip to content

推特支持回复图片#756

Merged
jackwener merged 4 commits intojackwener:mainfrom
YoungCan-Wang:main
Apr 4, 2026
Merged

推特支持回复图片#756
jackwener merged 4 commits intojackwener:mainfrom
YoungCan-Wang:main

Conversation

@YoungCan-Wang
Copy link
Copy Markdown
Contributor

Description

Related issue:

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

YoungCan-Wang and others added 4 commits April 4, 2026 15:16
feat: support image replies in twitter reply
…dd size limit

- Fix attachReplyImage fallback: use uploaded flag instead of checking
  page.setFileInput existence, so base64 fallback actually runs when
  CDP setFileInput throws "Unknown action"
- Restore execCommand('insertText') as primary text input method for
  Twitter's Draft.js editor, with paste event as fallback
- Add 20MB size limit for remote image downloads to prevent OOM
- Remove unsafe buttons[0] fallback that could click invisible buttons
…rning

Local images were not validated for size — a 100MB file would fail only
at upload time. Remote images already had MAX_IMAGE_SIZE_BYTES checks.
Also add a console.warn when using the base64 fallback with large
payloads, consistent with xiaohongshu/publish.ts behavior.
@jackwener jackwener merged commit c86e677 into jackwener:main Apr 4, 2026
just-buer pushed a commit to just-buer/opencli that referenced this pull request Apr 8, 2026
* feat: 推特新增回复图片能力支持本地路径和网络路径

* fix(twitter/reply): fix image upload fallback, restore execCommand, add size limit

- Fix attachReplyImage fallback: use uploaded flag instead of checking
  page.setFileInput existence, so base64 fallback actually runs when
  CDP setFileInput throws "Unknown action"
- Restore execCommand('insertText') as primary text input method for
  Twitter's Draft.js editor, with paste event as fallback
- Add 20MB size limit for remote image downloads to prevent OOM
- Remove unsafe buttons[0] fallback that could click invisible buttons

* fix(twitter/reply): add local image size check and base64 fallback warning

Local images were not validated for size — a 100MB file would fail only
at upload time. Remote images already had MAX_IMAGE_SIZE_BYTES checks.
Also add a console.warn when using the base64 fallback with large
payloads, consistent with xiaohongshu/publish.ts behavior.

---------

Co-authored-by: jackwener <jakevingoo@gmail.com>
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