Skip to content

Fix project icon syncing and fallbacks#196

Open
hoomanaskari wants to merge 1 commit into21st-dev:mainfrom
hoomanaskari:codex/project-icon-sync
Open

Fix project icon syncing and fallbacks#196
hoomanaskari wants to merge 1 commit into21st-dev:mainfrom
hoomanaskari:codex/project-icon-sync

Conversation

@hoomanaskari
Copy link
Copy Markdown

Summary

This PR fixes project icon behavior so custom icons set in project settings propagate across the app and fallback avatars behave consistently.

Root Cause

  • Some parts of the renderer were holding stale selected-project snapshots, so icon changes made in settings did not propagate back to the active workspace UI.
  • Custom icons were being loaded through raw file:// URLs, which made icons stored under the app userData path render unreliably.
  • Project rendering still fell back to GitHub avatars, which made local project identity inconsistent and ignored explicit custom project icon choices.

What Changed

  • Added a selected-project normalization helper so the main UI rehydrates from the latest project records.
  • Updated project settings mutations to sync the project cache and selected-project state immediately after rename, upload, removal, and delete actions.
  • Switched custom project icon loading to the existing binary file reader and versioned icon cache keys with updatedAt so new uploads replace old cached icons cleanly.
  • Replaced GitHub avatar fallback with a repo-initial fallback avatar in the shared project icon component.
  • Reused the shared project icon rendering path across the settings preview, project selector, sidebar, archive popover, quick switch surfaces, and drafts.
  • Increased sidebar icon size and added subtle bordered styling for fallback avatars.

Impact

  • Custom project icons now stay in sync after being changed in settings.
  • Projects without a custom icon now use a predictable repo-initial fallback instead of a GitHub avatar.
  • Sidebar and project-picker surfaces render project identity more consistently.

Validation

  • Ran bun run dev successfully.
  • Manually verified the icon flow locally:
    • upload a custom icon from project settings
    • confirm it appears in the settings preview, project selector, sidebar, and compose area
    • remove the custom icon and confirm the UI falls back to the repo-initial avatar instead of a GitHub avatar

Ensure project icon updates propagate across the app when a custom icon is uploaded or removed from project settings.

This change refreshes selected project state from the latest project records, replaces GitHub avatar fallback with a repo-initial fallback avatar, and loads custom icons through the binary file reader so icons stored under the app userData path render reliably.

It also updates sidebar icon sizing and fallback avatar styling for a clearer, more consistent workspace list.
@hoomanaskari hoomanaskari changed the title [codex] Fix project icon syncing and fallbacks Fix project icon syncing and fallfalls Apr 8, 2026
@hoomanaskari hoomanaskari changed the title Fix project icon syncing and fallfalls Fix project icon syncing and fallbacks Apr 8, 2026
@hoomanaskari hoomanaskari marked this pull request as ready for review April 8, 2026 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant