Skip to content

🎨 Palette: キーボードフォーカス時の視認性向上#1102

Closed
is0692vs wants to merge 1 commit into
stagingfrom
palette/improve-focus-visible-styles-14607321236183531301
Closed

🎨 Palette: キーボードフォーカス時の視認性向上#1102
is0692vs wants to merge 1 commit into
stagingfrom
palette/improve-focus-visible-styles-14607321236183531301

Conversation

@is0692vs

@is0692vs is0692vs commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

💡 What: ヘッダーやフィードボタンの各種ボタン・リンクに focus-visible クラスを追加し、キーボード操作時のフォーカスインジケーターを明確にしました。

🎯 Why: キーボードユーザーが現在どこにフォーカスが当たっているかを視覚的に把握しやすくするため。

📸 Before/After: N/A

♿ Accessibility: キーボードナビゲーション時の視認性が向上しました。


PR created automatically by Jules for task 14607321236183531301 started by @is0692vs

Greptile Summary

ヘッダーとフィードボタンのインタラクティブ要素(ナビリンク・ログアウト/ログインボタン・コピーボタン・開くリンク・textarea)に focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-900 focus-visible:ring-offset-2 とダークモード対応クラスを追加し、キーボードナビゲーション時のフォーカスインジケーターを改善するPRです。

  • header.tsx: ナビリンク・ログアウトボタン・ログインボタンの3箇所に focus-visible クラスを追加。ただし「OpenShelf」ロゴリンクが未対応のまま残っています。
  • feed-button.tsx: トリガーボタン(デフォルト className)・dialog内の textarea・コピーボタン・開くリンクの4箇所に一貫して focus-visible クラスを追加。こちらは網羅的に対応されています。
  • .Jules/palette.md: 今回採用したフォーカスリングパターンをチームの学習ログとして記録。

Confidence Score: 4/5

アクセシビリティ向上のための小規模なスタイル追加のみで、機能ロジックへの変更はなくマージしても安全です。

「OpenShelf」ロゴリンクへの対応漏れとアクティブ状態でのフォーカスリングコントラスト問題があり、PRの目的(すべてのインタラクティブ要素への対応)が完全には達成されていません。ただし既存の動作を壊す変更はなく、アクセシビリティは全体的に向上しています。

apps/web/src/components/header.tsx — ロゴリンクへの対応漏れとアクティブリンクのコントラストについて確認が必要です。

Important Files Changed

Filename Overview
.Jules/palette.md focus-visible パターンのベストプラクティスをチームの学習ログとして記録。内容は適切。
apps/web/src/components/feed-button.tsx デフォルト className・textarea・コピーボタン・開くリンクに一貫して focus-visible クラスを追加。対応は網羅的で問題なし。
apps/web/src/components/header.tsx ナビリンク・ログアウトボタン・ログインボタンに focus-visible クラスを追加したが、「OpenShelf」ロゴリンクが未対応。アクティブなナビリンクでリングと背景が同色になる可能性あり。

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[キーボード操作 Tab キー] --> B{フォーカス対象}
    B --> C[Header: OpenShelfロゴリンク]
    B --> D[Header: ナビリンク]
    B --> E[Header: ログアウトボタン]
    B --> F[Header: ログインボタン]
    B --> G[FeedButton: トリガーボタン]
    C -->|❌ focus-visible 未対応| C1[フォーカスリング非表示]
    D -->|✅ focus-visible 追加| D1[ring-2 ring-gray-900 表示]
    E -->|✅ focus-visible 追加| E1[ring-2 ring-gray-900 表示]
    F -->|✅ focus-visible 追加| F1[ring-2 ring-gray-900 表示]
    G -->|✅ focus-visible 追加| G1[ring-2 ring-gray-900 表示]
    G1 --> H[ダイアログ開く]
    H --> I[textarea]
    H --> J[コピーボタン]
    H --> K[開くリンク]
    I -->|✅ focus-visible 追加| I1[ring-2 ring-gray-900 表示]
    J -->|✅ focus-visible 追加| J1[ring-2 ring-gray-900 表示]
    K -->|✅ focus-visible 追加| K1[ring-2 ring-gray-900 表示]
    D1 --> L{アクティブ状態?}
    L -->|Yes: bg-gray-900 + ring-gray-900| M[⚠️ 同色でコントラスト低]
    L -->|No| N[✅ 適切なコントラスト]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[キーボード操作 Tab キー] --> B{フォーカス対象}
    B --> C[Header: OpenShelfロゴリンク]
    B --> D[Header: ナビリンク]
    B --> E[Header: ログアウトボタン]
    B --> F[Header: ログインボタン]
    B --> G[FeedButton: トリガーボタン]
    C -->|❌ focus-visible 未対応| C1[フォーカスリング非表示]
    D -->|✅ focus-visible 追加| D1[ring-2 ring-gray-900 表示]
    E -->|✅ focus-visible 追加| E1[ring-2 ring-gray-900 表示]
    F -->|✅ focus-visible 追加| F1[ring-2 ring-gray-900 表示]
    G -->|✅ focus-visible 追加| G1[ring-2 ring-gray-900 表示]
    G1 --> H[ダイアログ開く]
    H --> I[textarea]
    H --> J[コピーボタン]
    H --> K[開くリンク]
    I -->|✅ focus-visible 追加| I1[ring-2 ring-gray-900 表示]
    J -->|✅ focus-visible 追加| J1[ring-2 ring-gray-900 表示]
    K -->|✅ focus-visible 追加| K1[ring-2 ring-gray-900 表示]
    D1 --> L{アクティブ状態?}
    L -->|Yes: bg-gray-900 + ring-gray-900| M[⚠️ 同色でコントラスト低]
    L -->|No| N[✅ 適切なコントラスト]
Loading

Comments Outside Diff (2)

  1. apps/web/src/components/header.tsx, line 23-28 (link)

    P2 「OpenShelf」ロゴリンクの focus-visible 対応漏れ

    このPRはヘッダー内のインタラクティブ要素へのフォーカスリング追加を目的としていますが、「OpenShelf」ロゴの Link コンポーネント(23行目)が対応漏れになっています。キーボードナビゲーション時に Tab キーでこのリンクにフォーカスが当たっても、フォーカスインジケーターが表示されません。他のリンク・ボタンと同様に focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-900 focus-visible:ring-offset-2 dark:focus-visible:ring-gray-100 dark:focus-visible:ring-offset-gray-950 を追加してください。

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: apps/web/src/components/header.tsx
    Line: 23-28
    
    Comment:
    **「OpenShelf」ロゴリンクの `focus-visible` 対応漏れ**
    
    このPRはヘッダー内のインタラクティブ要素へのフォーカスリング追加を目的としていますが、「OpenShelf」ロゴの `Link` コンポーネント(23行目)が対応漏れになっています。キーボードナビゲーション時に Tab キーでこのリンクにフォーカスが当たっても、フォーカスインジケーターが表示されません。他のリンク・ボタンと同様に `focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-900 focus-visible:ring-offset-2 dark:focus-visible:ring-gray-100 dark:focus-visible:ring-offset-gray-950` を追加してください。
    
    How can I resolve this? If you propose a fix, please make it concise.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

  2. apps/web/src/components/header.tsx, line 41-45 (link)

    P2 アクティブ状態のナビリンクでフォーカスリングのコントラストが低い

    アクティブな navリンクは bg-gray-900(ライト)/ bg-gray-100(ダーク)の背景を持ちますが、フォーカスリングも ring-gray-900(ライト)/ ring-gray-100(ダーク)として設定されているため、リングとボタン本体が同色になります。ring-offset-2 による2pxの白い間隔があるため完全に不可視ではありませんが、リング自体がボタン外縁と同色で一体化して見えるため、視認性が目的を十分に達成できない可能性があります。ライトモードのアクティブ状態では ring-white を、ダークモードのアクティブ状態では ring-gray-900 を使うよう条件分岐させるか、ring-offset の色を明示的に指定することを検討してください。

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: apps/web/src/components/header.tsx
    Line: 41-45
    
    Comment:
    **アクティブ状態のナビリンクでフォーカスリングのコントラストが低い**
    
    アクティブな navリンクは `bg-gray-900`(ライト)/ `bg-gray-100`(ダーク)の背景を持ちますが、フォーカスリングも `ring-gray-900`(ライト)/ `ring-gray-100`(ダーク)として設定されているため、リングとボタン本体が同色になります。`ring-offset-2` による2pxの白い間隔があるため完全に不可視ではありませんが、リング自体がボタン外縁と同色で一体化して見えるため、視認性が目的を十分に達成できない可能性があります。ライトモードのアクティブ状態では `ring-white` を、ダークモードのアクティブ状態では `ring-gray-900` を使うよう条件分岐させるか、`ring-offset` の色を明示的に指定することを検討してください。
    
    How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 2
apps/web/src/components/header.tsx:23-28
**「OpenShelf」ロゴリンクの `focus-visible` 対応漏れ**

このPRはヘッダー内のインタラクティブ要素へのフォーカスリング追加を目的としていますが、「OpenShelf」ロゴの `Link` コンポーネント(23行目)が対応漏れになっています。キーボードナビゲーション時に Tab キーでこのリンクにフォーカスが当たっても、フォーカスインジケーターが表示されません。他のリンク・ボタンと同様に `focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-900 focus-visible:ring-offset-2 dark:focus-visible:ring-gray-100 dark:focus-visible:ring-offset-gray-950` を追加してください。

### Issue 2 of 2
apps/web/src/components/header.tsx:41-45
**アクティブ状態のナビリンクでフォーカスリングのコントラストが低い**

アクティブな navリンクは `bg-gray-900`(ライト)/ `bg-gray-100`(ダーク)の背景を持ちますが、フォーカスリングも `ring-gray-900`(ライト)/ `ring-gray-100`(ダーク)として設定されているため、リングとボタン本体が同色になります。`ring-offset-2` による2pxの白い間隔があるため完全に不可視ではありませんが、リング自体がボタン外縁と同色で一体化して見えるため、視認性が目的を十分に達成できない可能性があります。ライトモードのアクティブ状態では `ring-white` を、ダークモードのアクティブ状態では `ring-gray-900` を使うよう条件分岐させるか、`ring-offset` の色を明示的に指定することを検討してください。

Reviews (1): Last reviewed commit: "feat(web): improve keyboard focus styles" | Re-trigger Greptile

Co-authored-by: is0692vs <135803462+is0692vs@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@vercel

vercel Bot commented Jul 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
open-shelf Ignored Ignored Jul 12, 2026 3:19pm

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@is0692vs, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 43 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: daffd337-99f6-48ce-a63c-3b201fa80588

📥 Commits

Reviewing files that changed from the base of the PR and between 563ff80 and 81c8783.

📒 Files selected for processing (3)
  • .Jules/palette.md
  • apps/web/src/components/feed-button.tsx
  • apps/web/src/components/header.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch palette/improve-focus-visible-styles-14607321236183531301

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@dosubot dosubot Bot added the enhancement New feature or request label Jul 12, 2026
@github-actions
github-actions Bot changed the base branch from main to staging July 12, 2026 15:19
@github-actions

Copy link
Copy Markdown

このリポジトリでは staging 先行フローを採用しています。PR のターゲットを staging に変更しました。staging で動作確認後、stagingmain の PR を作成してください。

@codecov

codecov Bot commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request documents and implements focus-visible accessibility styles across interactive elements in the FeedButton and Header components, aligning with a new learning entry added to .Jules/palette.md. Feedback on the changes suggests refactoring the FeedButton component to safely merge external className props with the default styles rather than completely overwriting them, ensuring that critical accessibility styles are preserved.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines 14 to 19
export function FeedButton({
url,
className = "rounded-md border border-gray-300 px-3 py-1.5 text-sm hover:bg-gray-50 dark:border-gray-700 dark:hover:bg-gray-800",
className = "rounded-md border border-gray-300 px-3 py-1.5 text-sm hover:bg-gray-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-900 focus-visible:ring-offset-2 dark:border-gray-700 dark:hover:bg-gray-800 dark:focus-visible:ring-gray-100 dark:focus-visible:ring-offset-gray-950",
label = "📡 Feed",
ariaLabel,
}: FeedButtonProps) {

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.

medium

改善の提案 (Maintainability)

FeedButton コンポーネントに外部から className プロップが渡された場合、デフォルトのスタイル(今回追加された focus-visible などの重要なアクセシビリティスタイルを含む)が完全に上書きされてしまいます。

外部からのカスタムクラスを適用しつつ、デフォルトのスタイルも維持できるように、クラス名をマージする実装に改善することを推奨します。

Suggested change
export function FeedButton({
url,
className = "rounded-md border border-gray-300 px-3 py-1.5 text-sm hover:bg-gray-50 dark:border-gray-700 dark:hover:bg-gray-800",
className = "rounded-md border border-gray-300 px-3 py-1.5 text-sm hover:bg-gray-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-900 focus-visible:ring-offset-2 dark:border-gray-700 dark:hover:bg-gray-800 dark:focus-visible:ring-gray-100 dark:focus-visible:ring-offset-gray-950",
label = "📡 Feed",
ariaLabel,
}: FeedButtonProps) {
export function FeedButton({
url,
className: customClassName,
label = "📡 Feed",
ariaLabel,
}: FeedButtonProps) {
const defaultClassName = "rounded-md border border-gray-300 px-3 py-1.5 text-sm hover:bg-gray-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-900 focus-visible:ring-offset-2 dark:border-gray-700 dark:hover:bg-gray-800 dark:focus-visible:ring-gray-100 dark:focus-visible:ring-offset-gray-950";
const className = customClassName ? defaultClassName + " " + customClassName : defaultClassName;

@is0692vs

Copy link
Copy Markdown
Contributor Author

Closing as semantically superseded by the focused FeedButton #1116 and Header #1118 PRs. This older combined branch conflicts with staging and would duplicate both changes.

@is0692vs is0692vs closed this Jul 17, 2026
@is0692vs
is0692vs deleted the palette/improve-focus-visible-styles-14607321236183531301 branch July 17, 2026 02:45
@google-labs-jules

Copy link
Copy Markdown
Contributor

Closing as semantically superseded by the focused FeedButton #1116 and Header #1118 PRs. This older combined branch conflicts with staging and would duplicate both changes.

了解しました。他の個別のPRによって既に機能が上書きされていること、およびコンフリクトを回避するためにクローズされることを承知いたしました。本タスクの作業を終了します。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant