[PR #7574] [MERGED] fix(chat): give Load More and the history buttons a visible focus ring #7805

Closed
opened 2026-10-24 04:07:40 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7574
Author: @SpicyMarinara
Created: 10/13/2026
Status: ✅ Merged
Merged: 10/13/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/history-pager-focus-contrast


📝 Commits (1)

  • 74ce703 fix(chat): give Load More and the history buttons a visible focus ring

📊 Changes

2 files changed (+37 additions, -0 deletions)

View changed files

📝 e2e/history-pager-widget-style.e2e.ts (+22 -0)
📝 packages/client/src/styles/themes/chat-widget-surfaces.css (+15 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #7572

Follow-up to #7561 and #7562 (merged).

Why this change

  • #7562 gave Load More and the Game log buttons the shared chat button look. That look comes with a focus ring that is the app accent at 22% strength. On the open chat it measures about 1.1 to 1.3:1 against the page, so when you press Tab to reach Load More you can barely see which button has focus. Before #7562, Load More and the Game log buttons used the browser's own clear focus ring. Show older, Show newer and Latest already had the faint ring.
  • With a chat style's Apply preset colors on, the ring also stayed pink instead of using the style's colour.

What changed

  • Load More (Roleplay, Visual Novel history, Conversation), Show older, Show newer, Latest, and the Game logs' Older, All and Show more older logs now show a clear focus ring when you reach them with the keyboard. It uses the full app accent. While Apply preset colors is on, it uses the chat style's colour (for example Dottore's blue or Mari's gold), or your custom border colour.
  • Under Dottore's cut-corner shape the ring is a rectangle around the button, the same as the chat toolbar buttons' focus ring.
  • Only the focus ring changed. The resting look, hover, spinner, disabled state, copy and accessible names are unchanged. Other chat chrome buttons keep their current ring.
  • chat-widget-surfaces.css: two small rules set the chrome focus-ring token on .mari-chat-history-pager. Nothing else reads it differently.
  • e2e/history-pager-widget-style.e2e.ts: the existing spec now also checks the ring colour after keyboard focus: the full accent with the switches off, the preset accent with Apply preset colors on, and the custom border colour. These checks fail on staging (color(srgb 1 0 0 / 0.22) instead of the preset accent).

Left for you to decide (not changed here)

  • Review of #7562 also noted that, with the switches off, Load More's text is now the chrome button text colour (the accent at 64%). That is about 2.8:1 on dark and 2.2:1 on light, where Load More's old neutral text was about 6.7:1 and 4.9:1. Show older and the chat toolbar buttons already use this colour, so changing it only for the history buttons would make them stop matching the other chat buttons, and raising the shared token changes every chrome button in the app. Tell me if you want either.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Agent command notes (for the reviewer to confirm; boxes above are left for the human):

  • pnpm check: exit 0 (one existing lint warning in an unrelated file).
  • pnpm localization:check: passed. No copy changed.
  • node ./scripts/run-regressions.mjs --filter agent-activation: 2/2 passed.
  • node ./scripts/run-regressions.mjs --filter spatial-context: 1/1 passed.
  • node ./scripts/run-regressions.mjs --filter open-issues: 1/1 passed.
  • playwright test e2e/history-pager-widget-style.e2e.ts --project=desktop-chromium --project=mobile-chromium: 4/4 passed. With the CSS change removed, both desktop tests fail on the new focus-ring check.
  • Local CodeRabbit (coderabbit review --agent --committed --base-commit 56fd7b6c9): review completed, 0 findings.

Manual verification notes

Manual verification needed:

  • Open a long Roleplay chat with Messages per page set low. Click in the chat, press Tab until Load More has focus, and confirm the ring is easy to see in dark and light mode.
  • Set Chat widget style to Dottore with Apply preset colors on and repeat. The ring should be Dottore's blue. Repeat with Mari (gold in dark mode, blue in light mode) and with custom Border colours.
  • Repeat in a long Conversation chat for Load More and Show older, on desktop and on a phone with a keyboard if you have one.
  • In Game mode, open Logs in a long session, Tab to Older, All and Show more older logs, and confirm the ring.
  • With a light Roleplay chat background, check the ring is still easy enough to see. It is the weakest case in the screenshots (see below).

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

Before/after screenshots with measured contrast (private page for the maintainer): https://claude.ai/artifact/Qeau74SiAnVDS8tTkztiz2

Taken with the repo's Playwright setup and fixtures, focus moved with Shift+Tab then Tab, desktop 1440 px and phone 390 px. Contrast is the ring against the page right next to it (focus indicators need 3:1):

Button and style Before After
Roleplay Load More, Default, dark, desktop 1.25:1 5.87:1
Conversation Load More, Default, light, desktop 1.27:1 2.99:1
Roleplay Load More, Dottore all on, dark, desktop 1.25:1 12.48:1
Conversation Load More, Dottore all on, dark, phone 1.30:1 11.72:1
Conversation Load More, Mari all on, light, desktop 1.27:1 7.09:1
Roleplay Load More, custom gradient colours, dark, phone 1.25:1 7.38:1
Game logs Older, Default, dark, desktop 1.29:1 5.41:1
Game logs Show more older logs, Mari all on, light, phone 1.28:1 7.14:1
Roleplay Load More, Mari all on, light (grey Roleplay page), desktop 1.12:1 1.19:1
  • With the default pink accent in light mode the ring is 3.0:1, the accent itself, which the app's other strong focus rings use too.
  • The light Roleplay page is dark grey, so a dark preset ring is low against the page there. It still stands out against the button's light fill, as the last screenshot shows.
  • The Game shots used a temporary log page size of 2 so the buttons appear in a short session. That patch was not committed.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/7574 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/13/2026 **Status:** ✅ Merged **Merged:** 10/13/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/history-pager-focus-contrast` --- ### 📝 Commits (1) - [`74ce703`](https://github.com/Pasta-Devs/Marinara-Engine/commit/74ce7036a2c7dc7c4638bb24bad67089a6502e1a) fix(chat): give Load More and the history buttons a visible focus ring ### 📊 Changes **2 files changed** (+37 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `e2e/history-pager-widget-style.e2e.ts` (+22 -0) 📝 `packages/client/src/styles/themes/chat-widget-surfaces.css` (+15 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue Closes #7572 Follow-up to #7561 and #7562 (merged). ## Why this change - #7562 gave Load More and the Game log buttons the shared chat button look. That look comes with a focus ring that is the app accent at 22% strength. On the open chat it measures about 1.1 to 1.3:1 against the page, so when you press Tab to reach Load More you can barely see which button has focus. Before #7562, Load More and the Game log buttons used the browser's own clear focus ring. Show older, Show newer and Latest already had the faint ring. - With a chat style's Apply preset colors on, the ring also stayed pink instead of using the style's colour. ## What changed - **Load More** (Roleplay, Visual Novel history, Conversation), **Show older**, **Show newer**, **Latest**, and the Game logs' **Older**, **All** and **Show more older logs** now show a clear focus ring when you reach them with the keyboard. It uses the full app accent. While **Apply preset colors** is on, it uses the chat style's colour (for example Dottore's blue or Mari's gold), or your custom border colour. - Under Dottore's cut-corner shape the ring is a rectangle around the button, the same as the chat toolbar buttons' focus ring. - Only the focus ring changed. The resting look, hover, spinner, disabled state, copy and accessible names are unchanged. Other chat chrome buttons keep their current ring. - `chat-widget-surfaces.css`: two small rules set the chrome focus-ring token on `.mari-chat-history-pager`. Nothing else reads it differently. - `e2e/history-pager-widget-style.e2e.ts`: the existing spec now also checks the ring colour after keyboard focus: the full accent with the switches off, the preset accent with Apply preset colors on, and the custom border colour. These checks fail on staging (`color(srgb 1 0 0 / 0.22)` instead of the preset accent). ### Left for you to decide (not changed here) - Review of #7562 also noted that, with the switches off, Load More's text is now the chrome button text colour (the accent at 64%). That is about 2.8:1 on dark and 2.2:1 on light, where Load More's old neutral text was about 6.7:1 and 4.9:1. Show older and the chat toolbar buttons already use this colour, so changing it only for the history buttons would make them stop matching the other chat buttons, and raising the shared token changes every chrome button in the app. Tell me if you want either. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` Agent command notes (for the reviewer to confirm; boxes above are left for the human): - `pnpm check`: exit 0 (one existing lint warning in an unrelated file). - `pnpm localization:check`: passed. No copy changed. - `node ./scripts/run-regressions.mjs --filter agent-activation`: 2/2 passed. - `node ./scripts/run-regressions.mjs --filter spatial-context`: 1/1 passed. - `node ./scripts/run-regressions.mjs --filter open-issues`: 1/1 passed. - `playwright test e2e/history-pager-widget-style.e2e.ts --project=desktop-chromium --project=mobile-chromium`: 4/4 passed. With the CSS change removed, both desktop tests fail on the new focus-ring check. - Local CodeRabbit (`coderabbit review --agent --committed --base-commit 56fd7b6c9`): review completed, 0 findings. ### Manual verification notes Manual verification needed: - Open a long Roleplay chat with **Messages per page** set low. Click in the chat, press Tab until **Load More** has focus, and confirm the ring is easy to see in dark and light mode. - Set **Chat widget style** to Dottore with **Apply preset colors** on and repeat. The ring should be Dottore's blue. Repeat with Mari (gold in dark mode, blue in light mode) and with custom Border colours. - Repeat in a long Conversation chat for **Load More** and **Show older**, on desktop and on a phone with a keyboard if you have one. - In Game mode, open Logs in a long session, Tab to **Older**, **All** and **Show more older logs**, and confirm the ring. - With a light Roleplay chat background, check the ring is still easy enough to see. It is the weakest case in the screenshots (see below). ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) Before/after screenshots with measured contrast (private page for the maintainer): https://claude.ai/artifact/Qeau74SiAnVDS8tTkztiz2 Taken with the repo's Playwright setup and fixtures, focus moved with Shift+Tab then Tab, desktop 1440 px and phone 390 px. Contrast is the ring against the page right next to it (focus indicators need 3:1): | Button and style | Before | After | | --- | --- | --- | | Roleplay Load More, Default, dark, desktop | 1.25:1 | 5.87:1 | | Conversation Load More, Default, light, desktop | 1.27:1 | 2.99:1 | | Roleplay Load More, Dottore all on, dark, desktop | 1.25:1 | 12.48:1 | | Conversation Load More, Dottore all on, dark, phone | 1.30:1 | 11.72:1 | | Conversation Load More, Mari all on, light, desktop | 1.27:1 | 7.09:1 | | Roleplay Load More, custom gradient colours, dark, phone | 1.25:1 | 7.38:1 | | Game logs Older, Default, dark, desktop | 1.29:1 | 5.41:1 | | Game logs Show more older logs, Mari all on, light, phone | 1.28:1 | 7.14:1 | | Roleplay Load More, Mari all on, light (grey Roleplay page), desktop | 1.12:1 | 1.19:1 | - With the default pink accent in light mode the ring is 3.0:1, the accent itself, which the app's other strong focus rings use too. - The light Roleplay page is dark grey, so a dark preset ring is low against the page there. It still stands out against the button's light fill, as the last screenshot shows. - The Game shots used a temporary log page size of 2 so the buttons appear in a short session. That patch was not committed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:07:40 +07:00
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#7805
No description provided.