Skip to content

refactor(magic-rewrite): prepare V1 for review#1256

Closed
cha1latte wants to merge 3 commits into
Pasta-Devs:stagingfrom
cha1latte:prep/pr-1238-magic-rewrite-staging
Closed

refactor(magic-rewrite): prepare V1 for review#1256
cha1latte wants to merge 3 commits into
Pasta-Devs:stagingfrom
cha1latte:prep/pr-1238-magic-rewrite-staging

Conversation

@cha1latte
Copy link
Copy Markdown
Collaborator

@cha1latte cha1latte commented May 26, 2026

Linked issue

Refs #1183
Refs #1238

Why this change

PR #1238 contains the Magic Rewrite V1 feature, but the branch was based on main while targeting staging, which pulls unrelated tracker/composer/changelog work into the review diff.

This cleanup branch replays the Magic Rewrite work onto staging and separates the first server/client seams so the feature is easier to review and refactor without changing the intended V1 behavior.

What changed

  • Replayed the Magic Rewrite V1 surface onto upstream/staging.
  • Kept the editor integrations for expanded textareas and lorebook entry content.
  • Moved Magic Rewrite generation logic into packages/server/src/services/magic-rewrite/magic-rewrite.service.ts.
  • Kept packages/server/src/routes/magic-rewrite.routes.ts focused on request validation and HTTP response handling.
  • Moved Magic Rewrite client request/localStorage/loading/error state into packages/client/src/hooks/use-magic-rewrite.ts.
  • Preserved existing config-error behavior as 400 responses.

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

  • Codex ran pnpm check successfully in C:\tmp\marinara-pr-1238.
  • Codex ran git diff --check successfully.
  • Codex ran a Bunny maintainer-equivalent pass for branch/base, scope, logging, and proof quality.
  • Codex smoke-tested the Magic Rewrite UI locally in browser from the expanded character description editor.
  • Codex smoke-tested the Magic Rewrite UI locally in browser from a lorebook entry content editor.
  • Provider-runtime verification is still pending: test Generate Rewrite with a configured text LLM connection.

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)

Character editor Magic Rewrite panel:

Character editor Magic Rewrite panel

Lorebook entry Magic Rewrite panel:

Lorebook entry Magic Rewrite panel

Kevin Ho and others added 2 commits May 26, 2026 09:59
Slim V1 of Magic Rewrite: AI-assisted text rewriting for lorebook,
character, and persona editors.

- POST /api/magic-rewrite/generate endpoint using existing default
  agent connection fallback
- MagicRewritePanel: instruction textarea, word-level diff view,
  HelpTooltip noting agent connection usage
- Integrated into ExpandedTextarea and LorebookFormFields modals
  with Apply/Back flow

Addresses Pasta-Devs#1183 (scoped V1 per maintainer feedback).
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 26, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 02e7a6d5-6f8f-4023-bb7b-6c886467c22a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added the docs label May 26, 2026
@cha1latte
Copy link
Copy Markdown
Collaborator Author

closing accidentally had this on staging

@cha1latte cha1latte closed this May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant