Skip to content

feat: 工作区列表支持拖拽调整高度#239

Merged
ErlichLiu merged 1 commit intoErlichLiu:mainfrom
SheldonLiu0412:feat/workspace-height-resize
Apr 12, 2026
Merged

feat: 工作区列表支持拖拽调整高度#239
ErlichLiu merged 1 commit intoErlichLiu:mainfrom
SheldonLiu0412:feat/workspace-height-resize

Conversation

@SheldonLiu0412
Copy link
Copy Markdown
Contributor

问题根因

工作区列表固定 max-h-[120px],工作区较多时只能看到约 4 个,需要滚动才能浏览全部,用户体验不佳。(#224)

具体修改

  • sidebar-atoms.ts — 新增 workspaceListHeightAtom(atomWithStorage,默认 120px),持久化工作区列表高度
  • WorkspaceSelector.tsx — 将硬编码 max-h-[120px] 替换为动态 maxHeight,底部添加拖拽 resize handle(范围 80-400px),使用 getBoundingClientRect 取实际渲染高度保证拖拽跟手,组件卸载时自动清理事件监听
  • LeftSidebar.tsx — 侧边栏顶部留空从 50px 缩减至 30px,释放更多垂直空间

审查情况

  • 自审查通过:事件监听正确清理、useCallback deps 优化、无副作用冲突
  • 用户测试 OK

工作区多时列表区域太小,新增底部 resize handle 允许用户拖拽调整高度(80-400px),
高度持久化到 localStorage;同时缩减侧边栏顶部留空。
@ErlichLiu ErlichLiu merged commit e94807a into ErlichLiu:main Apr 12, 2026
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.

2 participants