tju-yxq opened a new pull request, #5586:
URL: https://github.com/apache/rocketmq-dashboard/pull/5586
### Which Issue(s) This PR Fixes
- Fixes #5585
### Brief Description
Makes the five mouse-only affordances keyboard-operable, applying the repo's
own established patterns (`role="button"` + `tabIndex` + Enter/Space from
`alerts.tsx`/`audit.tsx`) to the sites that missed them:
- **`MessageQueryHistoryDrawer.tsx`**: both tables' `onRow` gains `tabIndex:
0` and an Enter/Space `onKeyDown` — re-running a saved message/trace query no
longer requires a mouse (the row was the only path).
- **`ConversationListModal.tsx`**: the conversation title span gains
`role="button"`, `tabIndex={0}`, and an Enter/Space handler — opening a
conversation from the history modal is now keyboard-accessible.
- **`Composer.tsx`**: the quick-prompt chips gain the same triple — they are
the only way to insert a starter prompt from the chip row.
- **`dashboard.tsx`**: the "View All" anchor gets an `href` (SPA navigation
preserved via `preventDefault` + `navigate`), making it focusable, announced as
a link, and Enter-activable.
- **`consumer.tsx`**: the auto-refresh toggle adds
`aria-pressed={autoRefresh}` so screen readers announce the current state.
### How Did You Test This Change?
```
cd web && npx vitest run
src/components/__tests__/MessageQueryHistoryDrawer.test.tsx
src/pages/ai/__tests__/AiPage.test.tsx
src/pages/home/__tests__/DashboardPage.test.tsx
Test Files 3 passed (3)
Tests 27 passed (27) # the three affected surfaces, including
#
'navigatesToTheDeepLinkWhenAConversationIsPickedFromHistory' and
# 'preserves the selected instance when
navigating to the cluster page'
cd web && npx eslint src/components/MessageQueryHistoryDrawer.tsx
src/pages/ai/components/ConversationListModal.tsx
src/pages/ai/components/Composer.tsx src/pages/home/dashboard.tsx
src/pages/instance/consumer.tsx
(no output — 0 errors, 0 warnings)
cd web && npx tsc --noEmit
(no output — exit 0)
```
### Checklist
- [x] One coherent change; unrelated modifications are not bundled in (one
concern — keyboard operability of click-only affordances — five sites, per the
grouping guideline #2107)
- [x] Commit subject follows Conventional Commits
- [ ] Tests added or updated for non-trivial changes, test methods named
`...Test` (attribute/keyboard-handler additions; the affected suites pass
unchanged since the mouse paths are untouched)
- [x] New UI text has both Chinese and English entries under `web/src/i18n/`
(no new UI text)
- [x] Architecture constraints stay green (no Java changes)
- [x] New source files carry the ASF license header (no new source files)
- [ ] Documentation touched where behaviour changed (interaction affordances
only)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]