[GH-ISSUE #1866] [Issue]: Avatar images lag when switching chats #903

Closed
opened 2026-10-21 05:23:12 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Promansis on GitHub (Jun 2, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1866

Originally assigned to: @Promansis on GitHub.

Summary

Avatar images can visibly lag or blank for roughly half a second when switching chats. The reported suspicion is avatar loading: prior work moved away from full base64 PNG payloads, but the current managed-avatar resolution path feels clunky during chat switches.

Expected behavior

Switching chats should show known character/persona avatars immediately when those images were already loaded or can be resolved synchronously.

Actual behavior

When switching chats, avatar images appear delayed before settling in, creating a noticeable visual stutter.

Steps to reproduce

  1. Use the refactor branch with chats that have character avatars.
  2. Switch between chats from the chat UI/sidebar.
  3. Watch message/avatar areas during the first render after the switch.

Impact area

  • App shell, navigation, startup, or providers
  • Catalog resources
  • Chat mode
  • Roleplay mode
  • Game mode
  • Shared mode UI
  • Runtime systems: generation, world-state, visuals, tracker, or haptics
  • Professor Mari or shell tools
  • React-free engine behavior, contracts, agents, or capability ports
  • Shared API wrapper or remote runtime routing
  • Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime
  • Docs, contributor workflow, or templates

Environment

  • Branch or commit: refactor at 03fec2ff5192fbdbc652478e7411f749c66f9c50
  • Run mode: unknown from report
  • OS + version: unknown from report
  • Node + pnpm versions: not relevant to report yet
  • Rust version, if relevant: not relevant to report yet
  • Remote Runtime URL configured? unknown from report
  • Provider, model, or integration, if relevant: not relevant

Logs, screenshots, or video

No logs, screenshots, or recordings yet.

Initial code inspection found the visible avatar path goes through src/features/modes/shared/chat-ui/components/ResolvedAvatarImage.tsx. For managed avatars, that component renders no image when the synchronous URL conversion still looks like a raw filesystem path, then waits for resolveAvatarFileUrl(...). Chat message avatar call sites also pass loading="lazy" for avatars in src/features/modes/shared/chat-ui/components/ChatMessage.tsx, which may worsen perceived delay on remount after chat switches.

Regression notes

Reporter notes previous issues with loading full base64 PNG avatar images and says the current replacement behavior feels clunky.

Additional context

Likely fix area is shared mode UI avatar rendering and, if needed, the focused local file API wrapper that resolves managed avatar URLs. Avoid reintroducing full base64 avatar payloads.

Template check

Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Promansis on GitHub (Jun 2, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1866 Originally assigned to: @Promansis on GitHub. ## Summary Avatar images can visibly lag or blank for roughly half a second when switching chats. The reported suspicion is avatar loading: prior work moved away from full base64 PNG payloads, but the current managed-avatar resolution path feels clunky during chat switches. ## Expected behavior Switching chats should show known character/persona avatars immediately when those images were already loaded or can be resolved synchronously. ## Actual behavior When switching chats, avatar images appear delayed before settling in, creating a noticeable visual stutter. ## Steps to reproduce 1. Use the refactor branch with chats that have character avatars. 2. Switch between chats from the chat UI/sidebar. 3. Watch message/avatar areas during the first render after the switch. ## Impact area <!-- Check the areas you think are relevant. Leave uncertain items unchecked. --> - [ ] App shell, navigation, startup, or providers - [ ] Catalog resources - [x] Chat mode - [ ] Roleplay mode - [ ] Game mode - [x] Shared mode UI - [ ] Runtime systems: generation, world-state, visuals, tracker, or haptics - [ ] Professor Mari or shell tools - [ ] React-free engine behavior, contracts, agents, or capability ports - [x] Shared API wrapper or remote runtime routing - [ ] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [ ] Docs, contributor workflow, or templates ## Environment - Branch or commit: `refactor` at `03fec2ff5192fbdbc652478e7411f749c66f9c50` - Run mode: unknown from report - OS + version: unknown from report - Node + pnpm versions: not relevant to report yet - Rust version, if relevant: not relevant to report yet - Remote Runtime URL configured? unknown from report - Provider, model, or integration, if relevant: not relevant ## Logs, screenshots, or video No logs, screenshots, or recordings yet. Initial code inspection found the visible avatar path goes through `src/features/modes/shared/chat-ui/components/ResolvedAvatarImage.tsx`. For managed avatars, that component renders no image when the synchronous URL conversion still looks like a raw filesystem path, then waits for `resolveAvatarFileUrl(...)`. Chat message avatar call sites also pass `loading="lazy"` for avatars in `src/features/modes/shared/chat-ui/components/ChatMessage.tsx`, which may worsen perceived delay on remount after chat switches. ## Regression notes Reporter notes previous issues with loading full base64 PNG avatar images and says the current replacement behavior feels clunky. ## Additional context Likely fix area is shared mode UI avatar rendering and, if needed, the focused local file API wrapper that resolves managed avatar URLs. Avoid reintroducing full base64 avatar payloads. ## Template check Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:23:12 +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#903
No description provided.