[ 機能追加 ] WP-CLIダッシュボード画面にダークモード切り替えボタンを追加 - #4
Open
AtsushiA wants to merge 3 commits into
Open
Conversation
- 管理画面ヘッダーに🌙/☀️トグルボタンを設置し、プラグイン画面(見出し・.card・notice)のみダーク表示に切り替え可能に - ターミナル部分(#terminal-container)はもとからダークのため変更なし - 選択状態はlocalStorage(キー: dashboardWpcliColorScheme)に保存し次回アクセス時に反映。新しいAJAX/nonceは追加せず、初期状態は既存どおりライト - FOUC対策として早期反映用のインラインスクリプトを追加 - Version: 1.2.1 -> 1.3.0(package.jsonも同期)
レビュー指摘(植草・UX)対応。状態管理の不整合を解消:
- 可視ラベルは「ダークモード」に固定し、状態表現は aria-pressed のみに一本化(ARIAパターン混在を解消)
- アイコン(🌙/☀️)を .is-dark スコープのCSS(::before)で切替し、JS実行タイミングに依存させない
- 早期インラインscriptで is-dark 付与と同時に aria-pressed=true もセットし、ダーク保存時のボタン状態desyncを解消。scriptはボタンをパース後に実行できるようヘッダー直後へ移動
- 早期scriptのwrap取得を parentElement から closest('.dashboard-wpcli-wrap') に変更(構造変更耐性・安藤提案)
- ダーク時ヘッダーに padding を付与し .card と地続きの帯として成立させる(植草提案)
Owner
Author
|
Comment by vk-agents 📋 司(ディレクター)からの報告 🗂 レビュー実施状況
補足: CodeRabbit 連携は無効( |
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.
関連 issue: #3
概要
WP-CLIダッシュボード(ツール → WP-CLI)の画面に、ページ枠(見出し・
.card・各 notice)をライト/ダークで切り替えるトグルボタンを追加します。ターミナル部分は元々ダーク配色のため変更しません。変更内容
<h1>の隣)に「🌙 ダークモード」トグルボタンを追加。標準トグルボタンパターン(可視ラベル固定+aria-pressedで状態表現、アイコンは CSS で切替)。.dashboard-wpcli-wrap.is-dark配下)に限定し、他の管理画面には影響しない。配色はターミナル部分(#1e1e1e系)に合わせてトーンを統一。prefers-color-schemeには追従しない)。dashboard-wp-cli.php/assets/css/admin.css/assets/js/admin.js/README.md/package.json(バージョン 1.2.1 → 1.3.0)テスト(確認手順)
前提: このプラグインを有効化した WordPress の管理画面「ツール → WP-CLI」を開く。
Before(この PR 以前)
After(この PR)
→ 初期状態が既存どおりライトであること。
.card・notice が暗色に変わり、ボタンのアイコンが ☀️ に変わる。→ ターミナル部分(黒背景の入力エリア)の見た目は変化しないこと。
→ DevTools の Application → Local Storage で、キー
dashboardWpcliColorSchemeの値がdarkになっていることを確認。→ スクリーンリーダーでダーク時に「ダークモード, 押した状態(pressed)」と読み上げられること。
option list)・phar ダウンロードボタン等、既存機能がライト / ダーク両方で従来どおり動作すること。スクリーンショット
UI 変更のため、Before / After の視覚確認(スクリーンショット / GIF)は麗美(e2e)のブラウザ検証で本 PR にコメント添付します。
レビュー状況
Task-queue: https://github.com/AtsushiA/task-queue/issues/1