[GH-ISSUE #6463] [Issue]: Disabled regex/function rows: off-state toggle is unreadable (dimmed row + border-coloured switch stack) #3618

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

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

Originally assigned to: @SpicyMarinara on GitHub.

[Issue]:

Image Image

Summary

A disabled regex script (and, by the same code path, a disabled function) renders its on/off toggle at effectively zero contrast, so the control can only be found by moving the pointer around the row until it happens to hit. Nothing is broken functionally — two independent styling decisions compound into an inaccessible one.

Expected behavior

The toggle should be clearly visible in both states, so a disabled regex or function can be re-enabled without hunting for the control.

Actual behavior

The toggle is indistinguishable from the row background. Two stacked causes:

  1. The whole row is dimmed, including the control. packages/client/src/components/panels/PresetsPanel.tsx, line 1671, on the regex row wrapper <div>:

    className={cn(
      "group flex flex-wrap items-start gap-2 rounded-xl p-2 transition-colors hover:bg-[var(--sidebar-accent)]",
      !enabled && "opacity-50",
      draggedRegexId === script.id && "opacity-40",
    )}
    

    The SettingsSwitch is a child of that wrapper (line 1760), so it is dimmed along with the text. CSS opacity composites — a child cannot opt back out.

  2. The off-state switch has almost no contrast to begin with. packages/client/src/components/panels/settings/SettingControls.tsx, line 711, in SettingsSwitchTrack:

    checked ? "bg-[var(--primary)]/70 mari-accent-animated" : "bg-[var(--border)]",
    

    Off = a bare --border-coloured pill. On the default dark palette --border is already near-invisible against the panel, and the row's opacity-50 halves it again. The thumb (line 718) fares no better:

    "pointer-events-none block h-4 w-4 shrink-0 rounded-full bg-[var(--background)] shadow-sm ring-1 ring-[var(--border)] transition-transform",
    

    --background fill with a --border ring, inside a --border track — the whole control sits one contrast step above the surface it is drawn on.

Steps to reproduce

  1. Import (or create) a global regex script with enabled: false — e.g. a SillyTavern export carrying disabled: true.
  2. Open the Presets panel → Regexes section.
  3. Look at the disabled row's toggle, on the right side of the row.

Concrete case. Five imported scripts reproduce this reliably. All five arrived via SillyTavern import with disabled: true and are still disabled:

Script Order
Tremble Dialogue Regex 37
Measured Dialogue Regex 38
Whisper Dialogue Regex 39
Shout Dialogue Regex 40
FF5 - Universal Dialogue Colorizer 41

All five show the same symptom: dimmed row, no discernible toggle.

Environment

  • Marinara Engine version: 2.4.6 (package.json line 3)
  • Install type: (fill in: source / installer / docker / termux / other)
  • OS + version: Windows
  • Browser or app shell: (fill in — e.g. desktop app shell, Chrome/Edge/Firefox version)
  • Theme: default

Logs, screenshots, or video

No logs — this is purely visual, with no error output. A screenshot of the five dimmed rows above, with the toggle area circled, would carry more weight than the line numbers. Attaching one is recommended.

Additional context

The same defect exists on the Functions surface

While verifying the regex row, the identical !enabled && "opacity-50" wrapper turned up on the Functions row in the same file — PresetsPanel.tsx line 2009, with its own SettingsSwitch mounted inside at line 2096:

Surface Row wrapper dims Switch mounted inside
Regex scripts PresetsPanel.tsx:1671 PresetsPanel.tsx:1760
Functions PresetsPanel.tsx:2009 PresetsPanel.tsx:2096

Both feed the same switch component, so the app-wide fix below resolves both at once; a row-scoped fix has to be applied twice. Included here rather than as a separate issue because it is one defect class with two call sites.

Evidence strength for the Functions half: found by source audit, not reproduced by the reporter (no custom tools are installed on this machine). The code paths were read directly, but the visual symptom has not been observed on that surface — treat it as a code-level finding to confirm.

One further detail on the Functions row: it stacks opacity-50 for disabled (line 2009) against opacity-40 while being dragged (line 2010) on the same element, so a disabled row mid-drag lands dimmer still.

Suggested fix

Either change alone helps; both together is the real fix. Leaving the final call to maintainers, since the second option has app-wide blast radius.

  • Scope the dim to content, not controls. Move opacity-50 off the row wrapper and onto the text nodes only (name, pattern, placement tags) so the row still reads as "off" while the switch stays full-strength. Affects PresetsPanel.tsx lines 1671 and 2009, plus the text spans inside each row.
  • Raise the off-state contrast in SettingsSwitchTrack line 711, e.g. bg-[var(--muted-foreground)]/35 plus a subtle ring. Larger blast radius — this affects every SettingsSwitch in the app, not just regex rows — but it is the underlying accessibility issue.
  • Audit other uses of !enabled && "opacity-50" / !enabled && "opacity-40" that wrap interactive children.

Notes

  • No data is at risk; this is purely visual. The script's enabled value is never touched by the rendering.
  • Workaround available today: open the row's editor (packages/client/src/components/agents/RegexScriptEditor.tsx has its own enable switch, outside the dimmed list row), or use a theme with a brighter --border.

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 @BobEckman0348 on GitHub (Sep 20, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6463 Originally assigned to: @SpicyMarinara on GitHub. # [Issue]: <img width="310" height="722" alt="Image" src="https://github.com/user-attachments/assets/3e59ecf9-f651-429a-8fcf-389ba245d535" /> <img width="310" height="722" alt="Image" src="https://github.com/user-attachments/assets/4eca4545-60c9-49c4-ba44-eeeb4242e9fd" /> <!-- Paste this into a new issue at https://github.com/Pasta-Devs/Marinara-Engine/issues --> <!-- Template: .github/ISSUE_TEMPLATE/issue_report.md --> <!-- Assembled 2026-09-20 against Marinara Engine v2.4.6 --> ## Summary A disabled regex script (and, by the same code path, a disabled function) renders its on/off toggle at effectively zero contrast, so the control can only be found by moving the pointer around the row until it happens to hit. Nothing is broken functionally — two independent styling decisions compound into an inaccessible one. ## Expected behavior The toggle should be clearly visible in both states, so a disabled regex or function can be re-enabled without hunting for the control. ## Actual behavior The toggle is indistinguishable from the row background. Two stacked causes: 1. **The whole row is dimmed, including the control.** `packages/client/src/components/panels/PresetsPanel.tsx`, line 1671, on the regex row wrapper `<div>`: ```tsx className={cn( "group flex flex-wrap items-start gap-2 rounded-xl p-2 transition-colors hover:bg-[var(--sidebar-accent)]", !enabled && "opacity-50", draggedRegexId === script.id && "opacity-40", )} ``` The `SettingsSwitch` is a child of that wrapper (line 1760), so it is dimmed along with the text. CSS opacity composites — a child cannot opt back out. 2. **The off-state switch has almost no contrast to begin with.** `packages/client/src/components/panels/settings/SettingControls.tsx`, line 711, in `SettingsSwitchTrack`: ```tsx checked ? "bg-[var(--primary)]/70 mari-accent-animated" : "bg-[var(--border)]", ``` Off = a bare `--border`-coloured pill. On the default dark palette `--border` is already near-invisible against the panel, and the row's `opacity-50` halves it again. The thumb (line 718) fares no better: ```tsx "pointer-events-none block h-4 w-4 shrink-0 rounded-full bg-[var(--background)] shadow-sm ring-1 ring-[var(--border)] transition-transform", ``` `--background` fill with a `--border` ring, inside a `--border` track — the whole control sits one contrast step above the surface it is drawn on. ## Steps to reproduce 1. Import (or create) a global regex script with `enabled: false` — e.g. a SillyTavern export carrying `disabled: true`. 2. Open the **Presets** panel → **Regexes** section. 3. Look at the disabled row's toggle, on the right side of the row. **Concrete case.** Five imported scripts reproduce this reliably. All five arrived via SillyTavern import with `disabled: true` and are still disabled: | Script | Order | |---|---| | Tremble Dialogue Regex | 37 | | Measured Dialogue Regex | 38 | | Whisper Dialogue Regex | 39 | | Shout Dialogue Regex | 40 | | FF5 - Universal Dialogue Colorizer | 41 | All five show the same symptom: dimmed row, no discernible toggle. ## Environment - Marinara Engine version: **2.4.6** (`package.json` line 3) - Install type: *(fill in: source / installer / docker / termux / other)* - OS + version: Windows - Browser or app shell: *(fill in — e.g. desktop app shell, Chrome/Edge/Firefox version)* - Theme: default ## Logs, screenshots, or video No logs — this is purely visual, with no error output. A screenshot of the five dimmed rows above, with the toggle area circled, would carry more weight than the line numbers. Attaching one is recommended. ## Additional context ### The same defect exists on the Functions surface While verifying the regex row, the identical `!enabled && "opacity-50"` wrapper turned up on the **Functions** row in the same file — `PresetsPanel.tsx` line 2009, with its own `SettingsSwitch` mounted inside at line 2096: | Surface | Row wrapper dims | Switch mounted inside | | --- | --- | --- | | Regex scripts | `PresetsPanel.tsx:1671` | `PresetsPanel.tsx:1760` | | Functions | `PresetsPanel.tsx:2009` | `PresetsPanel.tsx:2096` | Both feed the same switch component, so the app-wide fix below resolves both at once; a row-scoped fix has to be applied twice. Included here rather than as a separate issue because it is one defect class with two call sites. **Evidence strength for the Functions half:** found by source audit, not reproduced by the reporter (no custom tools are installed on this machine). The code paths were read directly, but the visual symptom has not been observed on that surface — treat it as a code-level finding to confirm. One further detail on the Functions row: it stacks `opacity-50` for disabled (line 2009) against `opacity-40` while being dragged (line 2010) on the same element, so a disabled row mid-drag lands dimmer still. ### Suggested fix Either change alone helps; both together is the real fix. Leaving the final call to maintainers, since the second option has app-wide blast radius. - **Scope the dim to content, not controls.** Move `opacity-50` off the row wrapper and onto the text nodes only (name, pattern, placement tags) so the row still reads as "off" while the switch stays full-strength. Affects `PresetsPanel.tsx` lines 1671 and 2009, plus the text spans inside each row. - **Raise the off-state contrast** in `SettingsSwitchTrack` line 711, e.g. `bg-[var(--muted-foreground)]/35` plus a subtle ring. Larger blast radius — this affects every `SettingsSwitch` in the app, not just regex rows — but it is the underlying accessibility issue. - Audit other uses of `!enabled && "opacity-50"` / `!enabled && "opacity-40"` that wrap interactive children. ### Notes - No data is at risk; this is purely visual. The script's `enabled` value is never touched by the rendering. - Workaround available today: open the row's editor (`packages/client/src/components/agents/RegexScriptEditor.tsx` has its own enable switch, outside the dimmed list row), or use a theme with a brighter `--border`. ## 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:05:10 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Sep 20, 2026):

The opacity fix should be enough.

<!-- gh-comment-id:5751920509 --> @SpicyMarinara commented on GitHub (Sep 20, 2026): The opacity fix should be enough.
Author
Owner

@SpicyMarinara commented on GitHub (Sep 21, 2026):

I am taking this in #6482 for @SpicyMarinara. The sweep will reuse the existing schedule and UI paths and include focused regression checks.

<!-- gh-comment-id:5758022765 --> @SpicyMarinara commented on GitHub (Sep 21, 2026): I am taking this in #6482 for @SpicyMarinara. The sweep will reuse the existing schedule and UI paths and include focused regression checks.
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#3618
No description provided.