From f881124bdf790a47cca14e589e4a6dac86fdca55 Mon Sep 17 00:00:00 2001 From: Timmy Date: Wed, 22 Apr 2026 18:03:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20v0.18=20=E2=80=94=20=E6=90=9C=E5=B0=8B?= =?UTF-8?q?=E8=AA=9E=E6=B3=95=20state:open=20=E4=B8=8D=E5=86=8D=E8=A2=AB?= =?UTF-8?q?=E7=BF=BB=EF=BC=88=E4=BF=AE=E5=8A=9F=E8=83=BD=E6=80=A7=E7=81=BD?= =?UTF-8?q?=E9=9B=A3=EF=BC=89+=20=E8=B2=A2=E7=8D=BB=20banner=20=E8=A3=9C?= =?UTF-8?q?=E7=AC=AC=E4=B8=80=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 搜尋框:新版 React SearchBar 用 包住 is:issue state:open,外層 form 只有 role="form" 不是 role="search", 既有 [role="searchbox"] / form[role="search"] 全部抓不到,導致 state:open 被翻成 state:開啟中,點擊會破壞搜尋功能。 新增 skip: - [data-type="filter-expression"] / [data-type="filter"] / [data-type="filter-value"] - .styled-input-container 貢獻 banner:整句詞庫條目永遠不匹配(contributing guidelines 在 裡, 跨不過節點邊界),實際只靠三個片段拼。原本缺前段「If you have a bug or an idea, read the」對應,所以顯示半翻。補上該片段條目,移除無效的整句條目與 read the contributing guidelines 條目。 Co-Authored-By: Claude Opus 4.7 (1M context) --- github-zh-tw.user.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/github-zh-tw.user.js b/github-zh-tw.user.js index a72709e..b6fe12c 100644 --- a/github-zh-tw.user.js +++ b/github-zh-tw.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name GitHub 中文化 (繁體) // @namespace https://github.com/scriptscat/scriptcat -// @version 0.17 +// @version 0.18 // @description 幫 GitHub 導覽列、按鈕、屬性換成繁體中文,支援 SPA 動態更新,不亂翻、不卡頓。 // @match https://github.com/* // @run-at document-idle @@ -182,8 +182,9 @@ ['Recently updated', '最近更新'], ['Dismiss', '關閉提示'], ['Want to contribute to', '想貢獻給'], - ['If you have a bug or an idea, read the contributing guidelines before opening an issue', '若您發現錯誤或有新想法,請先閱讀貢獻指引再開啟問題'], - ['read the contributing guidelines', '請閱讀貢獻指引'], + // 此橫幅實際是三段文字節點:前段文字 + contributing guidelines + 後段文字。 + // 整句條目永遠不會匹配(跨不過 邊界),只靠三個片段湊。 + ['If you have a bug or an idea, read the', '若您發現錯誤或有新想法,請先閱讀'], ['contributing guidelines', '貢獻指引'], ['before opening an issue', '再開啟問題'], ['Never', '從未'], @@ -312,6 +313,12 @@ '.subnav-search-context', 'input[name="q"] ~ *', '.pl-c1', '.pl-s', '.pl-en', '.pl-k', '.pl-v', '.pl-smi', '.pl-s1', + // 2026 新版 React SearchBar:filter 語法 token 用 data-type 標記(is / state / open / issue 等), + // 外層 form 只有 role="form" 不是 role="search",原規則抓不到。 + '[data-type="filter-expression"]', + '[data-type="filter"]', + '[data-type="filter-value"]', + '.styled-input-container', // Labels(使用者自定義 label 顏色塊) 'a.IssueLabel', '.IssueLabel',