[PR #2625] [MERGED] feat(regex): scoped-regex management polish — global-only Presets, character-card manager, name fix #5691

Closed
opened 2026-10-22 04:18:35 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2625
Author: @kolacheee
Created: 6/18/2026
Status: ✅ Merged
Merged: 6/18/2026
Merged by: @SpicyMarinara

Base: staging ← Head: feat/staging-scoped-regex-polish


📝 Commits (3)

  • 0c36fd0 feat(regex): scoped-regex management — global-only Presets, character-card manager, name fix
  • e460ab8 feat(regex): return to the character's Advanced tab when closing the regex editor
  • f63255e fix(regex): correct scoped import export icons

📊 Changes

6 files changed (+434 additions, -27 deletions)

View changed files

📝 packages/client/src/components/agents/RegexScriptEditor.tsx (+10 -4)
📝 packages/client/src/components/characters/CharacterEditor.tsx (+14 -2)
➕ packages/client/src/components/characters/CharacterRegexSection.tsx (+350 -0)
📝 packages/client/src/components/chat/ChatSettingsDrawer.tsx (+16 -13)
📝 packages/client/src/components/panels/PresetsPanel.tsx (+7 -1)
📝 packages/client/src/stores/ui.store.ts (+37 -7)

📄 Description

Linked issue

Closes #2624.

Why this change

Follow-up polish to the character-scoped regex feature (#2603). Scoped scripts still polluted the global Presets → Regexes list, had no dedicated management home, and the per-character list in Chat Settings mislabeled its groups. This makes scoped regex behave as intended: scoped scripts live with the character; global scripts live in Presets.

What changed

  • Presets → Regexes is global-only. Character-scoped scripts (non-empty targetCharacterIds), including ST cards imported as "Character only," are filtered out of the global list.
  • Character editor → Advanced → "Regex Scripts". A new section (CharacterRegexSection) to list / create / edit / delete / toggle / import / export that character's scoped scripts. "Create" opens the existing RegexScriptEditor pre-scoped to the character via a new openRegexDetail(id, { defaultCharacterIds }) option.
  • Scoped Regex Scripts group labels. Chat Settings → Scoped Regex Scripts now shows each character's name (via parseCharacterDisplayData) instead of the literal "Character".

These three are coupled: hiding scoped scripts from Presets removes their only create/edit/delete surface (Chat Settings only toggles them), so the character-card manager is the replacement home.

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

Manual verification notes

  • Confirmed that character-scoped regex scripts do not populate in the global Presets → Regexes list
  • Confirmed that actual character names appear under the Chat Settings Scoped Regex Scripts, as opposed to literal "Character"
  • Confirmed that a Regex Scripts section exists under the Advanced tab in character cards
  • Confirmed that create, edit, delete, import, and export functionalities work as intended in character Regex Scripts section

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

{38CB2853-4799-4915-B705-0D9013A0AFDD} {FE955935-AE08-42AD-9CB4-6B72EE1F3552}

Summary by CodeRabbit

  • New Features
    • Added character-scoped regex script management within the Character Editor's Advanced tab, allowing scripts to be created, edited, imported, exported, and deleted for individual characters.
    • Improved navigation context preservation when creating and saving regex scripts, automatically returning users to the previous character editor tab.
    • Enhanced Presets Panel to display only global regex scripts, with character-scoped scripts accessible via character settings.
    • Restored user preference for default Character Editor tab on reopening.

🔄 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/2625 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 6/18/2026 **Status:** ✅ Merged **Merged:** 6/18/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feat/staging-scoped-regex-polish` --- ### 📝 Commits (3) - [`0c36fd0`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0c36fd00601b73638ad4e1107bc37125b6f2fd23) feat(regex): scoped-regex management — global-only Presets, character-card manager, name fix - [`e460ab8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e460ab81485a5f99d0b578b2e76702e9e48681be) feat(regex): return to the character's Advanced tab when closing the regex editor - [`f63255e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f63255edba0614f7f660833c1345b8cc4744e894) fix(regex): correct scoped import export icons ### 📊 Changes **6 files changed** (+434 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/agents/RegexScriptEditor.tsx` (+10 -4) 📝 `packages/client/src/components/characters/CharacterEditor.tsx` (+14 -2) ➕ `packages/client/src/components/characters/CharacterRegexSection.tsx` (+350 -0) 📝 `packages/client/src/components/chat/ChatSettingsDrawer.tsx` (+16 -13) 📝 `packages/client/src/components/panels/PresetsPanel.tsx` (+7 -1) 📝 `packages/client/src/stores/ui.store.ts` (+37 -7) </details> ### 📄 Description ## Linked issue Closes #2624. ## Why this change Follow-up polish to the character-scoped regex feature (#2603). Scoped scripts still polluted the global Presets → Regexes list, had no dedicated management home, and the per-character list in Chat Settings mislabeled its groups. This makes scoped regex behave as intended: **scoped scripts live with the character; global scripts live in Presets.** ## What changed - **Presets → Regexes is global-only.** Character-scoped scripts (non-empty `targetCharacterIds`), including ST cards imported as "Character only," are filtered out of the global list. - **Character editor → Advanced → "Regex Scripts".** A new section (`CharacterRegexSection`) to list / create / edit / delete / toggle / import / export that character's scoped scripts. "Create" opens the existing `RegexScriptEditor` pre-scoped to the character via a new `openRegexDetail(id, { defaultCharacterIds })` option. - **Scoped Regex Scripts group labels.** Chat Settings → Scoped Regex Scripts now shows each character's name (via `parseCharacterDisplayData`) instead of the literal "Character". These three are coupled: hiding scoped scripts from Presets removes their only create/edit/delete surface (Chat Settings only *toggles* them), so the character-card manager is the replacement home. ## Validation - [x] `pnpm check` passes locally - [x] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [x] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes - Confirmed that character-scoped regex scripts do not populate in the global Presets → Regexes list - Confirmed that actual character names appear under the Chat Settings Scoped Regex Scripts, as opposed to literal "Character" - Confirmed that a Regex Scripts section exists under the Advanced tab in character cards - Confirmed that create, edit, delete, import, and export functionalities work as intended in character Regex Scripts section ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) <img width="690" height="590" alt="{38CB2853-4799-4915-B705-0D9013A0AFDD}" src="https://github.com/user-attachments/assets/3fd6dff4-4dde-4949-bfe0-d064b8cbaed4" /> <img width="793" height="558" alt="{FE955935-AE08-42AD-9CB4-6B72EE1F3552}" src="https://github.com/user-attachments/assets/ecfaadfb-a6bd-49c1-a2d1-dba0ea90726d" /> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added character-scoped regex script management within the Character Editor's Advanced tab, allowing scripts to be created, edited, imported, exported, and deleted for individual characters. * Improved navigation context preservation when creating and saving regex scripts, automatically returning users to the previous character editor tab. * Enhanced Presets Panel to display only global regex scripts, with character-scoped scripts accessible via character settings. * Restored user preference for default Character Editor tab on reopening. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:18:35 +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#5691
No description provided.