Uh oh!
There was an error while loading. Please reload this page.
feat(settings): add a Projects page with a default project - #2446
Merged
Conversation
Project management was spread across whichever surface happened to need it — adding lived in the composer, renaming in the sidebar row menu — and "which project does a new conversation open in" was not a setting at all. It was whichever project you used last, decided implicitly by `project-root-controller` and invisible from the UI. Settings · 偏好 · 项目 makes the catalog a first-class surface and gives the default a home. Three layers, in order: an explicit pick in the composer wins for that conversation; otherwise the configured default; otherwise the previous last-used behaviour, unchanged for anyone who sets nothing. The default is stored as a project id rather than a path, because the catalog owns identity — a relinked project keeps its id, so a stored path would silently point somewhere else after a move. A default that no longer resolves (archived, or the folder is gone) falls back to last-used rather than failing session creation, and the page says so instead of degrading silently. Unavailable projects cannot be made the default at all: unlike a model connection, where a failure shows up per use and the user can fix it after choosing, a default pointing at a missing folder breaks every new conversation and the repair is outside the app. The disabled control states that reason itself. Rename and reveal-in-folder are not in the row menu yet — one needs an inline-edit primitive this tree does not have, the other an IPC that can open a path other than the current project's. Both still work from the sidebar row menu, so no capability is lost.
jackwener
commented
Aug 7, 2026
MemberAuthor
Review by maka-审美专家 — 通过:项目设置页全案落地——预览阶段过审的结构(页头/描述行三层规则/行式方言/不可用态)+ 解析逻辑插在 resolveDesktopSessionSelection 的天然三层接缝(composer 单次覆盖免额外判断);「默认胜 last-used」测试带存在理由注释;降级可见且不把账算到新建对话头上;禁用态自述补齐并以 aria-describedby 实证(title 空断言的空过教训留档);单一默认的移动语义有 e2e 钉住。重命名/访达打开按批准降级为后续任务。CI 12 项全绿零失败。合入。 |
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Aug 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改了什么
设置 · 偏好 新增「项目」页:项目列表管理 + 默认项目。task #160。
为什么
项目管理原本散在各处——添加在 composer、重命名在侧栏行菜单,而「新对话从哪个项目打开」根本不是一个设置:它是「上次用过的那个」,由
project-root-controller隐式决定,UI 上完全看不见也改不了。三层规则(按优先级)
「默认覆盖 last-used」而不是「仅在没有 last-used 时兜底」:几乎总是有 last-used,兜底式默认等于永远不生效,那就又是一个说话不算话的旋钮。
两个设计决定
存 projectId 不存路径。 catalog 持有 identity,项目 relink 到新位置后 id 不变;存路径会让这个偏好在目录移动后静默指向别处。
不可用项目不能设为默认(按钮禁用,且禁用态自述原因)。 与 #158「任何连接都能设默认」不同:连接失败是单次使用时才暴露、用户可以先设后修;而默认项目指向一个打不开的目录 = 每个新对话都坏,且修复手段(恢复目录)不在 app 内。预防优于降级。
默认项目失效(归档/目录没了)时,回退到 last-used 而不是让建会话失败,并且在设置页把降级说出来——静默降级和假控件是同一类谎。
范围说明
重命名和在访达中打开这一版没进行尾 … 菜单:前者需要仓库里尚不存在的 inline-edit 原语,后者需要新 IPC(app:openPath只认「当前项目」)。两个能力目前都还在侧栏行菜单里,没有任何能力丢失,作为后续小任务补。怎么验证的
settings-projects.spec.ts+settings-projectsfixture(三个 catalog 条目:可用 / 可用长路径 / 目录真的不存在):列表渲染、不可用行显示「目录不可用」、禁用按钮的aria-describedby确实说明原因、设为默认后 Badge 互换且落盘、同时只有一个默认。maka run process contract×2、node:sqlite×1)已确认为存量;runtime-host那例是 Timing-sensitive tests fail under parallel workspace runner (concurrency=3) #2132 的负载下时序 flake,单跑 725/0 通过。视觉
预览截图已过审(列表态 / 设为默认态)。截图过程中修掉三处:页头与节头「项目」标题重复、fixture 用编造路径导致整列渲染成不可用态、以及一个匹配不到 Astryx
Item的选择器。