Skip to content

fix(web-ui): restore all scoped sessions in Recents and fix remote Recents - #1342

Merged
iruriQ merged 1 commit into
mainfrom
fix/restore-recents-all-sessions
Nov 28, 2026
Merged

iruriQ merged 1 commit into
mainfrom
fix/restore-recents-all-sessions

Conversation

@iruriQ

@iruriQ iruriQ commented Nov 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Restore the original intentional behavior of sidebar 「最近 / Recents」 (reverting PR #1279 and PR #1280's exclusion of project-owned threads) and fix remote host scope bugs that left Recents empty with a ghost 「展开显示」 button and a local-only compose button when viewing a single remote host.

Problem

  1. Excluding project-owned sessions from Recents caused active recent sessions (e.g. 2 min / 9 min ago in an expanded or collapsed project) to disappear from Recents, leaving only older ungrouped threads.
  2. When selecting a single remote host (e.g. • C), Recents rendered empty because ungrouped remote sessions were dropped by filterSessionsByHostScope, while local-only canStartProjectless kept the empty section header visible and local list.hasMore leaked through to render a ghost 「展开显示」 button below 0 rows.

Changes

  • apps/web-ui/packages/client/ui-workspace/src/client/rows/sidebar-window.ts: Remove the excludedIds parameter introduced by PR fix(web): omit visible project threads from Recents #1279.
  • apps/web-ui/packages/client/ui-workspace/src/client/rows/WorkspaceBrowser.tsx:
    • Remove PR fix(sidebar): exclude project-owned threads from Recents #1280's projectSessionIds filtering so Recents retains all recent visible root sessions in scope (still excluding blank drafts, subagents, and pinned/native-section items, with independent recent:${id} row keys).
    • Gate canStartProjectless via hostScopeIncludesUngroupedLocal and local pagination (hasMore / loading) via hostScopeIncludesLocalSessions.
  • apps/web-ui/packages/client/ui-workspace/src/client/rows/host-scope-filter.ts:
    • Add hostScopeIncludesUngroupedLocal and hostScopeIncludesLocalSessions.
    • Allow ungrouped sessions of any included host in mode: "all" to pass filterSessionsByHostScope.
  • apps/web-ui/packages/client/ui-workspace/test/sidebar-window.test.ts & host-scope-filter.test.ts: Remove obsolete excludedIds test and add focused regression coverage for project sessions in Recents, single remote host Recents, selected-workspace scoping, and local hasMore/canStartProjectless gating.
  • docs/product/standalone-web.md: Sync the Recents specification to match current behavior.

Visual Changes

Sanitized Playwright comparison of Local, Remote All, and Remote Selected-Workspace Recents

Validation

  • Focused unit tests (54/54 passed in implementation session): sidebar-window.test.ts (9/9), host-scope-filter.test.ts (27/27), thread-tree.test.ts (18/18).
  • pre-commit Prettier formatting check on all 6 changed files: passed.
  • Playwright screenshots rendered against the real WorkspaceBrowser component and inspected across Local, Remote host (• C), and Remote selected-workspace views.
  • Full-repo lint/typecheck/test delegated to CI per AGENTS.md.

…cents

Restore the original intentional Recents behavior by reverting PR #1279/#1280 project-session exclusion so Recents once again lists all recent visible root sessions in the active host scope (including sessions belonging to expanded, collapsed, or windowed projects).

Also fix remote host scope bugs in Recents:
- Include ungrouped sessions belonging to the selected remote host (in "all" mode) instead of restricting ungrouped sessions to local only.
- Gate local catalog pagination (list.hasMore / list.loading) by hostScopeIncludesLocalSessions so remote-only views no longer show a ghost "Show more" button when there are no more remote rows.
- Gate projectless session creation (canStartProjectless) by hostScopeIncludesUngroupedLocal so remote-only and local-selected-workspace views do not expose a local-only compose button or render an empty Recents section.
@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • 功能优化
    • “最近”列表现在汇总当前主机范围内可见工作区及未归属工作区的会话,并遵循主机和工作区筛选条件。
    • 当当前范围不包含本机无项目会话时,不显示无项目新建会话入口。
  • 文档
    • 更新“最近”列表的范围、排序及显示规则说明。

Recents 现在按当前主机范围显示可见工作区及未归属工作区的会话。工作区视图根据范围调整本地分页状态和无项目会话入口。Recents 不再预先排除项目会话。

Changes: 主机范围下的 Recents

Layer / File(s) Summary
主机范围会话筛选
apps/web-ui/packages/client/ui-workspace/src/client/rows/host-scope-filter.ts, apps/web-ui/packages/client/ui-workspace/test/host-scope-filter.test.ts
新增会话主机归类和本地会话范围判断。未归组会话现在按主机筛选及工作区子集模式过滤。测试覆盖远程主机、工作区子集和本地范围判断。
Recents 窗口会话处理
apps/web-ui/packages/client/ui-workspace/src/client/rows/sidebar-window.ts, apps/web-ui/packages/client/ui-workspace/src/client/rows/WorkspaceBrowser.tsx, apps/web-ui/packages/client/ui-workspace/test/sidebar-window.test.ts, docs/product/standalone-web.md
sidebarWindow 不再接受 excludedIds,且隐藏数量改为基于全部会话计算。工作区视图移除项目会话 ID 排除逻辑。文档更新 Recents 的范围和入口说明。
工作区视图范围联动
apps/web-ui/packages/client/ui-workspace/src/client/rows/WorkspaceBrowser.tsx, apps/web-ui/packages/client/ui-workspace/test/host-scope-filter.test.ts
本地会话不在当前范围内时,工作区视图将本地分页的 hasMore 和 loading 设为 false。只有范围包含本地未分组会话时,视图才传入允许无项目启动的状态。新增 Recents 范围测试。

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant hostScopeFilter
  participant WorkspaceBrowser
  participant sidebarWindow
  participant SessionTree
  hostScopeFilter->>WorkspaceBrowser: 提供筛选后的会话和本地范围判断
  WorkspaceBrowser->>sidebarWindow: 对 Recents 会话应用窗口处理
  WorkspaceBrowser->>SessionTree: 传入范围调整后的无项目会话入口状态
Loading

Possibly related PRs

Suggested reviewers: bytepioneer-ai, yuhome-wu

Merge Risk: Minimal · up to 956b7

This change restores project-owned sessions to Recents and scopes Recents, pagination and the new-session entry point to the selected host. It is covered by focused tests, and I found no concrete defect that blocks merging. The remaining uncertainty is limited to whether real remote summaries always carry host identity, and no evidence shows they do not.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed 标题“fix(web-ui): restore all scoped sessions in Recents and fix remote Recents”与变更集的主要内容一致。变更移除了 sidebarWindow 的 excludedIds 参数,并取消了 WorkspaceBrowser.tsx 中对项目会话的排除,使最近列表恢复显示当前范围内的会话。标题同时提及远程 Recents 修复…
Description check Passed 描述说明了恢复 Recents 行为(撤销 PR #1279 和 #1280 的项目会话排除)以及远程主机范围修复。这些内容与 sidebar-window.ts、WorkspaceBrowser.tsx、host-scope-filter.ts、测试文件及 docs/product/standalone-web.md 的变更直接对应。描述还列出了问题、变更内容和验证方式,与变更集高度相关。
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

标题“fix(web-ui): restore all scoped sessions in Recents and fix remote Recents”与变更集的主要内容一致。变更移除了 sidebarWindow 的 excludedIds 参数,并取消了 WorkspaceBrowser.tsx 中对项目会话的排除,使最近列表恢复显示当前范围内的会话。标题同时提及远程 Recents 修复,对应 host-scope-filter.ts 和 WorkspaceBrowser.tsx 中的主机范围判断变更。标题简洁,且未包含无关信息。

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between cfc33ca and 956b7d0.

Files selected for processing: 6

  • apps/web-ui/packages/client/ui-workspace/src/client/rows/WorkspaceBrowser.tsx
  • apps/web-ui/packages/client/ui-workspace/src/client/rows/host-scope-filter.ts
  • apps/web-ui/packages/client/ui-workspace/src/client/rows/sidebar-window.ts
  • apps/web-ui/packages/client/ui-workspace/test/host-scope-filter.test.ts
  • apps/web-ui/packages/client/ui-workspace/test/sidebar-window.test.ts
  • docs/product/standalone-web.md
Files with no reviewable changes: 1

  • apps/web-ui/packages/client/ui-workspace/test/sidebar-window.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

Recent review details

Context from checks skipped due to timeout: 7

  • GitHub Check: Check ubuntu-22.04
  • GitHub Check: Check Linux ARM64
  • GitHub Check: Vitest
  • GitHub Check: Static checks
  • GitHub Check: Check windows-latest
  • GitHub Check: Check macos-26
  • GitHub Check: Web Host tests
Additional context used

Code guidelines: 1

docs/product/standalone-web.md — auto-discovered
Path-based instructions: 1

Applicability reference: AGENTS.md: # Repository Guidelines `npm start` / `npm start web` rebuild and relaunch the user's Desktop / Web and may restart the shared Host; `npm stop` stops all local codexhost services across worktrees.

CodeRabbit inference engine (docs/product/standalone-web.md)

Files:

  • apps/web-ui/packages/client/ui-workspace/src/client/rows/WorkspaceBrowser.tsx
  • apps/web-ui/packages/client/ui-workspace/src/client/rows/host-scope-filter.ts
  • apps/web-ui/packages/client/ui-workspace/src/client/rows/sidebar-window.ts
  • apps/web-ui/packages/client/ui-workspace/test/host-scope-filter.test.ts
Additional comments: 1

apps/web-ui/packages/client/ui-workspace/src/client/rows/host-scope-filter.ts: 1

249-249: Data Integrity & Integration

The reported gap needs a remote ungrouped session summary that reaches sessionHostKey without remoteHost.hostId. The inspected producers attach remoteHost to remote summaries. The only test that omits production data uses hand-filled fixtures. The repository does not establish the omitted-projection premise, so the concern is an unsubstantiated hypothesis, not a defect this change introduces.

@iruriQ
iruriQ merged commit 1570145 into main Nov 28, 2026
6 of 8 checks passed
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