[PR #264] [MERGED] feat(conversation): schedule generation preferences (relocated) #4535

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/264
Author: @LukaTheHero
Created: 4/27/2026
Status: ✅ Merged
Merged: 4/27/2026
Merged by: @LukaTheHero

Base: main ← Head: feat/schedule-prefs-relocated


📝 Commits (4)

  • 3b70aae feat(conversation): add schedule generation preferences
  • 78cf524 feat(conversation): add loading state to schedule regenerate button
  • 403f8f2 fix(conversation): address CodeRabbit review on PR #221
  • 70a3edb fix(conversation): move schedule prefs textarea from General to chat settings

📊 Changes

7 files changed (+110 additions, -8 deletions)

View changed files

📝 packages/client/src/components/chat/ChatSettingsDrawer.tsx (+65 -4)
📝 packages/client/src/components/chat/ChatSetupWizard.tsx (+6 -1)
📝 packages/client/src/components/panels/SettingsPanel.tsx (+0 -1)
📝 packages/client/src/hooks/use-autonomous-messaging.ts (+6 -1)
📝 packages/client/src/stores/ui.store.ts (+9 -0)
📝 packages/server/src/routes/conversation.routes.ts (+14 -1)
📝 packages/server/src/services/conversation/schedule.service.ts (+10 -0)

📄 Description

Why this change

Builds on @JorgeLTE's work in #221. The feature itself — global authorial guidance for character schedule generation, the active-preference indicator card in the chat settings drawer, the regenerate-button loading state, server-side validation, the per-call wiring across ChatSetupWizard, useAutonomousMessaging, and the manual Regenerate button — all lands as Jorge wrote it. Only the input control's location has changed, per the discussion in #221 (comment).

What moved

The "Schedule generation preferences" textarea was originally placed in Settings → General. Three reasons that didn't fit:

  • Conversation-mode-only content — the textarea has no effect in roleplay, game, or visual-novel chats, but General is app-wide.
  • Prompt-shaping content, not an app preference — it's free-form text injected into the schedule-generation system prompt under a User preferences: block. That's the same kind of content as Author's Notes or customConversationPrompt, not the same kind as "messages per page" or "send on Enter".
  • Visual fit — it was the only long-form free-text field in a panel of toggles/sliders/selects. It dominated the layout.

Marinara called for Conversations → Chat Settings → Agents → Schedules. The functional equivalent in the codebase is the Autonomous Messaging section of the chat settings drawer, where all the schedule machinery already lives (Autonomous Messages toggle, Character Exchanges toggle, Selfie Connection, Schedule status, Regenerate button, ScheduleEditor).

Where it is now

ChatSettingsDrawer.tsx Autonomous Messaging section, ordered top-to-bottom:

  1. Autonomous Messages toggle
  2. Character Exchanges toggle (group only)
  3. Selfie Connection picker
  4. Schedule generation preferences textarea ← new home
  5. Active schedule-generation preference indicator card (only when textarea has text)
  6. Schedule status + Regenerate button
  7. ScheduleEditor

The editor → indicator → regenerate → per-character editor flow now reads as one coherent column inside one section.

Implementation notes

  • The textarea is rendered inside the chat settings drawer but the value is still in the global Zustand store (scheduleGenerationPreferences), so it's the same global preference Jorge designed — not per-chat. The HelpTooltip text explicitly says "This setting is global — it applies to every conversation chat" so users don't get confused by the in-chat-settings location into expecting per-chat scope.
  • The indicator card's "Edit in Settings → General" stale hint was removed; the editor is now directly above it.
  • Nothing else changed. The store field, the per-call wiring (ChatSetupWizard, useAutonomousMessaging, the manual Regenerate handler), the server route's body validation and prompt injection in schedule.service.ts — all preserved untouched.

Validation

  • pnpm check passes (TS + ESLint + build, all three workspaces)
  • Manual: tested in browser. Textarea appears in the Autonomous Messaging section. Edits persist (global store + Zustand persist). Indicator card updates live as you type. Value still flows through to POST /conversation/schedule/generate on the manual Regenerate path. Confirmed the textarea is gone from Settings → General. Switching between conversation chats keeps the value (global store, not per-chat). Switching to a non-conversation chat hides the section entirely (existing isConversation gate still applies).

Credit

Original feature work is @JorgeLTE's in #221 — those three commits (the feature, the loading state fix, the CodeRabbit follow-up) are preserved on this branch with their authorship intact. This PR only relocates the input control.

Summary by CodeRabbit

  • New Features

    • Added schedule generation preferences input to customize character schedules
    • User preferences are now considered during schedule generation
  • Improvements

    • Schedule regeneration displays active preferences and shows loading indicator
    • Prevented concurrent regeneration requests with UI state lock

🔄 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/264 **Author:** [@LukaTheHero](https://github.com/LukaTheHero) **Created:** 4/27/2026 **Status:** ✅ Merged **Merged:** 4/27/2026 **Merged by:** [@LukaTheHero](https://github.com/LukaTheHero) **Base:** `main` ← **Head:** `feat/schedule-prefs-relocated` --- ### 📝 Commits (4) - [`3b70aae`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3b70aae20c4ace34a7bdc6286bc968c5dfa440fc) feat(conversation): add schedule generation preferences - [`78cf524`](https://github.com/Pasta-Devs/Marinara-Engine/commit/78cf524f9acdbeac493bb70e74360efaf0af03e6) feat(conversation): add loading state to schedule regenerate button - [`403f8f2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/403f8f2900e5dbe096ebd13142bd984bdc4bf8a3) fix(conversation): address CodeRabbit review on PR #221 - [`70a3edb`](https://github.com/Pasta-Devs/Marinara-Engine/commit/70a3edba47d3e42f763e10ff5832349734867d7f) fix(conversation): move schedule prefs textarea from General to chat settings ### 📊 Changes **7 files changed** (+110 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/chat/ChatSettingsDrawer.tsx` (+65 -4) 📝 `packages/client/src/components/chat/ChatSetupWizard.tsx` (+6 -1) 📝 `packages/client/src/components/panels/SettingsPanel.tsx` (+0 -1) 📝 `packages/client/src/hooks/use-autonomous-messaging.ts` (+6 -1) 📝 `packages/client/src/stores/ui.store.ts` (+9 -0) 📝 `packages/server/src/routes/conversation.routes.ts` (+14 -1) 📝 `packages/server/src/services/conversation/schedule.service.ts` (+10 -0) </details> ### 📄 Description ## Why this change Builds on @JorgeLTE's work in #221. The feature itself — global authorial guidance for character schedule generation, the active-preference indicator card in the chat settings drawer, the regenerate-button loading state, server-side validation, the per-call wiring across `ChatSetupWizard`, `useAutonomousMessaging`, and the manual Regenerate button — all lands as Jorge wrote it. Only the input control's **location** has changed, per the discussion in [#221 (comment)](https://github.com/Pasta-Devs/Marinara-Engine/pull/221#issuecomment-4330004340). ## What moved The \"Schedule generation preferences\" textarea was originally placed in `Settings → General`. Three reasons that didn't fit: - **Conversation-mode-only content** — the textarea has no effect in roleplay, game, or visual-novel chats, but General is app-wide. - **Prompt-shaping content, not an app preference** — it's free-form text injected into the schedule-generation system prompt under a `User preferences:` block. That's the same kind of content as Author's Notes or `customConversationPrompt`, not the same kind as \"messages per page\" or \"send on Enter\". - **Visual fit** — it was the only long-form free-text field in a panel of toggles/sliders/selects. It dominated the layout. Marinara called for `Conversations → Chat Settings → Agents → Schedules`. The functional equivalent in the codebase is the **Autonomous Messaging** section of the chat settings drawer, where all the schedule machinery already lives (Autonomous Messages toggle, Character Exchanges toggle, Selfie Connection, Schedule status, Regenerate button, ScheduleEditor). ## Where it is now `ChatSettingsDrawer.tsx` Autonomous Messaging section, ordered top-to-bottom: 1. Autonomous Messages toggle 2. Character Exchanges toggle (group only) 3. Selfie Connection picker 4. **Schedule generation preferences** textarea ← new home 5. Active schedule-generation preference indicator card (only when textarea has text) 6. Schedule status + Regenerate button 7. ScheduleEditor The editor → indicator → regenerate → per-character editor flow now reads as one coherent column inside one section. ## Implementation notes - The textarea is rendered inside the chat settings drawer but the value is still in the global Zustand store (`scheduleGenerationPreferences`), so it's the same global preference Jorge designed — not per-chat. The `HelpTooltip` text explicitly says \"This setting is global — it applies to every conversation chat\" so users don't get confused by the in-chat-settings location into expecting per-chat scope. - The indicator card's \"Edit in Settings → General\" stale hint was removed; the editor is now directly above it. - Nothing else changed. The store field, the per-call wiring (`ChatSetupWizard`, `useAutonomousMessaging`, the manual Regenerate handler), the server route's body validation and prompt injection in `schedule.service.ts` — all preserved untouched. ## Validation - [x] `pnpm check` passes (TS + ESLint + build, all three workspaces) - [x] Manual: tested in browser. Textarea appears in the Autonomous Messaging section. Edits persist (global store + Zustand persist). Indicator card updates live as you type. Value still flows through to `POST /conversation/schedule/generate` on the manual Regenerate path. Confirmed the textarea is gone from `Settings → General`. Switching between conversation chats keeps the value (global store, not per-chat). Switching to a non-conversation chat hides the section entirely (existing `isConversation` gate still applies). ## Credit Original feature work is @JorgeLTE's in #221 — those three commits (the feature, the loading state fix, the CodeRabbit follow-up) are preserved on this branch with their authorship intact. This PR only relocates the input control. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added schedule generation preferences input to customize character schedules * User preferences are now considered during schedule generation * **Improvements** * Schedule regeneration displays active preferences and shows loading indicator * Prevented concurrent regeneration requests with UI state lock <!-- 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:08:30 +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#4535
No description provided.