Twitter の仕様変更に伴う修正#276
Merged
Merged
Conversation
Closed
Contributor
There was a problem hiding this comment.
Pull request overview
Twitter (X) 側のDOM/スタイル変更に追従し、既存のUIカスタマイズ機能(ツイート操作・サイドバー表示)が動作し続けるようにする修正です。
Changes:
- ツイート「ミュート」操作で参照しているSVG
path[d]セレクタを新しい値に更新 - サイドバーのボタン/アイコン/ラベル周りのクラス名を更新し、新しいTwitter側の構造に追従
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/content/functions/tweetSettings/buttonHTML.tsx | 「ミュート」メニュー項目特定用のSVGパスセレクタを更新 |
| src/content/functions/sidebar/components.tsx | サイドバーボタン描画のクラス名を更新して表示崩れ/不一致に対応 |
Comments suppressed due to low confidence (1)
src/content/functions/tweetSettings/buttonHTML.tsx:100
- The mute menu-item selector is hard-coded to an exact SVG path
dvalue. The previousdvalue still exists in other code paths (e.g., tweet top buttons) and won’t be updated by this change, so mute can remain broken/inconsistent after Twitter’s icon change. Consider centralizing this selector (single constant) and updating all call sites, or prefer a more stable hook (e.g.,data-testid/ARIA label) if available.
article.querySelector<HTMLButtonElement>(`[data-testid="caret"]`).click();
(
await waitForElement<HTMLButtonElement>(
`[role="menuitem"] [d="M16 6.586l4.293-4.293 1.414 1.414-18 18-1.414-1.414 2.657-2.658C3.795 17.063 3 15.875 3 14.5v-5C3 7.567 4.567 6 6.5 6h2.148l4.727-3.781.274-.219H16v4.586zM9.625 7.78L9.351 8H6.5C5.672 8 5 8.672 5 9.5v5c0 .828.672 1.5 1.5 1.5h.086L14 8.586V4.28l-4.375 3.5z"]`,
)
)[0]
.closest<HTMLElement>(`[role="menuitem"]`)
.click();
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -93,7 +93,7 @@ export const tweetButtonData: Record<string, { | |||
| article.querySelector<HTMLButtonElement>(`[data-testid="caret"]`).click(); | |||
| ( | |||
| await waitForElement<HTMLButtonElement>( | |||
fadce87 で setTimeout が挿入されているが、消してみても動いた @kaonasi-biwa さんに聞いても「なんだこれは」となってしまったので、試験的に削除してみる Fixes #242
Member
Author
|
そろそろマージするつもり |
Hibi-10000
approved these changes
May 9, 2026
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.
No description provided.