mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #1260] [MERGED] feat(magic-rewrite): port V1 to refactor #5010
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#5010
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1260
Author: @cha1latte
Created: 5/26/2026
Status: ✅ Merged
Merged: 5/26/2026
Merged by: @cha1latte
Base:
refactor← Head:prep/pr-1238-magic-rewrite-refactor-v2📝 Commits (5)
991a4c2Port Magic Rewrite to refactordea9415Preserve expanded editor edits on Escape2850defMerge remote-tracking branch 'upstream/refactor' into prep/pr-1238-magic-rewrite-refactor-v22f6f5d2Add Magic Rewrite proof evidence8f08fcdAddress Magic Rewrite review feedback📊 Changes
6 files changed (+519 additions, -46 deletions)
View changed files
➕
docs/evidence/pr-1260-magic-rewrite/after.png(+0 -0)➕
docs/evidence/pr-1260-magic-rewrite/provider-request.json(+18 -0)📝
src/features/catalog/lorebooks/components/LorebookFormFields.tsx(+128 -28)📝
src/shared/components/ui/ExpandedTextarea.tsx(+97 -18)➕
src/shared/components/ui/MagicRewritePanel.tsx(+159 -0)➕
src/shared/hooks/use-magic-rewrite.ts(+117 -0)📄 Description
Linked issue
Refs #1183
Refs #1238
Why this change
PR #1238 contains the Magic Rewrite V1 feature, but its branch was not based on the active
refactorbranch.This PR ports the Magic Rewrite V1 surface directly onto
refactorand adapts the implementation to the refactor architecture, where editor UI calls the shared LLM gateway instead of adding the old package/server route path.What changed
llmApi.complete.MagicRewritePanelwith instructions, Generate Rewrite, Before/After preview, and word-level diff highlighting.Refactor impact
Primary owner:
Impact areas reviewed:
src/shared/api/llm-api.tsandstorageApi; no old package/server route was restored.llm_completevia the Rust remote runtime.Boundary notes:
src/shared/hooks/use-magic-rewrite.tsstays in shared code and imports only shared API wrappers.Pressure points touched:
src-tauri/src/lib.rscommand registration, mode surface, or import-module changes.Validation
pnpm checkpasses locallypnpm typecheckpasses locallypnpm buildpasses locallypnpm check:architecturepasses locallypnpm check:docspasses locallycargo check --manifest-path src-tauri/Cargo.toml --workspacepasses locallyManual verification notes
pnpm check:architecturesuccessfully inC:\tmp\marinara-pr-1238.pnpm check:frontendsuccessfully.pnpm checksuccessfully after refreshing onto currentupstream/refactor.git diff --check upstream/refactor...HEADsuccessfully.node scratch\verify-pr-1260-magic-rewrite.mjssuccessfully. The harness starts a disposable Rust remote runtime, seeds a default text connection and character, points the app at a fake OpenAI-compatible provider, opens the real character Description expanded editor, runs Magic Rewrite, receives the provider rewrite throughllm_complete, applies it, and captures proof.8f08fcd5and reran local validation.Docs and release impact
README.mdCONTRIBUTING.mddocs/developer/AGENTS.mdAdded scoped PR evidence under
docs/evidence/pr-1260-magic-rewrite/; no user-facing docs or release metadata changed.UI evidence
Runtime proof screenshot:
Provider request proof:
github.com/cha1latte/Marinara-Engine@8f08fcd5de/docs/evidence/pr-1260-magic-rewrite/provider-request.json🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.