Skip to content

feat(treegrid): マウスクリックによるセル選択と展開/折りたたみ#178

Merged
masuP9 merged 2 commits into
mainfrom
feat/treegrid-mouse-click
May 13, 2026
Merged

feat(treegrid): マウスクリックによるセル選択と展開/折りたたみ#178
masuP9 merged 2 commits into
mainfrom
feat/treegrid-mouse-click

Conversation

@masuP9
Copy link
Copy Markdown
Owner

@masuP9 masuP9 commented May 13, 2026

Summary

  • TreeGrid に最小限のマウス操作レイヤーを追加: 任意のセルをクリックでそのセルへフォーカス移動 (roving tabindex 更新)、rowheader クリックで親行の展開/折りたたみをトグル
  • 行選択 (aria-selected) は引き続き Space キー専用に維持し、APG の cell-only focus model とキーボードのセマンティクスを保持
  • インタラクティブな子要素 (button / a / input / select / textarea) のクリック時はハンドラを早期 return し、子要素のデフォルト挙動を妨げない
  • 4 フレームワーク (React / Vue / Svelte / Astro Web Component) を同じ仕様で揃え、ドキュメント (treegrid.md, treegrid.ja.md, accessibility-docs/treegrid/{en,ja}.mdx) に「Mouse Support (non-APG extension)」セクションを追記
  • version を 0.3.7 → 0.3.8 にバンプ

Test plan

  • npx vitest run src/patterns/treegrid/TreeGrid.test.tsx 全 64 テスト pass(Mouse interactions describe で 7 ケース追加)
  • npm run lint で TreeGrid 由来の新規エラー/警告なし
  • Playwright で /patterns/treegrid/{react,vue,svelte,astro}/ を巡回し、Documents 行クリックで aria-expanded がトグルすることを確認

🤖 Generated with Claude Code

任意のセルクリックでそのセルにフォーカスを移動し、rowheader クリックで親行の
展開/折りたたみをトグルする。行選択 (aria-selected) は Space キー専用のまま
維持し、APG の cell-only focus model とキーボードのセマンティクスを保つ。
4 フレームワーク (React / Vue / Svelte / Astro Web Component) と
ドキュメント (treegrid.md, accessibility-docs MDX) を更新。
package version は 0.3.8 にバンプ。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 13, 2026

Deploying apg-patterns-examples with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6a6eb75
Status: ✅  Deploy successful!
Preview URL: https://64ee8775.apg-patterns-examples.pages.dev
Branch Preview URL: https://feat-treegrid-mouse-click.apg-patterns-examples.pages.dev

View logs

クリックで rowheader の展開トグルが起きるようになったため、テストの
focus 取得が副作用を起こさないよう el.focus() で直接 focus を当てる。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@masuP9 masuP9 merged commit b6b87c2 into main May 13, 2026
17 checks passed
@masuP9 masuP9 deleted the feat/treegrid-mouse-click branch May 13, 2026 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant