Skip to content

fix(twitter): always use compose URL for reply to fix missing textarea#855

Closed
winfred5432 wants to merge 1 commit intojackwener:mainfrom
winfred5432:fix/twitter-reply-composer-selector
Closed

fix(twitter): always use compose URL for reply to fix missing textarea#855
winfred5432 wants to merge 1 commit intojackwener:mainfrom
winfred5432:fix/twitter-reply-composer-selector

Conversation

@winfred5432
Copy link
Copy Markdown

Problem

When calling opencli twitter reply without an image, the code navigated to the tweet page URL and waited for [data-testid="primaryColumn"]. The inline reply composer is not reliably mounted in that context, causing:

Error: Could not find reply text area

This was a silent regression — the image path already used the reply composer URL correctly, but the text-only path did not.

Fix

Unconditionally navigate to the reply composer URL (/compose/post?in_reply_to=<tweet_id>) for all replies, then wait for [data-testid="tweetTextarea_0"] before proceeding. The image attachment flow is unchanged.

Testing

Verified locally with opencli twitter reply --url <tweet_url> --text "..." — reply posts successfully on both text-only and image paths.

Fixes #848

When replying without an image, the old code navigated to the tweet's
page URL and waited for `primaryColumn` — but the inline reply composer
is not always mounted, causing "Could not find reply text area" errors.

Fix: unconditionally navigate to the reply composer URL
(`/compose/post?in_reply_to=<id>`) and wait for
`[data-testid="tweetTextarea_0"]` before any further interaction.
Image-attach flow is unchanged (it already used the composer URL).

Fixes jackwener#848
@Astro-Han
Copy link
Copy Markdown
Contributor

I reviewed this locally. It matches the failure mode I reproduced, and npx vitest run clis/twitter/reply.test.ts passes on the PR branch. Looks good to me.

@jackwener
Copy link
Copy Markdown
Owner

Superseded by #860 (same fix, already merged) + #862 (timeout relaxation). Thanks for the contribution!

@jackwener jackwener closed this Apr 7, 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.

twitter reply fails with: 'Could not find the reply text area'

3 participants