Repository navigation
feat(app): switch project avatars between letters and generated from Knobs - #57930
Conversation
There was a problem hiding this comment.
The change looks sound. I rendered ProjectAvatar in happy-dom: it shows letters by default, and flipping projectAvatar.style to Generated and back swaps between the letter and the canvas live. The setting is saved, and the saved key is cleared when it goes back to the default. Project-avatar, motion-tuning and avatar-hover tests pass, and ui and app typecheck cleanly. The knob follows the same choice + signal + subscribe pattern as sidebar.hover, and the e2e edits restore exactly what #57871 changed. I didn't run the e2e specs or try the crossfade, since happy-dom has no view transitions.
Public API: unchanged. The new knob is only stored on the device, under the existing opencode.motion.v2 key.
I couldn't capture the web app, so a before/after screenshot or a short clip of the sidebar switching between Letters and Generated would be useful.
Projects without an icon show the letter monograms again by default. James's generated avatars from #57871 stay fully intact and are one switch away under Knobs → Experiments → Project avatars (
Letters/Generated).ProjectAvatar: sidebar, Home, the new-session picker, the session header, and tab avatars.Letters mode is the exact pre-#57871 path (
first(fallback)on the gradient surface). With Letters as the default, the two e2e assertions #57871 adjusted for the generated canvas (tabs.spec.ts,mobile-session.spec.ts) go back to their earlier form;project-avatar-hover.test.tsopts into Generated through the Knobs API and keeps passing.Verification:
bun typecheck(ui, app),project-avatar+motion-tuningunit tests,project-avatar-hoverbrowser test,bun run lint:changed origin/beta. No sidebar still is attached: the one browser proof run didn't get the fixture sidebar to list several projects, and I didn't retry it.