[PR #1867] [MERGED] Fix avatar reload lag on chat switch #5326

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1867
Author: @Promansis
Created: 6/2/2026
Status: ✅ Merged
Merged: 6/2/2026
Merged by: @Promansis

Base: refactor ← Head: fix/avatar-switch-lag


📝 Commits (2)

  • 8b961be Fix avatar reload lag on chat switch
  • 0c2f8fd Bound resolved avatar cache

📊 Changes

1 file changed (+30 additions, -4 deletions)

View changed files

📝 src/features/modes/shared/chat-ui/components/ResolvedAvatarImage.tsx (+30 -4)

📄 Description

Linked issue

Closes #1866

Why this change

  • Managed avatar images can blank or lag during chat switches because the shared avatar renderer waits for the async managed-file resolver again after remount.

What changed

  • Cache resolved managed avatar image URLs by source/filename/file path key inside the shared avatar image component.
  • Seed remounted avatar images from the cached resolved URL when available.
  • Evict cached avatar URLs when resolution returns no usable URL or fails, so stale/broken images do not persist.

Refactor impact

Primary owner:

Shared mode UI

Impact areas reviewed:

  • Chat message avatar rendering
  • Shared roleplay/chat transcript avatar surfaces that use ResolvedAvatarImage
  • Shared local-file API boundary, which is called but not changed

Boundary notes:

  • No engine changes.
  • No storage or Rust capability changes.
  • No new raw Tauri or remote-runtime calls.
  • Change stays in feature-owned shared mode UI and keeps the existing focused shared API wrapper contract.

Pressure points touched:

  • Shared mode UI: src/features/modes/shared/chat-ui/components/ResolvedAvatarImage.tsx

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

  • pnpm exec vitest run src/features/modes/shared/chat-ui/components/ResolvedAvatarImage.test.tsx passed.
  • pnpm typecheck passed.
  • pnpm check passed after rerun with network access for Rust dependency resolution.
  • Manual Tauri/browser chat-switch verification not run.

Feature Discoverability

Check exactly one:

  • Updated src/features/shell/discovery/ metadata
  • N/A Reason: Bugfix only; no new discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.

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

Not captured; no browser/Tauri visual proof run.


🔄 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/1867 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 6/2/2026 **Status:** ✅ Merged **Merged:** 6/2/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `refactor` ← **Head:** `fix/avatar-switch-lag` --- ### 📝 Commits (2) - [`8b961be`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8b961beaea329ec27300448df9fecd065e491a6d) Fix avatar reload lag on chat switch - [`0c2f8fd`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0c2f8fd2372736fdc1c04947ed390ff2e8b60d6f) Bound resolved avatar cache ### 📊 Changes **1 file changed** (+30 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `src/features/modes/shared/chat-ui/components/ResolvedAvatarImage.tsx` (+30 -4) </details> ### 📄 Description ## Linked issue Closes #1866 ## Why this change - Managed avatar images can blank or lag during chat switches because the shared avatar renderer waits for the async managed-file resolver again after remount. ## What changed - Cache resolved managed avatar image URLs by source/filename/file path key inside the shared avatar image component. - Seed remounted avatar images from the cached resolved URL when available. - Evict cached avatar URLs when resolution returns no usable URL or fails, so stale/broken images do not persist. ## Refactor impact Primary owner: Shared mode UI Impact areas reviewed: - Chat message avatar rendering - Shared roleplay/chat transcript avatar surfaces that use `ResolvedAvatarImage` - Shared local-file API boundary, which is called but not changed Boundary notes: - No engine changes. - No storage or Rust capability changes. - No new raw Tauri or remote-runtime calls. - Change stays in feature-owned shared mode UI and keeps the existing focused shared API wrapper contract. Pressure points touched: - Shared mode UI: `src/features/modes/shared/chat-ui/components/ResolvedAvatarImage.tsx` ## Validation <!-- Check only what you personally ran or manually verified. Treat unchecked items as explicit TODOs. --> <!-- Do not submit *.test.ts or *.test.tsx files as PR proof; cite existing checks, command output, app/browser/Tauri verification, or manual notes instead. --> - [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 - `pnpm exec vitest run src/features/modes/shared/chat-ui/components/ResolvedAvatarImage.test.tsx` passed. - `pnpm typecheck` passed. - `pnpm check` passed after rerun with network access for Rust dependency resolution. - Manual Tauri/browser chat-switch verification not run. ## Feature Discoverability Check exactly one: - [ ] Updated src/features/shell/discovery/ metadata - [x] N/A Reason: Bugfix only; no new discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool. ## Docs and release impact - [x] 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 Not captured; no browser/Tauri visual proof run. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:15:16 +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#5326
No description provided.