make custom gloopies reusable across agents - #165
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Category: improvement
User Impact: Custom gloopies now appear first in the Gloopies collection and can be reused across agents.
Problem: Custom animated gloopies were stored as attachments to individual agents, so they disappeared from reach after avatar changes and could not be selected for another agent.
Solution: Treat generated gloopies as durable local avatar-library assets, merge them into the existing Gloopies collection, and keep their lifecycle and identity independent from any one agent.
File changes
src-tauri/src/commands/avatars.rs
Enumerates valid local gloopie manifests into avatar-library snapshots, preserves newest-first ordering, and emits a library-change event after successful writes.
src/features/agents/hooks/tests/useAvatarLibrary.test.tsx
Covers startup loading, live invalidation, post-subscription reconciliation, and separation of custom media from bundled media.
src/features/agents/hooks/tests/usePersonas.test.ts
Updates lifecycle expectations so changing or deleting an agent preserves its gloopie in the library.
src/features/agents/hooks/useAvatarLibrary.ts
Loads custom gloopie IDs and media into a separate namespace and subscribes to both catalog and user-library invalidations.
src/features/agents/hooks/usePersonas.ts
Removes agent-owned garbage collection because custom gloopies are durable library assets.
src/features/agents/lib/avatarLibraryView.test.ts
Protects explicit collection-cover behavior and verifies equal bare IDs remain distinct across custom and bundled namespaces.
src/features/agents/lib/avatarLibraryView.ts
Builds the shared picker/gallery model, prepending custom gloopies and selecting the newest custom gloopie as the Gloopies cover.
src/features/agents/ui/AgentBuilderRail.tsx
Accepts full avatar references from the picker so agent creation can persist either bundled or custom avatars.
src/features/agents/ui/AgentDetailPage.tsx
Treats both bundled and custom refs as library selections and persists the full selected reference during editing.
src/features/agents/ui/AgentImageImportDialog.tsx
Preserves successfully imported gloopies even when subsequent agent creation fails.
src/features/agents/ui/AvatarCollectionOverlay.tsx
Renders the merged collection model and uses full refs for layout, hover, readiness, and selection identity.
src/features/agents/ui/AvatarLibraryPicker.tsx
Shows custom gloopies first in the existing collection and returns complete persisted refs when selected.
src/features/agents/ui/tests/AgentBuilderRail.test.tsx
Updates avatar-library fixtures for the separated custom-media state.
src/features/agents/ui/tests/AgentImageImportDialog.test.tsx
Verifies a failed agent import does not delete the committed gloopie.
src/features/agents/ui/tests/AgentsView.entry.test.tsx
Updates shared avatar-library fixtures for the new state contract.
src/features/agents/ui/tests/AvatarCollectionOverlay.test.tsx
Verifies overlay selection emits complete persisted references.
src/features/agents/ui/tests/AvatarLibraryPicker.test.tsx
Covers no-custom behavior, custom-first ordering, custom cover presentation, and custom selection.
src/shared/api/avatars.ts
Adds the renderer subscription for user-avatar-library changes.
src/shared/avatars/catalog.ts
Defines user-library constants and helpers for identifying library-owned avatar refs.
src/shared/i18n/locales/en/agents.json
Adds the English accessible label for custom gloopies.
src/shared/i18n/locales/es/agents.json
Adds the Spanish accessible label for custom gloopies.
Validation
just checkjust tauri-check