Skip to content

🎨 Palette: ヘッダーのインタラクティブ要素にキーボードフォーカス時のスタイルを追加#1118

Closed
is0692vs wants to merge 2 commits into
stagingfrom
palette-add-header-focus-styles-6185553528163283608
Closed

🎨 Palette: ヘッダーのインタラクティブ要素にキーボードフォーカス時のスタイルを追加#1118
is0692vs wants to merge 2 commits into
stagingfrom
palette-add-header-focus-styles-6185553528163283608

Conversation

@is0692vs

@is0692vs is0692vs commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

💡 What
ヘッダー内のナビゲーションリンク、ロゴ、ログイン・ログアウトボタンに、キーボードフォーカス時(Tabキー操作時)に表示される視覚的なフォーカスリング(focus-visible スタイル)を追加しました。

🎯 Why
キーボードユーザーが現在どの要素を操作しているのかを明確にし、サイト内のナビゲーションをより簡単かつ確実に直感的に行えるようにするためです。

📸 Before/After

  • Before: キーボードでタブ移動した際に、デフォルトのフォーカスリングが不明瞭であったり、背景に溶け込んでしまったりする状態。
  • After: focus-visible 時にはっきりと見える2pxのリングとオフセットが表示され、ダークモードにも対応した明確なフォーカスインジケータが表示されます。

Accessibility

  • WCAG 2.4.7 (Focus Visible) に準拠し、すべてのインタラクティブな要素に対するフォーカスの可視性を大幅に向上させました。

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

Greptile Summary

ヘッダー内の4つのインタラクティブ要素(ロゴリンク、ナビリンク、ログアウト・ログインボタン)に focus-visible スタイルを追加し、WCAG 2.4.7 (Focus Visible) に準拠したキーボードアクセシビリティを向上させた変更です。ライトモード・ダークモード両対応の focus-visible:ring-2 + ring-offset-2 スタイルが一貫して適用されています。

  • ロゴリンク・ナビリンク・ログアウト/ログインボタンの全4要素に 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 でコントラストを確保。
  • ロゴリンクのみ rounded クラスが未設定のため、フォーカスリングが矩形になる点が他要素と不統一。

Confidence Score: 4/5

スタイルのみの変更でロジックへの影響なし。ロゴリンクの角丸スタイル欠落が見た目の不統一を生むが、機能上の問題はない。

変更はすべて Tailwind CSS クラスの追加のみで、コンポーネントのロジックや動作には一切影響しない。ロゴリンクに rounded クラスがなくフォーカスリングが矩形になるため、他要素(rounded-full)との視覚的一貫性が欠けているが、これは機能的な欠陥ではなくスタイルの改善余地。

apps/web/src/components/header.tsx のロゴリンク部分に rounded-md を追加するとスタイルが統一される。

Important Files Changed

Filename Overview
apps/web/src/components/header.tsx ヘッダー内の4つのインタラクティブ要素(ロゴリンク、ナビリンク、ログアウト・ログインボタン)に focus-visible スタイルを追加。ロゴリンクのみ rounded クラスがなく、フォーカスリングが矩形になる点が他要素と若干不統一。

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[キーボードTabキー操作] --> B{フォーカス対象要素}
    B --> C[ロゴリンク\nOpenShelf]
    B --> D[ナビリンク\n各 navItem]
    B --> E[ログアウトボタン]
    B --> F[GitHubでログインボタン]

    C --> G["focus-visible:ring-2\nfocus-visible:ring-gray-900\n⚠️ rounded なし → 矩形リング"]
    D --> H["focus-visible:ring-2\nfocus-visible:ring-gray-900\nrounded-full → 丸形リング"]
    E --> I["focus-visible:ring-2\nfocus-visible:ring-gray-900\nrounded-full → 丸形リング"]
    F --> J["focus-visible:ring-2\nfocus-visible:ring-gray-900\nrounded-full → 丸形リング"]

    G --> K[ダークモード対応\ndark:ring-gray-100\ndark:ring-offset-gray-950]
    H --> K
    I --> K
    J --> K
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[ロゴリンク\nOpenShelf]
    B --> D[ナビリンク\n各 navItem]
    B --> E[ログアウトボタン]
    B --> F[GitHubでログインボタン]

    C --> G["focus-visible:ring-2\nfocus-visible:ring-gray-900\n⚠️ rounded なし → 矩形リング"]
    D --> H["focus-visible:ring-2\nfocus-visible:ring-gray-900\nrounded-full → 丸形リング"]
    E --> I["focus-visible:ring-2\nfocus-visible:ring-gray-900\nrounded-full → 丸形リング"]
    F --> J["focus-visible:ring-2\nfocus-visible:ring-gray-900\nrounded-full → 丸形リング"]

    G --> K[ダークモード対応\ndark:ring-gray-100\ndark:ring-offset-gray-950]
    H --> K
    I --> K
    J --> K
Loading
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
apps/web/src/components/header.tsx:25
ロゴリンク(「OpenShelf」)にのみ `rounded` クラスが付いていないため、フォーカスリングが矩形になります。ナビリンクやボタンはすべて `rounded-full` で丸形リングが表示されるため、視覚的な統一感が損なわれます。`rounded-md` を追加することで他の要素と近いスタイルになります。

```suggestion
            className="rounded-md text-base font-semibold tracking-tight text-gray-950 transition-colors hover:text-gray-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-900 focus-visible:ring-offset-2 dark:text-gray-50 dark:hover:text-gray-300 dark:focus-visible:ring-gray-100 dark:focus-visible:ring-offset-gray-950"
```

Reviews (1): Last reviewed commit: "🎨 Palette: ヘッダーのインタラクティブ要素にキーボードフォーカス時の..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

Summary by CodeRabbit

  • Accessibility Improvements
    • Improved keyboard focus visibility for navigation links, the OpenShelf brand link, and authentication buttons.
    • Added dark-mode support for focus indicators while preserving existing hover and active states.

is0692vs and others added 2 commits July 14, 2026 09:32
Release: staging -> main (2026-07-14 00:29)
@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 16, 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 16, 2026 2:53pm

@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 →

@github-actions
github-actions Bot changed the base branch from main to staging July 16, 2026 14:53
@github-actions

Copy link
Copy Markdown

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

@codecov

codecov Bot commented Jul 16, 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 adds focus-visible styles to the header links and buttons to improve keyboard navigation. The reviewer recommends replacing the Tailwind ring and ring-offset utilities with native outline and outline-offset styles. This adjustment ensures compatibility with Tailwind CSS v4 and improves accessibility, particularly for Windows High Contrast Mode.

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.

<Link
href="/"
className="text-base font-semibold tracking-tight text-gray-950 transition-colors hover:text-gray-700 dark:text-gray-50 dark:hover:text-gray-300"
className="text-base font-semibold tracking-tight text-gray-950 transition-colors hover:text-gray-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-900 focus-visible:ring-offset-2 dark:text-gray-50 dark:hover:text-gray-300 dark:focus-visible:ring-gray-100 dark:focus-visible:ring-offset-gray-950"

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

Tailwind CSS v4(globals.css@import "tailwindcss"; が使用されているため)では、従来の ring-offset-* ユーティリティ(ring-offset-2ring-offset-gray-950 など)は非推奨または削除されています。

また、box-shadow を使用する ring は、Windows の高コントラストモード(Forced Colors Mode)でフォーカスリングが表示されないというアクセシビリティ上の課題があります。

代わりに、ブラウザのネイティブな outlineoutline-offset を使用することをお勧めします。これにより、Tailwind v4 との互換性が保たれ、コードもシンプルになり、アクセシビリティも向上します。

Suggested change
className="text-base font-semibold tracking-tight text-gray-950 transition-colors hover:text-gray-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-900 focus-visible:ring-offset-2 dark:text-gray-50 dark:hover:text-gray-300 dark:focus-visible:ring-gray-100 dark:focus-visible:ring-offset-gray-950"
className="text-base font-semibold tracking-tight text-gray-950 transition-colors hover:text-gray-700 focus-visible:outline-2 focus-visible:outline-gray-900 focus-visible:outline-offset-2 dark:text-gray-50 dark:hover:text-gray-300 dark:focus-visible:outline-gray-100"

href={item.href}
aria-current={isActive ? "page" : undefined}
className={`rounded-full px-3 py-1.5 transition-colors ${
className={`rounded-full px-3 py-1.5 transition-colors 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 ${

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

上記と同様に、Tailwind CSS v4 との互換性およびアクセシビリティ向上のため、ringring-offset の代わりにネイティブな outlineoutline-offset を使用することをお勧めします。

Suggested change
className={`rounded-full px-3 py-1.5 transition-colors 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 ${
className={`rounded-full px-3 py-1.5 transition-colors focus-visible:outline-2 focus-visible:outline-gray-900 focus-visible:outline-offset-2 dark:focus-visible:outline-gray-100 ${

type="button"
onClick={logout}
className="rounded-full border border-gray-300 px-3 py-1.5 text-sm text-gray-700 transition-colors hover:bg-gray-100 hover:text-gray-900 dark:border-gray-700 dark:text-gray-200 dark:hover:bg-gray-800 dark:hover:text-gray-50"
className="rounded-full border border-gray-300 px-3 py-1.5 text-sm text-gray-700 transition-colors hover:bg-gray-100 hover:text-gray-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-900 focus-visible:ring-offset-2 dark:border-gray-700 dark:text-gray-200 dark:hover:bg-gray-800 dark:hover:text-gray-50 dark:focus-visible:ring-gray-100 dark:focus-visible:ring-offset-gray-950"

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

上記と同様に、Tailwind CSS v4 との互換性およびアクセシビリティ向上のため、ringring-offset の代わりにネイティブな outlineoutline-offset を使用することをお勧めします。

Suggested change
className="rounded-full border border-gray-300 px-3 py-1.5 text-sm text-gray-700 transition-colors hover:bg-gray-100 hover:text-gray-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-900 focus-visible:ring-offset-2 dark:border-gray-700 dark:text-gray-200 dark:hover:bg-gray-800 dark:hover:text-gray-50 dark:focus-visible:ring-gray-100 dark:focus-visible:ring-offset-gray-950"
className="rounded-full border border-gray-300 px-3 py-1.5 text-sm text-gray-700 transition-colors hover:bg-gray-100 hover:text-gray-900 focus-visible:outline-2 focus-visible:outline-gray-900 focus-visible:outline-offset-2 dark:border-gray-700 dark:text-gray-200 dark:hover:bg-gray-800 dark:hover:text-gray-50 dark:focus-visible:outline-gray-100"

type="button"
onClick={login}
className="rounded-full bg-gray-900 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-gray-700 dark:bg-white dark:text-gray-900 dark:hover:bg-gray-200"
className="rounded-full bg-gray-900 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-gray-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-900 focus-visible:ring-offset-2 dark:bg-white dark:text-gray-900 dark:hover:bg-gray-200 dark:focus-visible:ring-gray-100 dark:focus-visible:ring-offset-gray-950"

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

上記と同様に、Tailwind CSS v4 との互換性およびアクセシビリティ向上のため、ringring-offset の代わりにネイティブな outlineoutline-offset を使用することをお勧めします。

Suggested change
className="rounded-full bg-gray-900 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-gray-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-900 focus-visible:ring-offset-2 dark:bg-white dark:text-gray-900 dark:hover:bg-gray-200 dark:focus-visible:ring-gray-100 dark:focus-visible:ring-offset-gray-950"
className="rounded-full bg-gray-900 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-gray-700 focus-visible:outline-2 focus-visible:outline-gray-900 focus-visible:outline-offset-2 dark:bg-white dark:text-gray-900 dark:hover:bg-gray-200 dark:focus-visible:outline-gray-100"

<Link
href="/"
className="text-base font-semibold tracking-tight text-gray-950 transition-colors hover:text-gray-700 dark:text-gray-50 dark:hover:text-gray-300"
className="text-base font-semibold tracking-tight text-gray-950 transition-colors hover:text-gray-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-900 focus-visible:ring-offset-2 dark:text-gray-50 dark:hover:text-gray-300 dark:focus-visible:ring-gray-100 dark:focus-visible:ring-offset-gray-950"

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.

P2 ロゴリンク(「OpenShelf」)にのみ rounded クラスが付いていないため、フォーカスリングが矩形になります。ナビリンクやボタンはすべて rounded-full で丸形リングが表示されるため、視覚的な統一感が損なわれます。rounded-md を追加することで他の要素と近いスタイルになります。

Suggested change
className="text-base font-semibold tracking-tight text-gray-950 transition-colors hover:text-gray-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-900 focus-visible:ring-offset-2 dark:text-gray-50 dark:hover:text-gray-300 dark:focus-visible:ring-gray-100 dark:focus-visible:ring-offset-gray-950"
className="rounded-md text-base font-semibold tracking-tight text-gray-950 transition-colors hover:text-gray-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-900 focus-visible:ring-offset-2 dark:text-gray-50 dark:hover:text-gray-300 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: 25

Comment:
ロゴリンク(「OpenShelf」)にのみ `rounded` クラスが付いていないため、フォーカスリングが矩形になります。ナビリンクやボタンはすべて `rounded-full` で丸形リングが表示されるため、視覚的な統一感が損なわれます。`rounded-md` を追加することで他の要素と近いスタイルになります。

```suggestion
            className="rounded-md text-base font-semibold tracking-tight text-gray-950 transition-colors hover:text-gray-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-900 focus-visible:ring-offset-2 dark:text-gray-50 dark:hover:text-gray-300 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!

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 31f0b462-e3c1-409b-96f8-85bf2de6a49f

📥 Commits

Reviewing files that changed from the base of the PR and between e91b8d8 and 830e30f.

📒 Files selected for processing (1)
  • apps/web/src/components/header.tsx

📝 Walkthrough

Walkthrough

Header navigation links and authentication buttons now include keyboard-visible focus rings and offsets, with dark-mode variants, while preserving existing hover and active styling.

Changes

Header focus styling

Layer / File(s) Summary
Header control focus states
apps/web/src/components/header.tsx
Brand, navigation, logout, and GitHub login controls add focus-visible ring and offset classes, including dark-mode variants.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related PRs

Suggested labels: enhancement

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding keyboard focus styles to interactive header elements.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch palette-add-header-focus-styles-6185553528163283608

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.


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.

@is0692vs

Copy link
Copy Markdown
Contributor Author

Closing because this Jules-managed branch cannot maintain a stable review-loop head: after the target branch is incorporated or a review fix is pushed, the bot appends the original generated change again. The current head is therefore not reliably the commit that passed target-fresh CI and review.

@is0692vs is0692vs closed this Jul 18, 2026
@is0692vs
is0692vs deleted the palette-add-header-focus-styles-6185553528163283608 branch July 18, 2026 09:15
@google-labs-jules

Copy link
Copy Markdown
Contributor

Closing because this Jules-managed branch cannot maintain a stable review-loop head: after the target branch is incorporated or a review fix is pushed, the bot appends the original generated change again. The current head is therefore not reliably the commit that passed target-fresh CI and review.

承知いたしました。この作業は不要になったものとして、タスクを終了いたします。

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant