[PR #2362] [MERGED] Add custom emoji and sticker tagging to galleries #5562

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

📋 Pull Request Information

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

Base: refactor ← Head: feat/convo-custom-emoji-model


📝 Commits (10+)

  • d33a2c7 Add persona and global image galleries
  • 8d1ca46 Validate global gallery folder refs and roll back failed lightbox moves
  • 38efb0f Guard lightbox move rollback against superseding moves
  • 7ea7825 Document intentional partial-success-as-failure in gallery uploads
  • c409dcc Address gallery review feedback
  • ba86773 Clear gallery rows before deleting their files on purge
  • 9dd00ba Name the files and reasons when gallery uploads partially fail
  • 696f0d9 Stop exporting RIGHT_PANEL_BUTTONS
  • 0467ed5 Add Gallery to the mobile tools nav
  • ad511de Resolve gallery upload folder before persisting bytes

📊 Changes

35 files changed (+1892 additions, -66 deletions)

View changed files

📝 scripts/check-discovery-metadata.mjs (+1 -0)
📝 src-tauri/src/commands/storage/admin.rs (+39 -1)
📝 src-tauri/src/commands/storage/commands/entities.rs (+176 -3)
📝 src-tauri/src/commands/storage/commands/media.rs (+18 -0)
📝 src-tauri/src/commands/storage/contracts.rs (+32 -1)
📝 src-tauri/src/commands/storage/shared.rs (+51 -0)
📝 src-tauri/src/http_dispatch.rs (+20 -0)
📝 src-tauri/src/lib.rs (+2 -0)
📝 src/app/shell/PanelNavButtons.tsx (+10 -2)
📝 src/app/shell/RightPanel.tsx (+6 -1)
📝 src/engine/capabilities/storage.ts (+3 -0)
📝 src/features/catalog/characters/components/CharacterGalleryTab.tsx (+24 -5)
📝 src/features/catalog/characters/hooks/use-characters.ts (+18 -20)
➕ src/features/catalog/gallery/components/GlobalGalleryPanel.tsx (+613 -0)
📝 src/features/catalog/gallery/hooks/use-gallery.ts (+4 -31)
➕ src/features/catalog/gallery/hooks/use-global-gallery.ts (+164 -0)
📝 src/features/catalog/gallery/index.ts (+1 -0)
📝 src/features/catalog/gallery/query-keys.ts (+6 -0)
➕ src/features/catalog/gallery/shell.ts (+1 -0)
📝 src/features/catalog/personas/components/editor/PersonaEditor.tsx (+5 -0)

...and 15 more files

📄 Description

Stacked on #2361. This branch builds on the gallery foundation in #2361, so the diff below includes that PR's commit until it merges (after which this rebases to just the tagging commit). For an isolated view, review commit b40b2c8 ("Add custom emoji and sticker tagging to galleries")

Linked issue

Closes #2360 (partially).

Second PR in the series for that feature request. It adds the custom-emoji/sticker tagging model to the galleries; the Conversation-mode selectors, sending, and AI reactions follow in later PRs, so this does not close the request.

Why this change

  • The emoji/sticker system needs a way to mark which gallery images are emojis vs stickers and what they're called, before any selector or prompt wiring can use them.
  • Keeping tagging in the galleries (where the images already live) means access scope falls out for free — an image's reach is just which gallery it sits in.

What changed

  • A per-card tag control (shared CustomEmojiTagButton) on every image in the character, persona, and global galleries. It opens a small menu to make the image an emoji or a sticker, and once tagged offers rename / switch-kind / remove.
  • One kind per image (emoji or sticker). Tagged images show a corner badge (kind icon + name).
  • Size gate: the chosen kind is validated against the image's real pixel dimensions, read client-side — emoji ≤256×256, sticker ≤512×512. An oversized choice flashes the card red with a reason (and suggests "sticker" when an emoji is only over the emoji limit).
  • Names are slugified to a safe token; in prompts these will read as :name: (emoji) and sticker:name: (sticker) once PR C/D wire them up.
  • A size-limit help tooltip on each gallery header.
  • New shared custom-emoji.ts (kind type, limits, slugify, dimension validation/reader). The two new record fields (customKind, customName) persist via the existing update mutation — the gallery collections store arbitrary JSON, so no Rust/schema change.

Refactor impact

Primary owner: catalog (galleries) and shared UI.

Impact areas reviewed:

  • catalog/characters, catalog/personas, catalog/gallery — gallery tab/panel UI + a tag mutation per gallery hook
  • shared — new src/shared/lib/custom-emoji.ts and src/shared/components/ui/CustomEmojiTagButton.tsx (reuses the existing ContextMenu and prompt dialog)

Boundary notes:

  • engine / Rust / remote runtime: none touched.
  • shared API: none added — tagging reuses storageApi.update on the existing gallery collections.
  • feature → shared only: the three gallery features import the new shared lib + component.

Pressure points touched:

  • None. No ModeSurface / GameSurface / shared mode UI / lib.rs / import-module changes. This PR is confined to the catalog galleries and does not touch the Conversation, Roleplay, or Game runtime at all.

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • Full pnpm check passes before PR push/handoff
  • Human/manual validation completed by contributor or reviewer

Manual verification notes

Frontend-only change; ran the relevant checks individually (the local check:line-endings step trips on pre-existing CRLF in unrelated files and bails the chained pnpm check; committed versions are LF, so CI is unaffected):

  • pnpm check:frontend (tsc -b) — passes
  • pnpm check:architecture — passes (no dependency violations)
  • pnpm check:unused (knip) — clean
  • No Rust changed, so cargo was not re-run.

Manual Tauri verification across all three galleries (global panel, a persona's Gallery tab, a character's Gallery tab): tagged images as emoji and sticker; confirmed the size gate flashes red + warns on oversized choices; renamed, switched kind (re-validates against the new kind), and removed tags; confirmed names slugify and tags persist across reload; confirmed existing gallery behavior (upload, delete, lightbox, download, global drag-to-folder, folder create/rename/delete, sort) still works.

Feature Discoverability

Check exactly one:

  • Updated src/features/shell/discovery/ because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.
  • N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find.

Reason:

  • Second box: this adds a sub-capability within the already-registered gallery surfaces and isn't usable anywhere yet (tagged emojis/stickers don't surface in any selector until a later PR). The user-facing capability — the Conversation-mode selectors — will warrant a discovery entry in that PR.

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

UI evidence

{0CB41CEE-2C07-4254-9C18-9B2569D06AE8} {3549996E-E098-45A9-9433-EC202D14494E} {8F473137-6EB7-4A41-8CF4-94203BADB61C} {0C86ACD8-FE56-4DDE-A6AB-50196A0F98C6} {92E86F1F-E848-44B5-8E00-5E2920EF67A6}

🔄 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/2362 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 6/5/2026 **Status:** ✅ Merged **Merged:** 6/7/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `refactor` ← **Head:** `feat/convo-custom-emoji-model` --- ### 📝 Commits (10+) - [`d33a2c7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d33a2c7a8a6e0cf7f08f4097b427d2905eebad75) Add persona and global image galleries - [`8d1ca46`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8d1ca46b8e347d36749bf1d875be1944457d03ac) Validate global gallery folder refs and roll back failed lightbox moves - [`38efb0f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/38efb0f4848c58872279aeed26bb25eaefd3e720) Guard lightbox move rollback against superseding moves - [`7ea7825`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7ea7825f3b84a7098114b59aa561d75ebe1e0e27) Document intentional partial-success-as-failure in gallery uploads - [`c409dcc`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c409dcc7ec569cba18a5d86f06c917b4f47a9619) Address gallery review feedback - [`ba86773`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ba8677309e7576f4ad8390087078e42541fdf85c) Clear gallery rows before deleting their files on purge - [`9dd00ba`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9dd00bad1bda6be13d1844d65b309ed2e2a8e425) Name the files and reasons when gallery uploads partially fail - [`696f0d9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/696f0d9dfead98e86c0362125e7b6a0558863dec) Stop exporting RIGHT_PANEL_BUTTONS - [`0467ed5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0467ed53cffada07c5ce284a7f12689bf9fff5ff) Add Gallery to the mobile tools nav - [`ad511de`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ad511dea447b3bf0ef9e092a4b17aae42305a89e) Resolve gallery upload folder before persisting bytes ### 📊 Changes **35 files changed** (+1892 additions, -66 deletions) <details> <summary>View changed files</summary> 📝 `scripts/check-discovery-metadata.mjs` (+1 -0) 📝 `src-tauri/src/commands/storage/admin.rs` (+39 -1) 📝 `src-tauri/src/commands/storage/commands/entities.rs` (+176 -3) 📝 `src-tauri/src/commands/storage/commands/media.rs` (+18 -0) 📝 `src-tauri/src/commands/storage/contracts.rs` (+32 -1) 📝 `src-tauri/src/commands/storage/shared.rs` (+51 -0) 📝 `src-tauri/src/http_dispatch.rs` (+20 -0) 📝 `src-tauri/src/lib.rs` (+2 -0) 📝 `src/app/shell/PanelNavButtons.tsx` (+10 -2) 📝 `src/app/shell/RightPanel.tsx` (+6 -1) 📝 `src/engine/capabilities/storage.ts` (+3 -0) 📝 `src/features/catalog/characters/components/CharacterGalleryTab.tsx` (+24 -5) 📝 `src/features/catalog/characters/hooks/use-characters.ts` (+18 -20) ➕ `src/features/catalog/gallery/components/GlobalGalleryPanel.tsx` (+613 -0) 📝 `src/features/catalog/gallery/hooks/use-gallery.ts` (+4 -31) ➕ `src/features/catalog/gallery/hooks/use-global-gallery.ts` (+164 -0) 📝 `src/features/catalog/gallery/index.ts` (+1 -0) 📝 `src/features/catalog/gallery/query-keys.ts` (+6 -0) ➕ `src/features/catalog/gallery/shell.ts` (+1 -0) 📝 `src/features/catalog/personas/components/editor/PersonaEditor.tsx` (+5 -0) _...and 15 more files_ </details> ### 📄 Description > **Stacked on #2361.** This branch builds on the gallery foundation in #2361, so the diff below includes that PR's commit until it merges (after which this rebases to just the tagging commit). For an isolated view, review commit `b40b2c8` ("Add custom emoji and sticker tagging to galleries") ## Linked issue Closes #2360 (partially). Second PR in the series for that feature request. It adds the custom-emoji/sticker *tagging model* to the galleries; the Conversation-mode selectors, sending, and AI reactions follow in later PRs, so this does not close the request. ## Why this change - The emoji/sticker system needs a way to mark which gallery images are emojis vs stickers and what they're called, before any selector or prompt wiring can use them. - Keeping tagging in the galleries (where the images already live) means access scope falls out for free — an image's reach is just which gallery it sits in. ## What changed - A per-card **tag control** (shared `CustomEmojiTagButton`) on every image in the character, persona, and global galleries. It opens a small menu to make the image an emoji or a sticker, and once tagged offers rename / switch-kind / remove. - **One kind per image** (emoji *or* sticker). Tagged images show a corner badge (kind icon + name). - **Size gate**: the chosen kind is validated against the image's real pixel dimensions, read client-side — emoji ≤256×256, sticker ≤512×512. An oversized choice flashes the card red with a reason (and suggests "sticker" when an emoji is only over the emoji limit). - **Names** are slugified to a safe token; in prompts these will read as `:name:` (emoji) and `sticker:name:` (sticker) once PR C/D wire them up. - A size-limit help tooltip on each gallery header. - New shared `custom-emoji.ts` (kind type, limits, slugify, dimension validation/reader). The two new record fields (`customKind`, `customName`) persist via the existing update mutation — the gallery collections store arbitrary JSON, so no Rust/schema change. ## Refactor impact Primary owner: catalog (galleries) and shared UI. Impact areas reviewed: - catalog/characters, catalog/personas, catalog/gallery — gallery tab/panel UI + a tag mutation per gallery hook - shared — new `src/shared/lib/custom-emoji.ts` and `src/shared/components/ui/CustomEmojiTagButton.tsx` (reuses the existing `ContextMenu` and prompt dialog) Boundary notes: - engine / Rust / remote runtime: none touched. - shared API: none added — tagging reuses `storageApi.update` on the existing gallery collections. - feature → shared only: the three gallery features import the new shared lib + component. Pressure points touched: - None. No ModeSurface / GameSurface / shared mode UI / `lib.rs` / import-module changes. This PR is confined to the catalog galleries and does not touch the Conversation, Roleplay, or Game runtime at all. ## Validation - [x] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [x] Full `pnpm check` passes before PR push/handoff - [x] Human/manual validation completed by contributor or reviewer ### Manual verification notes Frontend-only change; ran the relevant checks individually (the local `check:line-endings` step trips on pre-existing CRLF in unrelated files and bails the chained `pnpm check`; committed versions are LF, so CI is unaffected): - `pnpm check:frontend` (tsc -b) — passes - `pnpm check:architecture` — passes (no dependency violations) - `pnpm check:unused` (knip) — clean - No Rust changed, so `cargo` was not re-run. Manual Tauri verification across all three galleries (global panel, a persona's Gallery tab, a character's Gallery tab): tagged images as emoji and sticker; confirmed the size gate flashes red + warns on oversized choices; renamed, switched kind (re-validates against the new kind), and removed tags; confirmed names slugify and tags persist across reload; confirmed existing gallery behavior (upload, delete, lightbox, download, global drag-to-folder, folder create/rename/delete, sort) still works. ## Feature Discoverability Check exactly one: - [x] Updated `src/features/shell/discovery/` because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool. - [ ] N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find. Reason: - Second box: this adds a sub-capability within the already-registered gallery surfaces and isn't usable anywhere yet (tagged emojis/stickers don't surface in any selector until a later PR). The user-facing capability — the Conversation-mode selectors — will warrant a discovery entry in that PR. ## Docs and release impact - [x] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [x] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence <img width="1049" height="668" alt="{0CB41CEE-2C07-4254-9C18-9B2569D06AE8}" src="https://github.com/user-attachments/assets/4f2cb294-d544-4a4f-bc4a-17c56d13dd34" /> <img width="266" height="684" alt="{3549996E-E098-45A9-9433-EC202D14494E}" src="https://github.com/user-attachments/assets/3b68b13a-6e59-4cc5-a585-1dcf7a330085" /> <img width="345" height="345" alt="{8F473137-6EB7-4A41-8CF4-94203BADB61C}" src="https://github.com/user-attachments/assets/4144cbf7-25d9-4f11-b26d-81929b113b21" /> <img width="383" height="353" alt="{0C86ACD8-FE56-4DDE-A6AB-50196A0F98C6}" src="https://github.com/user-attachments/assets/054e3ab3-14eb-46c8-b38f-58f1726d98fe" /> <img width="289" height="77" alt="{92E86F1F-E848-44B5-8E00-5E2920EF67A6}" src="https://github.com/user-attachments/assets/12189a38-d306-495c-ab72-ae872e5bb625" /> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:17:24 +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#5562
No description provided.