[PR #8842] [MERGED] fix(client): back the chat's model menu with the opaque page background #8836

Closed
opened 2026-11-07 17:40:05 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8842
Author: @SpicyMarinara
Created: 11/4/2026
Status: ✅ Merged
Merged: 11/4/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/connections-menu-opaque


📝 Commits (1)

  • 11de9ce fix(client): back the chat's model menu with the opaque page background

📊 Changes

3 files changed (+87 additions, -3 deletions)

View changed files

📝 e2e/connection-model-switcher.e2e.ts (+53 -0)
📝 packages/client/src/components/chat/QuickConnectionSwitcher.tsx (+4 -3)
📝 packages/client/src/styles/themes/chat-widget-surfaces.css (+30 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.

Linked issue

Closes #8833

Why this change

Issue #8833, requested by a fellow developer: the connections menu in chats is drawn too transparent. The chat behind it shows through, so its connection and model names are hard to read, especially over image or gradient backgrounds and with translucent chat styles. The fix gives this menu the same opaque floor the app's other readable menus already use (the phone Quick Switcher's opaque window, Mari's model menu, and Firefox's roleplay input shell), and keeps the menu's look. A user's chosen glass color or gradient still tints the menu, but the chat no longer shows through.

What changed

  • The desktop model menu opened from the chat composer now sits on the opaque page background, so a busy chat background no longer shows through its text, in dark and light theme.
  • With Apply preset colors on, the chosen chat color or gradient, alpha included, still tints the menu, now laid over the opaque page background. Custom-theme hooks (--mari-chat-bg, --mari-window-bg) still paint as written.
  • New .mari-chat-solid-surface class in packages/client/src/styles/themes/chat-widget-surfaces.css: it lays --mari-chat-solid-paint (default --card) on var(--background), and under Apply preset colors it lays the resolved preset or custom paint on the same floor. The cut-corner frame inherits it through --mari-chat-existing-bg.
  • QuickConnectionSwitcher.tsx uses that class instead of bg-[var(--card)] / bg-[var(--background)]. Roleplay keeps the card paint and Conversation keeps the page background.
  • e2e/connection-model-switcher.e2e.ts: new tests 'the models menu stays opaque over a busy chat background in dark/light theme (#8833)'. On desktop and phone they assert that the bottom background layer has alpha 1 (on desktop, with the card or chat-style gradient above it), with and without a translucent 0.3 custom chat color under Apply preset colors.
  • No user-facing copy changed.

Validation

  • pnpm check passes locally
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)

Manual verification notes

  • Manually verify in a desktop browser that the composer's model menu (link icon in a Roleplay chat) is readable over a busy chat background image, in dark and in light theme.
  • Manually verify the same menu in a Conversation chat, with the page background colour behind the menu and no visible change in look.
  • Manually verify with Settings > chat style > Apply preset colors on, and a translucent custom background color or gradient, that the menu takes the tint and the chat does not show through.
  • Manually verify with the Dottore and Mari presets, and with the cut-corner shape and Apply shape on, that the menu keeps its preset paint and frame, now opaque.
  • Manually verify on a phone that the Quick Switcher window still looks the same (it was already opaque).
  • Manually verify with the SillyTavern theme and a seasonal theme that the menu stays readable.

Agent-run checks (for reference):

  • pnpm check: exit 0. impeccable, localization:check, format:check, lint, check:e2e-types, check:token-estimation-types and build all passed. Run on the exact tree that was committed (git diff matched the verified patch).
  • npx prettier --check e2e/connection-model-switcher.e2e.ts packages/client/src/components/chat/QuickConnectionSwitcher.tsx packages/client/src/styles/themes/chat: All matched files use Prettier code style.
  • PLAYWRIGHT_CLIENT_PORT=5741 PLAYWRIGHT_SERVER_PORT=7741 PLAYWRIGHT_MOBILE_CLIENT_PORT=5742 PLAYWRIGHT_MOBILE_SERVER_PORT=7742 npx playwright test e2e/connection: Two attempts never started any tests: 'Timed out waiting 180000ms from config.webServer'. The shared build was killed under a machine load of about 39.
  • node ./e2e/start-servers.mjs (same ports, DEV_SERVER_READY_TIMEOUT_MS=900000), then PLAYWRIGHT_SKIP_WEBSERVER=true ... npx playwright test e2e/connection-model-: 14 passed, 2 failed (5.6m). desktop-chromium: 8/8 passed, including both #8833 tests. mobile-chromium: both #8833 tests, the #7098 light-theme test, the scroll test and the two legacy-preference tests passed. 'without re
  • PLAYWRIGHT_SKIP_WEBSERVER=true ... --project=mobile-chromium -g "without refetching|reselecting Main" (with the fix): 2 failed: line 319 aria-pressed expected true, got false; and a 60s timeout in the second test.
  • Same two mobile tests with my client change reverted (baseline staging client code): 2 failed in the same way (line 319 aria-pressed; 60s timeout plus closed context in cleanup). The failures do not come from this change. The fix was re-applied afterwards and the tree checked.
  • Temporary capture spec (e2e/tmp-8833-capture.e2e.ts, deleted before committing), run with CAPTURE_PHASE=before on reverted client code and CAPTURE_PHASE=after w: 12/12 passed in each phase. Desktop computed base background, before then after: roleplay dark rgba(20,20,20,0.85) -> rgb(5,3,18); roleplay light rgba(255,255,255,0.933) -> rgb(250,248,255); glass 0.3 rgba(20,20,32,0.3)
  • pnpm localization:check: Not run separately: no copy changed. It passed as part of pnpm check.

Independent review: no findings. Dottore Review pending.

Known limits and risks:

  • A custom theme that sets --mari-chat-bg or --mari-window-bg to a translucent paint still gets that paint as written. A hook can be a color or a gradient, so it cannot be laid on the background. This is marked with a ponytail: comment that names the upgrade path: split each hook into a registered color property and an image property.
  • The floor is the theme's --background. A custom theme that makes --background itself translucent would weaken it. Every bundled theme (default, light, SillyTavern, Halloween, New Year's Eve and Day) is opaque.
  • Only the desktop composer menu changed. The phone Quick Switcher and Mari's model menu were already opaque (measured rgb(5, 3, 18) and rgb(250, 248, 255) base layers before the fix). Chat Settings' inline chooser sits in its own window and was left as is.
  • In the full spec run, 2 existing mobile-chromium tests failed: 'the Connections menu lists, stars, picks, refreshes and types models without refetching (#7098)' (line 319: aria-pressed stayed false, or a later click timed out) and 'reselecting Main keeps the chat following it…' (60s timeout clicking the duplicate entry after reload). The same two tests fail the same way with my client change reverted, so they are not caused by this fix. Their desktop runs pass. The machine was under heavy load from other sessions' e2e runs at the time (load average 19 to 39).

🤖 Generated with Claude Code


🔄 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/8842 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 11/4/2026 **Status:** ✅ Merged **Merged:** 11/4/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/connections-menu-opaque` --- ### 📝 Commits (1) - [`11de9ce`](https://github.com/Pasta-Devs/Marinara-Engine/commit/11de9ce0964ed96b3830fad7a1db7900d79e62a0) fix(client): back the chat's model menu with the opaque page background ### 📊 Changes **3 files changed** (+87 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `e2e/connection-model-switcher.e2e.ts` (+53 -0) 📝 `packages/client/src/components/chat/QuickConnectionSwitcher.tsx` (+4 -3) 📝 `packages/client/src/styles/themes/chat-widget-surfaces.css` (+30 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. ## Linked issue Closes #8833 ## Why this change Issue #8833, requested by a fellow developer: the connections menu in chats is drawn too transparent. The chat behind it shows through, so its connection and model names are hard to read, especially over image or gradient backgrounds and with translucent chat styles. The fix gives this menu the same opaque floor the app's other readable menus already use (the phone Quick Switcher's opaque window, Mari's model menu, and Firefox's roleplay input shell), and keeps the menu's look. A user's chosen glass color or gradient still tints the menu, but the chat no longer shows through. ## What changed - The desktop model menu opened from the chat composer now sits on the opaque page background, so a busy chat background no longer shows through its text, in dark and light theme. - With Apply preset colors on, the chosen chat color or gradient, alpha included, still tints the menu, now laid over the opaque page background. Custom-theme hooks (`--mari-chat-bg`, `--mari-window-bg`) still paint as written. - New `.mari-chat-solid-surface` class in `packages/client/src/styles/themes/chat-widget-surfaces.css`: it lays `--mari-chat-solid-paint` (default `--card`) on `var(--background)`, and under Apply preset colors it lays the resolved preset or custom paint on the same floor. The cut-corner frame inherits it through `--mari-chat-existing-bg`. - `QuickConnectionSwitcher.tsx` uses that class instead of `bg-[var(--card)]` / `bg-[var(--background)]`. Roleplay keeps the card paint and Conversation keeps the page background. - `e2e/connection-model-switcher.e2e.ts`: new tests 'the models menu stays opaque over a busy chat background in dark/light theme (#8833)'. On desktop and phone they assert that the bottom background layer has alpha 1 (on desktop, with the card or chat-style gradient above it), with and without a translucent 0.3 custom chat color under Apply preset colors. - No user-facing copy changed. ## Validation <!-- These are human tasks. Never tick a box for a check that was not actually performed. --> - [ ] `pnpm check` passes locally - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) ### Manual verification notes - Manually verify in a desktop browser that the composer's model menu (link icon in a Roleplay chat) is readable over a busy chat background image, in dark and in light theme. - Manually verify the same menu in a Conversation chat, with the page background colour behind the menu and no visible change in look. - Manually verify with Settings > chat style > Apply preset colors on, and a translucent custom background color or gradient, that the menu takes the tint and the chat does not show through. - Manually verify with the Dottore and Mari presets, and with the cut-corner shape and Apply shape on, that the menu keeps its preset paint and frame, now opaque. - Manually verify on a phone that the Quick Switcher window still looks the same (it was already opaque). - Manually verify with the SillyTavern theme and a seasonal theme that the menu stays readable. Agent-run checks (for reference): - pnpm check: exit 0. impeccable, localization:check, format:check, lint, check:e2e-types, check:token-estimation-types and build all passed. Run on the exact tree that was committed (git diff matched the verified patch). - npx prettier --check e2e/connection-model-switcher.e2e.ts packages/client/src/components/chat/QuickConnectionSwitcher.tsx packages/client/src/styles/themes/chat: All matched files use Prettier code style. - PLAYWRIGHT_CLIENT_PORT=5741 PLAYWRIGHT_SERVER_PORT=7741 PLAYWRIGHT_MOBILE_CLIENT_PORT=5742 PLAYWRIGHT_MOBILE_SERVER_PORT=7742 npx playwright test e2e/connection: Two attempts never started any tests: 'Timed out waiting 180000ms from config.webServer'. The shared build was killed under a machine load of about 39. - node ./e2e/start-servers.mjs (same ports, DEV_SERVER_READY_TIMEOUT_MS=900000), then PLAYWRIGHT_SKIP_WEBSERVER=true ... npx playwright test e2e/connection-model-: 14 passed, 2 failed (5.6m). desktop-chromium: 8/8 passed, including both #8833 tests. mobile-chromium: both #8833 tests, the #7098 light-theme test, the scroll test and the two legacy-preference tests passed. 'without re - PLAYWRIGHT_SKIP_WEBSERVER=true ... --project=mobile-chromium -g "without refetching|reselecting Main" (with the fix): 2 failed: line 319 aria-pressed expected true, got false; and a 60s timeout in the second test. - Same two mobile tests with my client change reverted (baseline staging client code): 2 failed in the same way (line 319 aria-pressed; 60s timeout plus closed context in cleanup). The failures do not come from this change. The fix was re-applied afterwards and the tree checked. - Temporary capture spec (e2e/tmp-8833-capture.e2e.ts, deleted before committing), run with CAPTURE_PHASE=before on reverted client code and CAPTURE_PHASE=after w: 12/12 passed in each phase. Desktop computed base background, before then after: roleplay dark rgba(20,20,20,0.85) -> rgb(5,3,18); roleplay light rgba(255,255,255,0.933) -> rgb(250,248,255); glass 0.3 rgba(20,20,32,0.3) - pnpm localization:check: Not run separately: no copy changed. It passed as part of pnpm check. Independent review: no findings. Dottore Review pending. Known limits and risks: - A custom theme that sets `--mari-chat-bg` or `--mari-window-bg` to a translucent paint still gets that paint as written. A hook can be a color or a gradient, so it cannot be laid on the background. This is marked with a `ponytail:` comment that names the upgrade path: split each hook into a registered color property and an image property. - The floor is the theme's `--background`. A custom theme that makes `--background` itself translucent would weaken it. Every bundled theme (default, light, SillyTavern, Halloween, New Year's Eve and Day) is opaque. - Only the desktop composer menu changed. The phone Quick Switcher and Mari's model menu were already opaque (measured rgb(5, 3, 18) and rgb(250, 248, 255) base layers before the fix). Chat Settings' inline chooser sits in its own window and was left as is. - In the full spec run, 2 existing mobile-chromium tests failed: 'the Connections menu lists, stars, picks, refreshes and types models without refetching (#7098)' (line 319: aria-pressed stayed false, or a later click timed out) and 'reselecting Main keeps the chat following it…' (60s timeout clicking the duplicate entry after reload). The same two tests fail the same way with my client change reverted, so they are not caused by this fix. Their desktop runs pass. The machine was under heavy load from other sessions' e2e runs at the time (load average 19 to 39). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 17:40:05 +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#8836
No description provided.