Skip to content

fix(workspace): exclude MiniApp workspaces from recent workspaces list - #1869

Merged
bobleer merged 1 commit into
GCWing:mainfrom
bobleer:fix/exclude-miniapp-workspaces-from-recent
Jul 30, 2026
Merged

fix(workspace): exclude MiniApp workspaces from recent workspaces list#1869
bobleer merged 1 commit into
GCWing:mainfrom
bobleer:fix/exclude-miniapp-workspaces-from-recent

Conversation

@bobleer

@bobleer bobleer commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

MiniApp agent runs work inside directories the MiniApp owns under <userRoot>/data/miniapps/ (deck folders, customization drafts). Those directories were tracked as ordinary workspaces, so they appeared in the recent workspaces list on the Welcome page and in the nav workspace switcher, and could even be auto-opened on startup when no workspace was active.

They are now excluded, following the same approach as #1865 for linked worktrees:

  • Web data source (global-state.ts): new isMiniAppWorkspace next to isLinkedWorktreeWorkspace, both applied through one isExcludedFromRecentWorkspaces predicate in the startup snapshot and getRecentWorkspaces. This also hides entries already recorded in a user's local history.
  • Backend (workspace/service.rs): normalize_workspace_options_for_path forces add_to_recent = false for MiniApp-owned paths, so no new entries accumulate; startup history load drops recent ids persisted before this change. MiniApp workspaces stay registered, so their agent sessions keep resolving them.

Type and Areas

Type: bug fix

Areas: Rust core, web UI

Motivation / Impact

Opening a MiniApp that runs an agent (for example the built-in PPT Live decks) polluted the recent workspaces list with one deck-<timestamp>-<id> entry per deck. These are MiniApp storage rather than user projects, so they pushed real projects out of the capped recent list, and AppLayout could auto-switch into one of them on startup when no workspace was active.

Users now see only real workspaces in the Welcome page list and the nav switcher menu; already-recorded MiniApp entries disappear on next launch and are cleaned out of workspace_data at startup. No behavior change for MiniApp agent sessions themselves.

Verification

cd src/web-ui && npx vitest run src/shared/types/global-state.test.ts   # 3 passed (1 new case)
cd src/web-ui && npx tsc --noEmit -p tsconfig.json                      # clean
cargo test -p bitfun-core --lib service::workspace::                    # 13 passed (1 new case)
cargo check -p bitfun-core                                              # clean

New tests:

  • global-state.test.ts — a deck path under .../bitfun/data/miniapps/builtin-ppt-live/decks/... is dropped from the startup snapshot's recent list.
  • service.rs::track_workspace_activity_keeps_miniapp_workspaces_out_of_recent_history — tracking a MiniApp deck path still registers the workspace (resolvable by path) but leaves recent history empty.

Note: cargo clippy -p bitfun-core --lib --tests fails on a pre-existing, unrelated suspicious_open_options lint in services-core/src/json_store.rs:346, untouched by this PR.

Reviewer Notes

  • Detection differs per layer on purpose: the backend compares against path_manager.miniapps_dir() with Path::starts_with (exact), while the web layer has no app-paths API and matches the /data/miniapps/ segment on the normalized root path. user_data_dir is always <userRoot>/data, so that segment holds on macOS, Linux, and Windows, and it covers .drafts customization roots as well as agent workspaces.
  • Only the recent list is affected; workspace registration, opened workspaces, and the current workspace are untouched.

MiniApp agent runs work inside directories the MiniApp owns under
`<userRoot>/data/miniapps/` (deck folders, customization drafts). Those
directories were tracked as ordinary workspaces, so they appeared in the
recent workspaces list on the Welcome page and in the nav workspace
switcher, and could even be auto-opened on startup when no workspace was
active.

Filter them out at the web data source next to the existing linked
worktree exclusion, which also hides entries already recorded in local
history. On the backend, workspace options for MiniApp-owned paths no
longer add to recent, and startup history load drops entries persisted
before this change. MiniApp workspaces stay registered, so their agent
sessions keep resolving them.
@bobleer
bobleer merged commit a1b5f28 into GCWing:main Jul 30, 2026
4 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.

1 participant