[PR #4283] [MERGED] Fix Secret Plot run interval editing #6318

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4283
Author: @SpicyMarinara
Created: 7/30/2026
Status: ✅ Merged
Merged: 7/30/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/secret-plot-run-interval-4277


📝 Commits (4)

  • 3204794 start issue 4277 investigation
  • 2b4020e fix secret plot run interval editing
  • 9bcc687 test repeated secret plot interval edits
  • 9c43cc6 cover secret plot fixture setup cleanup

📊 Changes

3 files changed (+133 additions, -9 deletions)

View changed files

📝 e2e/core-flows.e2e.ts (+113 -0)
📝 packages/client/src/components/chat/ChatSettingsDrawer.tsx (+4 -9)
📝 scripts/regressions/open-issues.regression.ts (+16 -0)

📄 Description

Closes #4277

Why

After Narrative Director was added to a chat, its Secret Plot Run Interval appeared locked. The browser supplies edited input values as strings, but the Chat Settings control passed that string to a number-only normalizer. The normalizer therefore restored the previous value on every change. The setup form used a different string-aware path, which explains why removing and re-adding the agent allowed exactly one more edit.

What changed

  • Replaced the installed-agent interval field with the shared DraftNumberInput control.
  • Kept an editable local draft, clamped committed values to 1–100, and saved once on blur or Enter.
  • Added source-wiring and Playwright regressions for repeated edits, browser string input, bounds, and persistence after reload.

Impact

Secret Plot Run Interval can now be changed repeatedly after Narrative Director is installed, including on touch/mobile input, without per-keystroke metadata writes.

Automated validation

  • pnpm check — passed (Impeccable context, localization, ESLint/TypeScript, production build).
  • Focused issue #4277 source regression — passed.
  • Focused Playwright interaction regression — passed (repeated commits, Enter/blur, 1–100 clamping, reload persistence).
  • pnpm regression:issues — staging baseline stops before this assertion at the pre-existing background-organization expectation (favorites: [] is now returned but not expected at line 330).
  • pnpm smoke:ui — completed with 150 passed and 86 project skips; 12 unrelated staging-baseline failures remain in accent-state and background-library tests.

Manual verification requested

  • Add Narrative Director to a Roleplay chat with Secret Plot enabled.
  • Change Run Interval, blur the field, then reopen Chat Settings and verify the value persisted.
  • Change Run Interval a second time and verify it remains editable and persists.
  • Repeat on Firefox/Android or another touch browser.
  • Verify values below 1 and above 100 clamp to the supported range.

Summary by CodeRabbit

  • Bug Fixes

    • Improved the Narrative Director’s “Secret Plot run interval” setting to reliably save edited numeric values.
    • Switched the field to a draft-based numeric input so browser-entered text commits correctly, with expected clamping for out-of-range values.
  • Tests

    • Added a regression test verifying the draft input behavior and persisted narrativeDirectorSecretPlotRunInterval.
    • Added an E2E test confirming the run interval stays editable across repeated commits and is restored after reload.

🔄 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/4283 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 7/30/2026 **Status:** ✅ Merged **Merged:** 7/30/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/secret-plot-run-interval-4277` --- ### 📝 Commits (4) - [`3204794`](https://github.com/Pasta-Devs/Marinara-Engine/commit/320479482e3aa673f4ed1f3750197008f0652fe6) start issue 4277 investigation - [`2b4020e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2b4020e554825617cc1e70bf5fdc1544b8d71e62) fix secret plot run interval editing - [`9bcc687`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9bcc687650e263f007b045fcb43d5b0b4ad9d60c) test repeated secret plot interval edits - [`9c43cc6`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9c43cc6fc3301c2f4ca986a2eb2b42421eb43d64) cover secret plot fixture setup cleanup ### 📊 Changes **3 files changed** (+133 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `e2e/core-flows.e2e.ts` (+113 -0) 📝 `packages/client/src/components/chat/ChatSettingsDrawer.tsx` (+4 -9) 📝 `scripts/regressions/open-issues.regression.ts` (+16 -0) </details> ### 📄 Description Closes #4277 ## Why After Narrative Director was added to a chat, its Secret Plot Run Interval appeared locked. The browser supplies edited input values as strings, but the Chat Settings control passed that string to a number-only normalizer. The normalizer therefore restored the previous value on every change. The setup form used a different string-aware path, which explains why removing and re-adding the agent allowed exactly one more edit. ## What changed - Replaced the installed-agent interval field with the shared `DraftNumberInput` control. - Kept an editable local draft, clamped committed values to 1–100, and saved once on blur or Enter. - Added source-wiring and Playwright regressions for repeated edits, browser string input, bounds, and persistence after reload. ## Impact Secret Plot Run Interval can now be changed repeatedly after Narrative Director is installed, including on touch/mobile input, without per-keystroke metadata writes. ## Automated validation - `pnpm check` — passed (Impeccable context, localization, ESLint/TypeScript, production build). - Focused issue #4277 source regression — passed. - Focused Playwright interaction regression — passed (repeated commits, Enter/blur, 1–100 clamping, reload persistence). - `pnpm regression:issues` — staging baseline stops before this assertion at the pre-existing background-organization expectation (`favorites: []` is now returned but not expected at line 330). - `pnpm smoke:ui` — completed with 150 passed and 86 project skips; 12 unrelated staging-baseline failures remain in accent-state and background-library tests. ## Manual verification requested - [ ] Add Narrative Director to a Roleplay chat with Secret Plot enabled. - [ ] Change Run Interval, blur the field, then reopen Chat Settings and verify the value persisted. - [ ] Change Run Interval a second time and verify it remains editable and persists. - [ ] Repeat on Firefox/Android or another touch browser. - [ ] Verify values below 1 and above 100 clamp to the supported range. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved the Narrative Director’s **“Secret Plot run interval”** setting to reliably save edited numeric values. * Switched the field to a draft-based numeric input so browser-entered text commits correctly, with expected clamping for out-of-range values. * **Tests** * Added a regression test verifying the draft input behavior and persisted `narrativeDirectorSecretPlotRunInterval`. * Added an E2E test confirming the run interval stays editable across repeated commits and is restored after reload. <!-- 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:09:17 +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#6318
No description provided.