Skip to content

🎨 Palette: Markdownエディタのタブのアクセシビリティ改善#1006

Open
is0692vs wants to merge 2 commits into
stagingfrom
palette/markdown-editor-accessible-names-9871967087450396684
Open

🎨 Palette: Markdownエディタのタブのアクセシビリティ改善#1006
is0692vs wants to merge 2 commits into
stagingfrom
palette/markdown-editor-accessible-names-9871967087450396684

Conversation

@is0692vs

@is0692vs is0692vs commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

💡 What

MarkdownEditorコンポーネントの「Write」および「Preview」タブボタンに、それぞれより詳細な aria-label"Write: Edit Markdown""Preview: View Output")を追加しました。また、これに伴い単体テストのクエリを更新しました。

🎯 Why

表示されている短いテキスト(「Write」「Preview」)だけでは、スクリーンリーダーを使用しているユーザーにとって何の書き込み/プレビューなのかコンテキストが不足する可能性がありました。詳細な説明を加えることでアクセシビリティを向上させます。また、追加した aria-label には画面に表示されているテキストをそのまま先頭に含めることで、WCAG 2.5.3 (Label in Name) に完全に準拠し、音声認識ソフトウェアを使用するユーザーの操作性を損なわないようにしています。

📸 Before/After

(視覚的な変更はありません)

♿ Accessibility

  • [role="tab"] 要素にコンテキスト豊かな aria-label を追加しました。
  • WCAG 2.5.3 (Label in Name) に準拠するよう、表示テキストと aria-label の接頭辞を一致させました。

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

Greptile Summary

このPRはMarkdownエディタのWriteタブとPreviewタブにaria-labelを追加するアクセシビリティ改善です。WCAG 2.5.3準拠・既存ARIAセマンティクスへの影響なし。唯一の指摘は.Jules/palette.mdの学習ログ日付誤記(2025→2026年)のみ。

Confidence Score: 4/5

変更はaria-label属性の追加とそれに伴うテスト更新のみで、既存の動作・スタイル・ARIAセマンティクスへの悪影響はありません。

コンポーネント本体とテストコードは正確で問題なく、.Jules/palette.mdの学習ログに誤った年(2025年)が記載されているという軽微な修正点が1件あります。

.Jules/palette.mdの日付表記を確認してください(2025-06-19 → 2026-06-19)。

Important Files Changed

Filename Overview
apps/web/src/components/markdown-editor.tsx WriteタブとPreviewタブのボタンにaria-labelを追加。WCAG 2.5.3準拠・既存の構造や動作への影響なし
apps/web/src/components/tests/markdown-editor.test.tsx aria-label変更に合わせてgetByRoleのname指定を4か所更新。テストロジックの変更はなし
.Jules/palette.md 今回の変更から得た学習メモを追加。日付が2025年になっており正しくは2026年

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["タブボタン要素\n(role=tab)"] --> B{"アクセシブルネーム\n計算ルール"}
    B --> C["aria-label が存在する場合\n→ aria-label を優先"]
    C --> D1["Writeボタン\naria-label: 'Write: Edit Markdown'"]
    C --> D2["Previewボタン\naria-label: 'Preview: View Output'"]
    D1 --> E1["タブパネル (role=tabpanel)\naria-labelledby → tab-write\n=> アクセシブルネーム: 'Write: Edit Markdown'"]
    D2 --> E2["タブパネル (role=tabpanel)\naria-labelledby → tab-preview\n=> アクセシブルネーム: 'Preview: View Output'"]
    B --> F["WCAG 2.5.3 (Label in Name)\n表示テキストがaria-labelの先頭に含まれる ✓"]
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["タブボタン要素\n(role=tab)"] --> B{"アクセシブルネーム\n計算ルール"}
    B --> C["aria-label が存在する場合\n→ aria-label を優先"]
    C --> D1["Writeボタン\naria-label: 'Write: Edit Markdown'"]
    C --> D2["Previewボタン\naria-label: 'Preview: View Output'"]
    D1 --> E1["タブパネル (role=tabpanel)\naria-labelledby → tab-write\n=> アクセシブルネーム: 'Write: Edit Markdown'"]
    D2 --> E2["タブパネル (role=tabpanel)\naria-labelledby → tab-preview\n=> アクセシブルネーム: 'Preview: View Output'"]
    B --> F["WCAG 2.5.3 (Label in Name)\n表示テキストがaria-labelの先頭に含まれる ✓"]
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
.Jules/palette.md:29
エントリーの日付が `2025-06-19` になっていますが、正しくは `2026-06-19` と思われます。

```suggestion
## 2026-06-19 - Markdown Editor Tab Accessible Names
```

Reviews (1): Last reviewed commit: "feat(web): add accessible names to markd..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

Summary by CodeRabbit

  • Accessibility
    • Markdown editor tabs now include more descriptive accessible names. The 'Write' and 'Preview' tabs have been enhanced with action-oriented labels to provide improved clarity for users relying on screen readers and assistive technologies.

is0692vs and others added 2 commits June 18, 2026 14:18
Release: staging -> main (2026-06-17 02:44)
WCAG 2.5.3 (Label in Name) に準拠するため、MarkdownEditorコンポーネントの「Write」および「Preview」タブに、コンテキストを補足する `aria-label` を追加しました。これにより、スクリーンリーダーユーザーがタブの役割を正確に把握できるようになります。関連するユニットテストも更新しました。

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 Jun 19, 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 Jun 19, 2026 2:45pm

@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 enhancement New feature or request label Jun 19, 2026
@github-actions github-actions Bot changed the base branch from main to staging June 19, 2026 14:45
@github-actions

Copy link
Copy Markdown

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

@coderabbitai

coderabbitai Bot commented Jun 19, 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: e5cbbf23-76f9-4012-aed2-c03c06fd3b30

📥 Commits

Reviewing files that changed from the base of the PR and between 595a6b7 and 47d8ca9.

📒 Files selected for processing (3)
  • .Jules/palette.md
  • apps/web/src/components/__tests__/markdown-editor.test.tsx
  • apps/web/src/components/markdown-editor.tsx

📝 Walkthrough

Walkthrough

Two aria-label attributes are added to the Write and Preview tab buttons in markdown-editor.tsx, giving them descriptive accessible names. Four tab queries in the corresponding test file are updated to use those new names, and a palette entry documents the pattern.

Changes

Markdown Editor Tab Accessible Names

Layer / File(s) Summary
aria-label addition and test updates
apps/web/src/components/markdown-editor.tsx, apps/web/src/components/__tests__/markdown-editor.test.tsx, .Jules/palette.md
Write tab gains aria-label="Write: Edit Markdown" and Preview tab gains aria-label="Preview: View Output"; all four getByRole tab queries in the test file are updated to match the new accessible names; palette documents the aria-label requirement and test-update guidance.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested labels

enhancement, javascript, size/XS

Poem

🐇 A tab once said "Write" — too plain, too bare,
Now "Write: Edit Markdown" floats on the air.
Screen readers rejoice, the labels are bright,
"Preview: View Output" — accessibility right!
Hop hop, little labels, do carry the name. ✨

🚥 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 is written in Japanese and uses an emoji, but accurately describes the main change: improving accessibility of MarkdownEditor tabs.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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/markdown-editor-accessible-names-9871967087450396684

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 and usage tips.

@codecov

codecov Bot commented Jun 19, 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 aria-label attributes to the "Write" and "Preview" tabs in the Markdown editor to provide more context for screen readers, updates the corresponding unit tests, and documents this learning in .Jules/palette.md. The reviewer recommends removing these aria-label attributes because the parent tablist already provides sufficient context, and using aria-label can cause WCAG 2.5.3 (Label in Name) violations when the page is translated (as translation tools translate visible text but often leave aria-label unchanged). Consequently, the reviewer suggests reverting the test queries and updating or removing the learning entry in .Jules/palette.md.

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.

id={`${id}-tab-write`}
type="button"
role="tab"
aria-label="Write: Edit Markdown"

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="tab")に aria-label を追加してアクセシブルな名前を拡張していますが、親要素の tablist にすでに aria-label="Markdown editor mode" が指定されているため、スクリーンリーダーは「Markdown editor mode、Write、タブ」のようにコンテキストを伴って読み上げます。そのため、aria-label で表示テキストを上書きして拡張する必要性は低いです。また、aria-label を使用すると、ブラウザの翻訳機能(Google翻訳など)が適用された際に、表示テキスト(「Write」)は翻訳される一方で aria-label は翻訳されず、音声認識ユーザーが翻訳後のテキストで操作できなくなる(WCAG 2.5.3 Label in Name の不一致が発生する)リスクがあります。アクセシビリティと国際化(翻訳対応)の観点から、aria-label は追加せず、表示テキスト(「Write」および「Preview」)をそのままアクセシブルな名前として使用することを推奨します。

id={`${id}-tab-preview`}
type="button"
role="tab"
aria-label="Preview: View Output"

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

こちらも同様に、親の tablistaria-label="Markdown editor mode" があるため、aria-label による拡張は不要です。翻訳時の WCAG 2.5.3 準拠を維持するためにも、aria-label を削除し、表示テキスト「Preview」をそのまま使用することを推奨します。


// Write tab is selected
const writeTab = screen.getByRole("tab", { name: "Write" });
const writeTab = screen.getByRole("tab", { name: "Write: Edit Markdown" });

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

コンポーネント側で aria-label を削除する場合、テスト内のクエリも元の "Write" に戻す必要があります。

Comment thread .Jules/palette.md
Comment on lines +29 to +31
## 2025-06-19 - Markdown Editor Tab Accessible Names
**Learning:** タブUI(例:Markdownエディタの「Write」と「Preview」)において、短い表示テキスト(「Write」や「Preview」)だけではスクリーンリーダーユーザーにとってコンテキストが不足する場合があります。しかし、`aria-label`を追加してコンテキストを補足する際(例:「Write: Edit Markdown」)、WCAG 2.5.3(Label in Name)に準拠するためには、画面に表示されているテキスト(「Write」)を`aria-label`の先頭に正確に含める必要があります。これにより、音声認識ユーザーも視覚的なテキストを使って正しく要素を操作できるようになります。
**Action:** 今後、短いテキストラベルを持つタブやボタンに対して、より詳細なコンテキストを提供するために`aria-label`を追加する際は、必ず表示されているテキストを`aria-label`の文字列(理想的には先頭)に含めるようにします。また、アクセシブルな名前を変更した場合は、関連するユニットテスト(`getByRole`での名前の指定など)も必ず更新してテストの失敗を防ぎます。

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

Markdownエディタのタブにおける aria-label の追加を差し戻す場合、この学習履歴(Learning/Action)も削除するか、あるいは「tablist に適切なラベルがある場合は、翻訳ツールとの互換性やシンプルさを優先して aria-label による上書きを避けるべきである」という内容に更新することをお勧めします。

Comment thread .Jules/palette.md
**Learning:** アイコンやコピーなどの汎用的なアクションを実行するボタンが複数リストされている場合、スクリーンリーダーユーザーがどの項目のアクションかを識別できるように、`aria-label` に具体的なコンテキスト(例: `Copy ${snippet.label}`)を含めることが重要です。同時に、表示されているテキスト(この場合は 'Copy')を `aria-label` に含めることで WCAG 2.5.3(Label in Name)に準拠します。
**Action:** 今後、リスト内やコンテキストが不明瞭なボタン(特に同じテキストラベルを持つ複数のボタン)を実装・改善する際は、必ず `aria-label` に詳細な説明を含めるようにします。また、以前試みた「文字数カウンターの aria-live 属性の削除」は、スクリーンリーダーユーザーへのフィードバックを完全に奪うことになりアクセシビリティを低下させる(リグレッション)ため、行わないよう注意します。

## 2025-06-19 - Markdown Editor Tab Accessible Names

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 エントリーの日付が 2025-06-19 になっていますが、正しくは 2026-06-19 と思われます。

Suggested change
## 2025-06-19 - Markdown Editor Tab Accessible Names
## 2026-06-19 - Markdown Editor Tab Accessible Names
Prompt To Fix With AI
This is a comment left during a code review.
Path: .Jules/palette.md
Line: 29

Comment:
エントリーの日付が `2025-06-19` になっていますが、正しくは `2026-06-19` と思われます。

```suggestion
## 2026-06-19 - Markdown Editor Tab Accessible Names
```

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!

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