Skip to content

Twitter の仕様変更に伴う修正#276

Merged
kotonefami merged 6 commits into
mainfrom
fix/twitter-class
May 9, 2026
Merged

Twitter の仕様変更に伴う修正#276
kotonefami merged 6 commits into
mainfrom
fix/twitter-class

Conversation

@kotonefami

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 d value. The previous d value 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>(
kotonefami added 3 commits May 9, 2026 12:46
fadce87 で setTimeout が挿入されているが、消してみても動いた
@kaonasi-biwa さんに聞いても「なんだこれは」となってしまったので、試験的に削除してみる

Fixes #242
@kotonefami kotonefami marked this pull request as ready for review May 9, 2026 04:43
@kotonefami

Copy link
Copy Markdown
Member Author

そろそろマージするつもり

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread src/content/functions/sidebar/utils.ts
Comment thread src/content/functions/sidebar/buttons/settings.tsx
@kotonefami kotonefami merged commit ade270e into main May 9, 2026
4 of 5 checks passed
@kotonefami kotonefami deleted the fix/twitter-class branch May 9, 2026 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug/バグ報告 Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants