Repository navigation
feat(desktop): hide CLI projects by default - #5164
liruifengv wants to merge 5 commits into
Conversation
🦋 Changeset detectedLatest commit: e80f8c0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2953338fae
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| sessionCount: w.sessionCount, | ||
| })); | ||
| const views = mergedWorkspaces.value | ||
| .filter((w) => showCliWorkspaces.value || w.kind !== 'implicit') |
There was a problem hiding this comment.
Distinguish CLI provenance before hiding implicit workspaces
When this setting is off, the filter treats every implicit workspace as CLI-created. However, POST /api/v1/sessions with only cwd intentionally creates an implicit workspace for external-agent handoffs (packages/kap-server/docs/kap.md:34-36,45), and mergeWorkspaces also synthesizes an implicit workspace when listWorkspaces fails. Those sessions now disappear from every desktop/web session view and boot auto-selection even though they are not necessarily CLI projects; track CLI provenance separately or preserve these cases instead of filtering solely on kind.
AGENTS.md reference: AGENTS.md:L203-L205
Useful? React with 👍 / 👎.
| sessionCount: w.sessionCount, | ||
| })); | ||
| const views = mergedWorkspaces.value | ||
| .filter((w) => showCliWorkspaces.value || w.kind !== 'implicit') |
There was a problem hiding this comment.
Keep deep-linked hidden sessions bound to their workspace
When a user opens an implicit session through a /sessions/<id> deep link while CLI projects are hidden, boot still selects that session, but this filter removes its workspace from workspaceById and makes activeWorkspaceId fall back to another managed project or null. The chat header and project tools then use the wrong workspace, and filesStore.workspaceMachineApi can route host-file reads to the fallback project's host or the local machine for a remote session. Keep canonical active-workspace metadata separate from sidebar visibility.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d4620566d7
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| <span :class="props.mobile ? 'srow-main' : 'rlabel'"> | ||
| <span :class="props.mobile ? 'srow-label' : undefined">{{ t('settings.runningSendMode') }}</span> | ||
| <span :class="props.mobile ? 'srow-sub' : 'hint'">{{ t('settings.runningSendModeHint') }}</span> |
There was a problem hiding this comment.
Preserve inner styles in the extracted setting
When “Send while running” is rendered in either settings view, the .rlabel/.hint and .srow-main/.srow-* elements now live inside this child component, so the parents' scoped CSS cannot match them; only the child root receives the parent scope attribute. Consequently the desktop title and hint lose their column typography, while the mobile label no longer occupies a full flex row and can squeeze the segmented control on narrow screens. Define these inner styles in this component or explicitly pierce the parent scope.
AGENTS.md reference: AGENTS.md:L207-L209
Useful? React with 👍 / 👎.
| <span :class="props.flat ? 'srow-main' : undefined"> | ||
| <span | ||
| class="t text-row-label" |
There was a problem hiding this comment.
Restore flex sizing for grouped mobile session titles
In grouped mobile view, this wrapper receives no srow-main class, so it remains a flex item with the default automatic minimum width, while the nested title's flex: 1 has no effect because its parent is not a flex container. A long session title therefore refuses to shrink and can push the attention count, timestamp, and options button outside the sheet instead of ellipsizing as the previous direct flex child did. Apply the shrink/flex rules to this wrapper in grouped mode as well, or omit the wrapper there.
AGENTS.md reference: AGENTS.md:L207-L209
Useful? React with 👍 / 👎.
| const mostRecent = sessionsStore().sessions.find((session) => | ||
| workspacesStore().visibleWorkspaceIds.has(workspacesStore().workspaceIdForSession(session)), |
There was a problem hiding this comment.
Paginate past hidden groups before auto-selecting
For users with at least 50 more-recent implicit workspace groups before their first managed project, the initial grouped request contains only hidden sessions, so this lookup returns no candidate and boot leaves them on a new-project draft. drainRemainingSessionGroups later adds the managed sessions in the background but never reruns auto-selection; before this filter, the newest session in that first page was always selectable. Either request only visible workspace IDs, continue paging until a visible candidate is found, or perform selection after the background drain.
AGENTS.md reference: AGENTS.md:L191-L193
Useful? React with 👍 / 👎.
| .kmenu { | ||
| position: absolute; | ||
| right: 12px; | ||
| top: 44px; | ||
| z-index: var(--z-dropdown); |
There was a problem hiding this comment.
Keep workspace menu positioning in the parent scope
When a user opens the options menu on a mobile workspace header, that Menu is still rendered by MobileSwitcherSheet, but the shared .kmenu positioning rule now lives in this child component's scoped stylesheet and cannot match it. The remaining parent .wsmenu rule supplies only top, right, and width, so without position: absolute and the dropdown z-index those offsets are ignored and the menu participates in the workspace header's flex layout instead of overlaying it. Keep the positioning rule in the switcher or move it to a genuinely shared style.
AGENTS.md reference: AGENTS.md:L207-L209
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a5ddb71005
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| font-variant-numeric: tabular-nums; | ||
| color: var(--color-text-faint); | ||
| } | ||
| .att { |
There was a problem hiding this comment.
Restore collapsed-workspace attention badge styles
When a collapsed mobile workspace has pending approvals or questions, MobileSwitcherSheet still renders its own .att span, but this shared rule was moved into MobileSessionRow's scoped stylesheet and therefore cannot match the parent-owned span. The count consequently appears as an unstyled number instead of the warning pill; keep this rule in the switcher or in genuinely shared CSS.
AGENTS.md reference: AGENTS.md:L207-L209
Useful? React with 👍 / 👎.
Requirement or Bug
Desktop and Web currently mix projects and sessions created by Kimi Code CLI into the sidebar. This PR hides those implicit projects by default, adds a desktop and mobile opt-in with CLI labels, and prevents Desktop from changing a CLI project's primary directory.
Bug Reproduction Steps
N/A
Root Cause
N/A
Code Changes
Reuse the existing
AppWorkspace.kindclassification instead of adding provenance to session storage or changing KAP.implicitidentifies projects entered from a terminal, while Desktop-created projects remainmanaged.workspacesStore, so grouped, flat, pinned, completed, mobile, search, and jump-list projections all follow the same setting.kimi-web.show-cli-workspaces. Desktop exposes it under Agent & Sessions → CLI projects; mobile exposes it under Settings → App.setPrimaryendpoint are unchanged.Screenshots / Recordings
The new CLI projects module is the last section under Agent & Sessions, with the opt-in enabled for this example.
An implicit project created through the real session API appears in the sidebar with its CLI badge.
Behavior Changes and Affected Users
Maintainer sign-off is requested for the intentional fixed-primary restriction because it has no Desktop escape hatch.
The visibility setting is covered by store and view-projection tests, including grouped, flat, pinned, and mobile views. Startup selection has a regression test with a newer hidden CLI session and an older managed session. Component tests cover the CLI badge, desktop and mobile settings, and the fixed-primary editor. Managed-project behavior is preserved by the existing test suites.
Verification
pnpm --filter kimi-code-app run typecheckpassed.pnpm lintpassed.pnpm run check:duplication mainpassed.pnpm -C docs run buildpassed.git diff --checkpassed.Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.