fix(twitter): match localized delete menu and poll for late-hydrating article (#2001)#2026
Open
LeoLin990405 wants to merge 1 commit into
Open
Conversation
… article (jackwener#2001) twitter delete failed on a Simplified-Chinese X detail page: (1) the More caret was matched by aria-label === 'More', which X localizes (zh-Hans 更多), and (2) findTargetArticle() ran before the article's self-referential /status/<id> link hydrated on slow networks. Inside buildDeleteScript: - Prefer the language-agnostic [data-testid="caret"] (scoped to the matched article), falling back to a multilingual /^(More|更多)/ aria-label match. - Poll findTargetArticle() for ~5s (20 x 250ms) before giving up. - Broaden the Delete menu item to Delete/删除 and exclude the Lists item in both languages (List/列表).
wearzdk
added a commit
to wearzdk/OpenCLI
that referenced
this pull request
Jun 26, 2026
从 jackwener/opencli 123 个开放 PR 中筛选并入与本产品(内容发布)相关的: - B 核心/daemon/扩展/pipeline 可靠性 23 个 - A twitter/小红书/公众号/tiktok 发布写修复 7 个 - C instagram/linkedin 内容平台读取增强 3 个 跳过 jackwener#2026 jackwener#1960(已被我们 d4e65ab + jackwener#2011 + rednote 适配器取代)。 本地化解决了 4 处冲突,删除 jackwener#1972 冗余 per-command strip。 全量测试 5808 passed,无新增失败(6 个 cli.test.ts 浏览器/守护进程用例为合并前既有、环境相关)。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
opencli twitter deletefails on a Simplified-Chinese X UI from a tweet detail page — two cascading issues plus a localized menu item. Closes #2001.Root cause & fix (all inside
buildDeleteScript)aria-label === 'More', but X localizes it (zh-Hans更多), so the exact English match never hit. → Prefer the language-agnostic[data-testid="caret"](kept scoped to the matchedtargetArticle), falling back to a multilingual/^(More|更多)/aria-label match.findTargetArticle()ran right afterprimaryColumnappeared, but the article's self-referential/status/<id>link (what the matcher keys on) hydrates later on slow networks. → PollfindTargetArticle()for ~5s (20 × 250ms) before giving up.Delete/删除and exclude the Lists item in both languages (List/列表), so从列表中删除/Remove from Listsis never clicked.Article-scoping is preserved (exact-id match via the shared helper), so we still act only on the matched tweet.
Test
Extended
clis/twitter/delete.test.jswith assertions for thedata-testid="caret"primary selector, the/^(More|更多)/fallback, the poll bound, and the localized Delete/删除+列表exclusion.vitest run clis/twitter/delete.test.js→ 4 passed;check:typed-error-lint/check:silent-column-drop→ no new violations.Reported by OpenCLI autofix (locally verified); this implements the same repair with tests.