[GH-ISSUE #6796] [Issue]: Game Mode's Inventory button has no accessible name on phones #3805

Closed
opened 2026-10-21 06:07:42 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @kolacheee on GitHub (Sep 28, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6796

Originally assigned to: @kolacheee on GitHub.

Summary

In Game Mode, the Inventory button under the narration has no usable name on phone-width screens. Its text label is hidden below the sm breakpoint, and the button has no aria-label or title, so a screen reader announces only the item count badge (for example "1"), or nothing at all when the inventory is empty.

Expected behavior

The button is announced as the inventory at every width, for example "Inventory" or "Inventory, 3 items". The Logs button beside it already does this with an aria-label, and the fight button with a title.

Actual behavior

packages/client/src/components/game/GameNarration.tsx renders the Inventory button in two places (around lines 5417 and 5494 on staging 50249cee9):

<button onClick={onOpenInventory} className={cn("relative", NARRATION_META_BTN)}>
  <Package size={12} />
  <span className="hidden sm:inline">{localizeUi("ui.game.gamecharactersheet.inventory")}</span>
  {(inventoryCount ?? 0) > 0 && <span className={NARRATION_COUNT_BADGE}>{inventoryCount}</span>}
</button>

Below sm the label is display: none, so the button's only text is the count badge. It also cannot be found by name in tests: getByRole("button", { name: /Inventory/ }), which e2e/game-inventory-bags.e2e.ts and e2e/game-inventory-stacks.e2e.ts use, finds nothing in the mobile-chromium Playwright project and times out.

Steps to reproduce

  1. Open a Game Mode chat on a phone, or with the browser window narrower than the sm breakpoint (640 px).
  2. Inspect the box icon button under the narration (or use a screen reader on it).
  3. Its accessible name is the count badge ("1"), or empty when the inventory holds nothing.

Or run pnpm regression:ui e2e/game-inventory-bags.e2e.ts --project=mobile-chromium --workers=1: the test times out waiting for the Inventory button.

Environment

  • Marinara Engine version: 2.4.6 (staging 50249cee9)
  • Install type: source
  • OS + version: Fedora Linux 44
  • Browser or app shell: Chromium through Playwright's mobile-chromium project; the markup is the same in every browser

Logs, screenshots, or video

Found while testing the inventory at phone width: the button shows only the box icon and the count badge.

Additional context

A likely fix is an aria-label and title on both Inventory buttons, from ui.game.gamecharactersheet.inventory, with the count added through a new key in packages/client/src/localization/locales/en.json (for example "Inventory, {{count}} items"). The Logs and fight buttons in the same file are already named and need no change.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @kolacheee on GitHub (Sep 28, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6796 Originally assigned to: @kolacheee on GitHub. ## Summary In Game Mode, the Inventory button under the narration has no usable name on phone-width screens. Its text label is hidden below the `sm` breakpoint, and the button has no `aria-label` or `title`, so a screen reader announces only the item count badge (for example "1"), or nothing at all when the inventory is empty. ## Expected behavior The button is announced as the inventory at every width, for example "Inventory" or "Inventory, 3 items". The Logs button beside it already does this with an `aria-label`, and the fight button with a `title`. ## Actual behavior `packages/client/src/components/game/GameNarration.tsx` renders the Inventory button in two places (around lines 5417 and 5494 on staging `50249cee9`): ```tsx <button onClick={onOpenInventory} className={cn("relative", NARRATION_META_BTN)}> <Package size={12} /> <span className="hidden sm:inline">{localizeUi("ui.game.gamecharactersheet.inventory")}</span> {(inventoryCount ?? 0) > 0 && <span className={NARRATION_COUNT_BADGE}>{inventoryCount}</span>} </button> ``` Below `sm` the label is `display: none`, so the button's only text is the count badge. It also cannot be found by name in tests: `getByRole("button", { name: /Inventory/ })`, which `e2e/game-inventory-bags.e2e.ts` and `e2e/game-inventory-stacks.e2e.ts` use, finds nothing in the `mobile-chromium` Playwright project and times out. ## Steps to reproduce 1. Open a Game Mode chat on a phone, or with the browser window narrower than the `sm` breakpoint (640 px). 2. Inspect the box icon button under the narration (or use a screen reader on it). 3. Its accessible name is the count badge ("1"), or empty when the inventory holds nothing. Or run `pnpm regression:ui e2e/game-inventory-bags.e2e.ts --project=mobile-chromium --workers=1`: the test times out waiting for the Inventory button. ## Environment - Marinara Engine version: 2.4.6 (staging `50249cee9`) - Install type: source - OS + version: Fedora Linux 44 - Browser or app shell: Chromium through Playwright's `mobile-chromium` project; the markup is the same in every browser ## Logs, screenshots, or video Found while testing the inventory at phone width: the button shows only the box icon and the count badge. ## Additional context A likely fix is an `aria-label` and `title` on both Inventory buttons, from `ui.game.gamecharactersheet.inventory`, with the count added through a new key in `packages/client/src/localization/locales/en.json` (for example "Inventory, {{count}} items"). The Logs and fight buttons in the same file are already named and need no change. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 06:07:42 +07:00
  • closed this issue
  • added the
    bug
    label
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#3805
No description provided.