Skip to content

🎨 Palette: エラーメッセージのアクセシビリティ向上#1114

Closed
is0692vs wants to merge 2 commits into
stagingfrom
feature/error-message-a11y-970719122761310663
Closed

🎨 Palette: エラーメッセージのアクセシビリティ向上#1114
is0692vs wants to merge 2 commits into
stagingfrom
feature/error-message-a11y-970719122761310663

Conversation

@is0692vs

@is0692vs is0692vs commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

💡 What:
アプリ全体のエラーメッセージ(フォームのバリデーションエラーやAPI取得エラーなど)を表示するコンテナ要素(<p><div>)に role="alert" を追加しました。

🎯 Why:
エラーが発生した際、視覚的なフィードバックだけでなく、スクリーンリーダーユーザーにも即座にエラー内容が通知されるようにし、アクセシビリティを向上させるためです。

📸 Before/After:
視覚的な変更はありません。

Accessibility:
動的に表示されるエラーメッセージに role="alert" を付与することで、フォーカスを移動させなくてもスクリーンリーダーがエラーを読み上げるようになります。


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

Greptile Summary

このPRは、アプリ全体のエラーメッセージ表示要素(<p> および <div>)に role="alert" を追加し、スクリーンリーダーへの即時通知を実現するアクセシビリティ改善です。変更はすべて一貫しており、データ取得後に動的にレンダリングされるエラー要素への適用として WAI-ARIA の仕様に準拠しています。

  • フォームのインラインエラー(collections/neworgs/new)と、ページ全体を置き換えるフェッチエラー(6コンポーネント)の計8箇所に role=\"alert\" を追加。
  • .Jules/palette.md に2026-06-22付けの学習ログを追記。2026-06-21の学習(成功/エラーを同一コンテナで出し分ける場合は条件付きロールを使う)との矛盾なし(変更箇所はすべてエラー専用コンテナ)。

Confidence Score: 5/5

すべての変更が既存のエラー専用コンテナへの role=alert 追加のみで、ロジックや UI の破壊的変更は一切含まれていません。

変更内容は属性の追加のみで、コンポーネントのレンダリングロジックやデータフローへの影響はゼロです。動的に挿入されるエラー要素への role=alert 適用は WAI-ARIA 仕様の意図したユースケースそのものであり、既存の .Jules/palette.md に記載されたルール(成功・エラーを同一コンテナで切り替える場合は条件付きロールを使う)とも競合しません。

特に注意が必要なファイルはありません。

Important Files Changed

Filename Overview
.Jules/palette.md 2026-06-22付けの学習ログ追記。既存の2026-06-21ルール(条件付きロール)との矛盾なし。
apps/web/src/app/collections/new/page.tsx フォームのインラインエラー

に role="alert" を追加。エラー専用コンテナへの適用として正しい。

apps/web/src/app/orgs/new/page.tsx フォームのインラインエラー

に role="alert" を追加。エラー専用コンテナへの適用として正しい。

apps/web/src/app/orgs/[slug]/org-page-client.tsx フェッチエラー時のページ全体置換
に role="alert" を追加。
apps/web/src/app/orgs/[slug]/settings/page.tsx 初期ロードのフェッチエラー
に role="alert" を追加。設定ページ内の保存結果メッセージは別コンポーネントのため影響なし。
apps/web/src/app/papers/[id]/paper-detail-client.tsx フェッチエラー時のページ全体置換
に role="alert" を追加。
apps/web/src/app/users/[id]/c/[collectionSlug]/user-collection-page-client.tsx フェッチエラー時のページ全体置換
に role="alert" を追加。
apps/web/src/app/users/[id]/user-page-client.tsx フェッチエラー時のページ全体置換
に role="alert" を追加。

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant U as ユーザー
    participant R as React Component
    participant A as API
    participant SR as スクリーンリーダー

    U->>R: ページアクセス
    R->>A: データ取得リクエスト
    A-->>R: エラーレスポンス
    R->>R: setError(message)
    R-->>U: "role=alert 要素をレンダリング"
    Note over R,SR: DOM に role=alert 要素が挿入される
    R-->>SR: "aria-live=assertive として即座に読み上げ"
    SR-->>U: エラーメッセージを音声通知
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"}}}%%
sequenceDiagram
    participant U as ユーザー
    participant R as React Component
    participant A as API
    participant SR as スクリーンリーダー

    U->>R: ページアクセス
    R->>A: データ取得リクエスト
    A-->>R: エラーレスポンス
    R->>R: setError(message)
    R-->>U: "role=alert 要素をレンダリング"
    Note over R,SR: DOM に role=alert 要素が挿入される
    R-->>SR: "aria-live=assertive として即座に読み上げ"
    SR-->>U: エラーメッセージを音声通知
Loading

Reviews (1): Last reviewed commit: "🎨 Palette: エラーメッセージにrole="alert"を追加しアクセ..." | Re-trigger Greptile

Context used:

  • Context used - 日本語で!!! (source)

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

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

@dosubot dosubot Bot added the javascript Pull requests that update javascript code label Jul 14, 2026
@coderabbitai

coderabbitai Bot commented Jul 14, 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: 34 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: 4effc10b-1900-4950-bfe9-6f43d6dba4f0

📥 Commits

Reviewing files that changed from the base of the PR and between e91b8d8 and 7819c5d.

📒 Files selected for processing (9)
  • .Jules/palette.md
  • apps/web/src/app/collections/new/page.tsx
  • apps/web/src/app/orgs/[slug]/c/[collectionSlug]/org-collection-page-client.tsx
  • apps/web/src/app/orgs/[slug]/org-page-client.tsx
  • apps/web/src/app/orgs/[slug]/settings/page.tsx
  • apps/web/src/app/orgs/new/page.tsx
  • apps/web/src/app/papers/[id]/paper-detail-client.tsx
  • apps/web/src/app/users/[id]/c/[collectionSlug]/user-collection-page-client.tsx
  • apps/web/src/app/users/[id]/user-page-client.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/error-message-a11y-970719122761310663

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.

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

Copy link
Copy Markdown

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

@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 improves the accessibility of error messages across several pages by adding the role="alert" attribute, aligning with the newly documented guidelines in .Jules/palette.md. The review feedback suggests rendering the error container elements unconditionally rather than conditionally mounting them (e.g., {error && <p role="alert">...}), which ensures that screen readers like NVDA or JAWS can reliably detect the live region and announce the error message when it appears.

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.

</div>

{error && <p className="text-sm text-red-600">{error}</p>}
{error && <p role="alert" className="text-sm text-red-600">{error}</p>}

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

スクリーンリーダーの互換性を最大化するため、role="alert" を持つ要素は最初から DOM 上に存在させ、そのテキストコンテンツを動的に更新することが推奨されます。要素自体を {error && ...} のように条件付きでマウントすると、一部のスクリーンリーダー(NVDA や JAWS など)が新しいライブリージョンを正しく検出できず、エラーメッセージを読み上げない場合があります。

この要素には余白(margin や padding)が設定されていないため、常にレンダリングしておいても表示上の影響はありません。

Suggested change
{error && <p role="alert" className="text-sm text-red-600">{error}</p>}
<p role="alert" className="text-sm text-red-600">{error}</p>

</div>

{error && <p className="text-sm text-red-600">{error}</p>}
{error && <p role="alert" className="text-sm text-red-600">{error}</p>}

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

スクリーンリーダーの互換性を最大化するため、role="alert" を持つ要素は最初から DOM 上に存在させ、そのテキストコンテンツを動的に更新することが推奨されます。要素自体を {error && ...} のように条件付きでマウントすると、一部のスクリーンリーダー(NVDA や JAWS など)が新しいライブリージョンを正しく検出できず、エラーメッセージを読み上げない場合があります。

この要素には余白(margin や padding)が設定されていないため、常にレンダリングしておいても表示上の影響はありません。

Suggested change
{error && <p role="alert" className="text-sm text-red-600">{error}</p>}
<p role="alert" className="text-sm text-red-600">{error}</p>

@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
.../c/[collectionSlug]/org-collection-page-client.tsx 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@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 feature/error-message-a11y-970719122761310663 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

javascript Pull requests that update javascript code size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant