[PR #5872] [CLOSED] Random variables implementation + fix for variables not showing on first_parameters. #6975

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5872
Author: @Bainshie
Created: 9/5/2026
Status: ❌ Closed

Base: staging ← Head: RandomVariables


📝 Commits (4)

  • ba8f368 fix: correct auto-confirm reset ordering in ChoiceSelectionModal
  • b77f60c feat: allow Random Pick on single-select preset variables
  • b52e06f fix(chat): resolve preset choice variables in the starting message
  • e20ea12 Merge branch 'staging' into RandomVariables

📊 Changes

4 files changed (+72 additions, -45 deletions)

View changed files

📝 packages/client/src/components/chat/ChatSetupWizard.tsx (+14 -4)
📝 packages/client/src/components/presets/ChoiceSelectionModal.tsx (+15 -2)
📝 packages/client/src/components/presets/PresetEditor.tsx (+41 -39)
📝 packages/client/src/localization/locales/en.json (+2 -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

https://github.com/Pasta-Devs/Marinara-Engine/issues/5868
https://github.com/Pasta-Devs/Marinara-Engine/issues/5869

Closes #

Why this change

Allows cards to be created that automatically select from larger data values, to combat inherent AI not being very random at all. Used locally to create a "GM Scenario generator" with 54K+ potential different combinations.

What changed

Expanded the current random functionality from mutli-select, to single select.
Random variables will automatically be chosen on each initial chat creation.
Variables correctly come through on the first_message call.

Validation

  • [ X] pnpm check passes locally (Prettier fails on large section of changes outside of this PR's files)
  • Container (Docker / Podman) built and ran without issue (DockerLite currently broken on staging in general)
  • [ 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)
  • Read and followed CONTRIBUTING.md

Manual verification notes

Create new variable in a preset.
Fill with values, and select "Random Pick" for this variable.
Apply this variable to a first_message parameter.

Create a new chat. A random value should be created. This variable should appear in the first message correctly.
Create another new chat. A random value should be created. This variable should appear in the first message correctly.
Create another new chat. A random value should be created. This variable should appear in the first message correctly.

Docs and release impact

  • [X ] No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) 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)

Screenshot 2026-09-05 140928 Screenshot 2026-09-05 141002 Screenshot 2026-09-05 141228 Screenshot 2026-09-05 141310

Summary by CodeRabbit

  • New Features

    • Preset variables configured for random selection now receive an option automatically.
    • Selection dialogs can confirm automatically once all variables have completed random selection.
    • Random selection settings are now available for additional variable types, with clearer guidance and controls.
    • Multi-select separators remain available when applicable.
    • Added guidance explaining random selection behavior and default options.
  • Bug Fixes

    • Preset choice macros in roleplay greetings are now resolved correctly before greetings are saved.

🔄 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/5872 **Author:** [@Bainshie](https://github.com/Bainshie) **Created:** 9/5/2026 **Status:** ❌ Closed **Base:** `staging` ← **Head:** `RandomVariables` --- ### 📝 Commits (4) - [`ba8f368`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ba8f368b7b1553c76ad19a9f443691beec2dc1ff) fix: correct auto-confirm reset ordering in ChoiceSelectionModal - [`b77f60c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b77f60c41a138b2e04cfeaa6e975533ded8835ab) feat: allow Random Pick on single-select preset variables - [`b52e06f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b52e06f3de3343c8d38f479872dc38504beabdf2) fix(chat): resolve preset choice variables in the starting message - [`e20ea12`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e20ea12fe0f24bc819c652d967f6cc48a067a4a4) Merge branch 'staging' into RandomVariables ### 📊 Changes **4 files changed** (+72 additions, -45 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/chat/ChatSetupWizard.tsx` (+14 -4) 📝 `packages/client/src/components/presets/ChoiceSelectionModal.tsx` (+15 -2) 📝 `packages/client/src/components/presets/PresetEditor.tsx` (+41 -39) 📝 `packages/client/src/localization/locales/en.json` (+2 -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 https://github.com/Pasta-Devs/Marinara-Engine/issues/5868 https://github.com/Pasta-Devs/Marinara-Engine/issues/5869 Closes # ## Why this change Allows cards to be created that automatically select from larger data values, to combat inherent AI not being very random at all. Used locally to create a "GM Scenario generator" with 54K+ potential different combinations. - ## What changed Expanded the current random functionality from mutli-select, to single select. Random variables will automatically be chosen on each initial chat creation. Variables correctly come through on the first_message call. - ## Validation <!-- Required: include commands run and/or manual checks performed --> - [ X] `pnpm check` passes locally (Prettier fails on large section of changes outside of this PR's files) - [ ] Container (Docker / Podman) built and ran without issue (DockerLite currently broken on staging in general) - [ 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 Create new variable in a preset. Fill with values, and select "Random Pick" for this variable. Apply this variable to a first_message parameter. Create a new chat. A random value should be created. This variable should appear in the first message correctly. Create another new chat. A random value should be created. This variable should appear in the first message correctly. Create another new chat. A random value should be created. This variable should appear in the first message correctly. - ## Docs and release impact - [X ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) 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) <img width="783" height="537" alt="Screenshot 2026-09-05 140928" src="https://github.com/user-attachments/assets/bfab19a4-92d4-4aa4-8f66-0a8caa650591" /> <img width="487" height="380" alt="Screenshot 2026-09-05 141002" src="https://github.com/user-attachments/assets/6d525c0b-00e1-47bf-8475-b6c3aefc9fd6" /> <img width="1085" height="359" alt="Screenshot 2026-09-05 141228" src="https://github.com/user-attachments/assets/d4db85a0-e85f-486d-81c8-5708866dad42" /> <img width="717" height="729" alt="Screenshot 2026-09-05 141310" src="https://github.com/user-attachments/assets/1a357ba6-ec97-47ae-a51d-76c46d47aa66" /> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Preset variables configured for random selection now receive an option automatically. - Selection dialogs can confirm automatically once all variables have completed random selection. - Random selection settings are now available for additional variable types, with clearer guidance and controls. - Multi-select separators remain available when applicable. - Added guidance explaining random selection behavior and default options. - **Bug Fixes** - Preset choice macros in roleplay greetings are now resolved correctly before greetings are saved. <!-- 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-23 04:15:23 +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#6975
No description provided.