Fix folder icon sizing and dialog auto-close in Svelte session rail
Session from pi-web on Hugging Face by woxQAQ · MIT · condensed by Coders Talk
Click a segment to jump to that moment
13msession
1interventions
GOAL
Make workspace folder icons render at a consistent size in the Svelte sidebar, and fix a bug where interacting with the 'browse old sessions' modal (search box, load more) caused it to close unexpectedly.
- +0Prompt · +0folder icon sizes in packages/svelte/ are inconsistent
- +0mAgent did · +0mInvestigated SessionRail.svelte icon usage, compared with Vue version, and adjusted FolderOpen icon scaling with a workspace-icon-open class and CSS scale(1.12)
- +4mIntervention · +4mDeveloper clarified the bug wasn't just FolderOpen but also the closed Folder state being inconsistentWhy: 我说清楚了,不是 FolderOpen 的问题,fold(关闭)状态的图标也是不一致的,之前的修复方向不对
- +4mAgent did · +4mDug into lucide-svelte icon source/viewBox, compared web vs svelte implementations, then introduced a shared WORKSPACE_FOLDER_ICON_SIZE constant applied to Folder, FolderOpen, and FolderPlus across SessionRail.svelte and AppSidebar.svelte
- +9mAgent did · +9mVerified with svelte-check and build; reported unified 15px sizing and passed styles directly to Lucide components to avoid scoped CSS not applying to SVGs
- +12mPrompt · +12mIn browse old session view, clicking the search box or 'load more' causes the view to close unexpectedly
- +12mAgent did · +12mTraced the older-sessions modal overlay's onclick handler, found event bubbling from inner elements (search box, load more) was triggering closeOlderSessions; added handleOlderSessionsOverlayClick to only close on actual overlay background clicks, verified with check and build
- +13mOutcome · +13mFixed both issues: unified folder icon sizes across SessionRail.svelte and AppSidebar.svelte, and stopped the older-sessions modal from closing on inner clicks; svelte-check passed with 0 errors and build succeeded each time
VERDICT
Next time I'd describe the icon inconsistency more precisely upfront — mentioning that both the open and closed folder states looked different sizes would have saved a round trip. The correction that actually mattered was telling the agent it wasn't just the FolderOpen icon but the closed Folder state too, which sent it to introduce a shared size constant instead of a one-off scale hack.