建议桌面端(MonkeyCode work)左侧项目板块支持项目置顶
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 4.7k
- Forks
- 719
- Avg merge
- 4h 30m
- Merged PRs (30d)
- 83
Description
背景
MonkeyCode work 桌面端左侧「项目」板块中,项目以组为单位展示(组头 + 组内任务列表)。当前与项目排序/管理相关的交互有:
- 拖拽排序:组头可拖动,全序快照存于
mc.projectOrder(含「临时会话」哨兵键); - 右键菜单(
desktop/ui-next/src/features/split/SplitView.tsx项目组头onContextMenu):只有「在此新建任务」「归档项目」两项; - 归档:独立持久化(prefs),归档项目收进单独的「已归档项目」小节。
痛点
- 项目数量一多,把常用项目拖到顶部需要跨越整条列表逐位拖动,且任何一次重新整理都会被后续插入的新项目挤乱相对位置;
- 没有"永远置顶"的锚点:拖拽排序是全序手工维护,用户真正想要的往往只是"这几个常用项目固定在最上面,其余随意";
- 对比同板块已有的「归档」(一层结构化收纳),缺一个更轻量的"高频项目"标记。
建议
给项目组头右键菜单增加「置顶项目 / 取消置顶」:
- 入口:复用现有右键菜单(与「在此新建任务」「归档项目」并列),置顶后在组头显示图钉图标(tabler
IconPinned之类)作为状态提示; - 持久化:与归档同一模式,prefs 里加一个置顶集合键(如
mc.pinnedProjects),按项目 key(workdir)存; - 排序语义:置顶项目组浮到非置顶项目组之上,置顶组之间仍按既有
mc.projectOrder相对排序;未置顶项目排序完全不变。建议置顶组排在「临时会话」之前(置顶的语义就是"最容易够到"),这点可以讨论; - 与拖拽的兼容:置顶组与非置顶组之间不允许拖拽换位(拖了等于提示"先取消置顶"),置顶组内部仍可拖拽微调;实现上也可以更简单——置顶组不参与拖拽,只按
mc.projectOrder排。
代码位置
- 项目组右键菜单:
desktop/ui-next/src/features/split/SplitView.tsx(组头onContextMenu,现有两项菜单) - 排序快照:同文件「组头拖拽排序(mc.projectOrder 全序快照)」段落
- 归档持久化参照:
readArchivedProjects/writeArchivedProjects(prefs 模式) - 文案:
desktop/ui-next/src/lib/i18n/zh.ts/en.ts的sidebar.project.*
收益
高频项目一步直达,不用维护整条手工顺序;实现量小(一个菜单项 + 一个 prefs 集合 + 分组排序一处调整),与现有归档/拖拽机制完全同构。
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in desktop/ui-next/src/features/split/SplitView.tsx at the project-group context menu, the mc.projectOrder drag-sort section, and the readArchivedProjects/writeArchivedProjects persistence helpers. Check the sidebar.project.* entries in desktop/ui-next/src/lib/i18n/zh.ts and en.ts. Done means the pin state persists, pinned groups sort correctly, the menu and icon reflect the state, and drag behavior remains consistent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- desktop
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100