[PR #1743] [MERGED] Add gallery image prompt regeneration #5254

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1743
Author: @cha1latte
Created: 5/31/2026
Status: ✅ Merged
Merged: 5/31/2026
Merged by: @cha1latte

Base: refactor ← Head: feat/issue-1573-regenerate-image-prompt


📝 Commits (2)

  • 5d4377c Add gallery image prompt regeneration
  • f41a36d Scope gallery regenerate invalidation

📊 Changes

3 files changed (+403 additions, -2 deletions)

View changed files

➕ src/features/catalog/gallery/hooks/use-gallery.test.tsx (+247 -0)
📝 src/features/catalog/gallery/hooks/use-gallery.ts (+83 -1)
📝 src/features/modes/shared/chat-ui/components/ChatGallery.tsx (+73 -1)

📄 Description

Linked issue

Closes #1573

Why this change

Adds a focused way to retry an existing generated gallery image from its saved prompt, so users do not need to spend a new chat message just to regenerate the same image prompt.

What changed

  • Added a shared chat gallery regeneration mutation that reuses the saved prompt, current chat image connection, and existing dimensions where available.
  • Added regenerate controls on prompted gallery images in the grid overlay and lightbox.
  • Added focused hook tests for prompt reuse, game image connection selection, fallback dimensions, gallery writes, cache invalidation, and promptless-image rejection.

Refactor impact

Primary owner:

shared mode UI / catalog gallery

Impact areas reviewed:

  • Chat gallery image grid and lightbox controls.
  • Gallery query invalidation for conversation, roleplay, and game gallery scopes.
  • Image generation API and storage API call boundaries.

Boundary notes:

The feature code stays in src/features and uses existing focused shared API wrappers (imageGenerationApi, storageApi) instead of raw Tauri invokes. Engine and Rust storage behavior are not changed.

Pressure points touched:

  • Shared chat gallery UI (ChatGallery)
  • Catalog gallery hooks (use-gallery)

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • pnpm check passes locally before PR push/handoff, including the unused-code check
  • pnpm typecheck passes locally
  • pnpm build passes locally
  • pnpm check:architecture passes locally
  • pnpm check:docs passes locally
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace passes locally
  • Rust clippy/tests were run for Rust behavior changes
  • Browser or Tauri app manual verification completed
  • Browser screenshot/recording evidence added when UI/browser state is the claim
  • Remote runtime smoke checked when relevant

Codex-run validation:

  • pnpm exec vitest run src/features/catalog/gallery/hooks/use-gallery.test.tsx passed.
  • pnpm typecheck passed.
  • pnpm check passed.

Manual verification notes

  • Provider-backed manual check still needed before ready-for-review: open a chat with an image generation connection, open a prompted gallery image, click "Regenerate from prompt", and confirm the new image appears in the gallery.
  • Browser visual pass still needed before ready-for-review because Codex did not run the full app with a configured image provider.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

No docs changes needed for this focused UI affordance.

UI evidence

Not added yet. The PR should stay draft until a provider-backed browser pass can capture the gallery regenerate control and successful regenerated image.

Summary by CodeRabbit

Release Notes

  • New Features
    • Gallery images can now be regenerated from their saved prompts via a dedicated button in the image overlay and lightbox view
    • Loading indicators and success/error feedback display during regeneration
    • Regenerated images are automatically added to your gallery collection

🔄 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/1743 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 5/31/2026 **Status:** ✅ Merged **Merged:** 5/31/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `feat/issue-1573-regenerate-image-prompt` --- ### 📝 Commits (2) - [`5d4377c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5d4377c13d1e283ab4ee850c1afccb11893ea6c5) Add gallery image prompt regeneration - [`f41a36d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f41a36d2321325c01dcd19054bdf00a7ea14db14) Scope gallery regenerate invalidation ### 📊 Changes **3 files changed** (+403 additions, -2 deletions) <details> <summary>View changed files</summary> ➕ `src/features/catalog/gallery/hooks/use-gallery.test.tsx` (+247 -0) 📝 `src/features/catalog/gallery/hooks/use-gallery.ts` (+83 -1) 📝 `src/features/modes/shared/chat-ui/components/ChatGallery.tsx` (+73 -1) </details> ### 📄 Description <!-- Target branch: `refactor`. Change the base to `refactor` before submitting unless a maintainer explicitly asked for another base. --> <!-- Keep all checkboxes unchecked until a human has actually verified them. --> ## Linked issue <!-- Every user-facing PR should reference a feature request or issue report when practical. --> Closes #1573 ## Why this change <!-- What user problem, bug, refactor goal, or maintenance need does this solve? --> Adds a focused way to retry an existing generated gallery image from its saved prompt, so users do not need to spend a new chat message just to regenerate the same image prompt. ## What changed <!-- List the key changes in this PR. --> - Added a shared chat gallery regeneration mutation that reuses the saved prompt, current chat image connection, and existing dimensions where available. - Added regenerate controls on prompted gallery images in the grid overlay and lightbox. - Added focused hook tests for prompt reuse, game image connection selection, fallback dimensions, gallery writes, cache invalidation, and promptless-image rejection. ## Refactor impact Primary owner: shared mode UI / catalog gallery <!-- Examples: app shell, catalog, chat mode, roleplay mode, game mode, runtime generation, world-state, shared API, engine generation, Rust storage, imports, remote runtime. --> Impact areas reviewed: - Chat gallery image grid and lightbox controls. - Gallery query invalidation for conversation, roleplay, and game gallery scopes. - Image generation API and storage API call boundaries. Boundary notes: <!-- Note engine/shared-api/feature/Rust/remote-runtime boundaries. Say "none" only if you checked. --> The feature code stays in `src/features` and uses existing focused shared API wrappers (`imageGenerationApi`, `storageApi`) instead of raw Tauri invokes. Engine and Rust storage behavior are not changed. Pressure points touched: <!-- Mention ModeSurface, GameSurface, shared mode UI, src-tauri/src/lib.rs command registration, or import modules if touched. --> - Shared chat gallery UI (`ChatGallery`) - Catalog gallery hooks (`use-gallery`) ## Validation <!-- Check only what you personally ran or manually verified. Treat unchecked items as explicit TODOs. --> - [ ] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [ ] `pnpm check` passes locally before PR push/handoff, including the unused-code check - [ ] `pnpm typecheck` passes locally - [ ] `pnpm build` passes locally - [ ] `pnpm check:architecture` passes locally - [ ] `pnpm check:docs` passes locally - [ ] `cargo check --manifest-path src-tauri/Cargo.toml --workspace` passes locally - [ ] Rust clippy/tests were run for Rust behavior changes - [ ] Browser or Tauri app manual verification completed - [ ] Browser screenshot/recording evidence added when UI/browser state is the claim - [ ] Remote runtime smoke checked when relevant Codex-run validation: - `pnpm exec vitest run src/features/catalog/gallery/hooks/use-gallery.test.tsx` passed. - `pnpm typecheck` passed. - `pnpm check` passed. ### Manual verification notes <!-- Describe exactly what you tested in a real browser/app/runtime, step by step. If an AI agent filled this out, verify it yourself before ticking boxes. --> - Provider-backed manual check still needed before ready-for-review: open a chat with an image generation connection, open a prompted gallery image, click "Regenerate from prompt", and confirm the new image appears in the gallery. - Browser visual pass still needed before ready-for-review because Codex did not run the full app with a configured image provider. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [ ] Confirmed this PR does not restore old staging/package-workspace/release claims No docs changes needed for this focused UI affordance. ## UI evidence <!-- Add before/after screenshots or recordings for visible UI changes. --> Not added yet. The PR should stay draft until a provider-backed browser pass can capture the gallery regenerate control and successful regenerated image. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **New Features** * Gallery images can now be regenerated from their saved prompts via a dedicated button in the image overlay and lightbox view * Loading indicators and success/error feedback display during regeneration * Regenerated images are automatically added to your gallery collection <!-- 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:14:38 +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#5254
No description provided.