feat(workspaces): generated glyph icons for workspaces without a logo - #8488
TheodoreSpeaks wants to merge 3 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
| <filter | ||
| id={filterId} | ||
| x='-30%' | ||
| y='-30%' | ||
| width='160%' | ||
| height='160%' | ||
| colorInterpolationFilters='sRGB' | ||
| > | ||
| <feGaussianBlur stdDeviation='5' /> | ||
| <feColorMatrix values={GOO_ALPHA_MATRIX} /> | ||
| </filter> | ||
| <g filter={`url(#${filterId})`} fill='currentColor' stroke='currentColor'> | ||
| {generateGlyph(seed).map(glyphShape)} |
There was a problem hiding this comment.
The workspace switcher renders every filtered workspace. For each logo-less row, this component mounts a Gaussian-blur SVG filter and recalculates glyph shapes on every render, even when the workspace ID has not changed. Typing in the switcher repeats that work across the list, which can make larger workspace lists less responsive. Memoizing the glyph or limiting rendered rows would reduce the cost.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| describe('generateGlyph', () => { | ||
| it('is deterministic per seed', () => { | ||
| expect(generateGlyph('ws_abc')).toEqual(generateGlyph('ws_abc')) | ||
| }) | ||
|
|
||
| it('gives nearly every seed a distinct glyph', () => { | ||
| const distinct = new Set(SEEDS.map((s) => JSON.stringify(generateGlyph(s)))) |
There was a problem hiding this comment.
Rendered fallback remains untested
These tests call generateGlyph directly but never render IdentityTile. They therefore cannot catch a regression in uploaded-logo precedence or in how the SVG filter and shapes appear—the behavior users see. Component-level tests for a workspace with and without a logo would cover that gap.
Summary
IdentityTiletakesglyphSeed(workspaces) orinitial(organizations, unchanged); uploaded logos still wingetWorkspaceInitialType of Change
Testing
glyph.test.ts: determinism, distinctness across seeds, every family stays centered inside the box, empty seed fails fastbun run lint,check:audits, type-check passingChecklist
🤖 Generated with Claude Code
https://claude.ai/code/session_01C6q5mmZQrc7CTwpDV8ovR5