Skip to content

feat(web,mobile): organize projects and threads with Spaces - #22655

Closed
nguyenphutrong wants to merge 17 commits into
pingdotgg:mainfrom
nguyenphutrong:feat/add-spaces-workspaces
Closed

nguyenphutrong wants to merge 17 commits into
pingdotgg:mainfrom
nguyenphutrong:feat/add-spaces-workspaces

Conversation

@nguyenphutrong

Copy link
Copy Markdown

Problem

Users with many projects have no way to separate unrelated work (for example Work and Personal) in the sidebar, command palette, or thread search. Everything shows in one list. Discussion: #6733.

Change

Adds device-local Spaces that group projects and their threads.

  • Each project belongs to at most one Space, and its threads follow it. A single thread can be moved to another Space on its own.
  • The sidebar dots switch Spaces; the grid icon shows all Spaces. spaces.next / spaces.previous (Alt+Shift+→/←) and Ctrl+1–9 switch from the keyboard.
  • An overview lets you drag projects between Spaces and create, rename, or delete Spaces.
  • A Space can override the app theme (Settings → Appearance edits the active Space's theme).
  • The sidebar, command palette, new-thread and new-project flows, and thread search are scoped to the active Space. New projects and threads join the Space that was active when they were created.
  • Spaces live in client settings and are not synced between devices.

Why it spans several packages:

  • packages/contracts: the SpacesState settings schema and the Space keybinding commands.
  • packages/client-runtime: the shared membership rules used by web and mobile.
  • apps/server: ThreadSearch accepts an optional thread-id filter, so search results are limited to the Space before the result limit applies.
  • apps/web and apps/mobile: the UI.

Keybinding change:

  • Thread jumps move off Ctrl+1–9 on Windows and Linux to Ctrl+Alt+1–9. Cmd+1–9 on macOS is unchanged.
  • A one-time startup migration updates untouched persisted defaults and leaves customized bindings alone.

Scope and approval

Proposed with screenshots in #6733 (comment). No maintainer has approved the direction yet. I'm happy to split this (web/desktop first, mobile later) or drop parts such as per-Space themes.

Verification

Focused tests, all passing on the merged head:

  • packages/client-runtime: src/state/spaces.test.ts, src/state/threadSearch.test.ts (17 tests)
  • apps/server: src/orchestration-v2/ThreadSearch.test.ts, src/keybindings.test.ts (25 tests; covers both legacy thread-jump defaults, removals, and a full config)
  • packages/contracts: src/keybindings.test.ts (3 tests)
  • apps/web: useSpaces, useHandleNewThread, useThreadActionMenu, keybindings, PullRequestThreadDialog (58 tests)
  • apps/mobile: use-composer-drafts, features/spaces, reactCompilerCoverage, dependency-graph (979 tests)
  • Package-scoped typecheck passes for server, contracts, shared, web, and mobile.

Manual check on web/desktop. Before, the sidebar has no Spaces. After:

Spaces switcher in the sidebar Spaces overview Per-Space theme

Not checked: the mobile drag-and-drop overview on a device or simulator after the latest merge from main.

Written with GPT-6.1 SOL and Opus 5.5 (Claude Code).

Persist context membership and themes, filter navigation and search, preserve draft context, and add Space navigation shortcuts. Focused mobile tests, TypeScript, lint, and SwiftLint passed. Native runtime verification is unavailable because device access is disabled.
Add context switching, assignment, scoped search and palette navigation, recent-thread restoration, and per-Space themes for web and desktop. Preserve draft context across retargeting and recover composer state when settings persistence fails. Focused tests, TypeScript, lint, independent review, and integrated Browser verification passed.
Use bottom dots and Ctrl+1–9 to switch Spaces, and show scoped projects in themed columns with pointer or long-press drag. Keep inherited threads moving with projects and explicit overrides in place. Reuse existing persistence and drag libraries, update untouched stored thread shortcuts, and retain custom bindings. Focused tests, scoped types/lint, independent review, and Browser verification passed; native device verification remains unavailable.
Show the active Space as a named pill among the sidebar dots and give the
overview its own board icon, so the current context is visible without
hovering. Spaces overview columns now size to their projects while keeping
full-height drop zones, mark the current Space, and drop repeated captions
and single-environment labels. Whole cards drag by mouse or long press,
keyboard drag stays on the grip, and the drag preview matches the card.
The Create a Space dialog uses the standard header, panel, and footer.
Create, rename, theme, and delete Spaces from the overview instead of a
separate Settings section. One dialog handles create and edit, with theme
balls drawn like Appearance so each option previews itself, and deleting
asks for confirmation.
A Space theme pinned the appearance to its theme's base mode, so the Color
scheme setting had no effect inside that Space. Space themes now swap only
the palette; picking the Light or Dark theme for a Space still sets its mode.
While a Space with its own theme is open, the Themes cards change that
Space's theme instead of the hidden app theme, and Use app theme returns the
Space to the app-wide theme.
# Conflicts:
#	apps/web/src/components/ChatView.tsx
assignCreatedProjectSpace and assignCreatedThreadSpace run after the project or thread exists. A rejected settings write aborted the onboarding import after its first project and skipped the follow-up steps in other create flows; it now shows the Spaces error toast instead.
SpaceAssignment reads settings.spaces through a selector; the mock returned the whole settings object.
…paces

# Conflicts:
#	apps/mobile/src/features/home/HomeRouteScreen.tsx
#	apps/mobile/src/features/home/HomeScreen.tsx
#	apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx
#	apps/mobile/src/features/projects/AddProjectScreen.tsx
#	apps/mobile/src/features/settings/SettingsRouteScreen.tsx
#	apps/mobile/src/features/threads/NewTaskDraftScreen.tsx
#	apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx
#	apps/mobile/src/features/threads/ThreadRouteScreen.tsx
#	apps/mobile/src/features/threads/new-task-flow-provider.tsx
#	apps/mobile/src/persistence/mobile-preferences.ts
#	apps/mobile/src/state/pending-new-tasks-model.test.ts
#	apps/mobile/src/state/queries.ts
#	apps/mobile/src/state/use-composer-drafts.test.ts
#	apps/server/src/keybindings.ts
#	apps/server/src/orchestration-v2/ThreadSearch.ts
#	apps/web/src/components/ChatView.tsx
#	apps/web/src/components/CommandPalette.tsx
#	apps/web/src/components/LegacySidebar.tsx
#	apps/web/src/components/PullRequestThreadDialog.test.ts
#	apps/web/src/components/PullRequestThreadDialog.tsx
#	apps/web/src/components/Sidebar.tsx
#	apps/web/src/components/settings/ProjectSettingsPanel.test.tsx
#	apps/web/src/components/settings/ThemeSettings.tsx
#	apps/web/src/hooks/useHandleNewThread.ts
#	apps/web/src/hooks/useNewProject.ts
#	apps/web/src/hooks/useScratchProject.ts
#	apps/web/src/hooks/useTheme.test.ts
#	apps/web/src/hooks/useThreadActionMenu.ts
#	apps/web/src/keybindings.test.ts
#	apps/web/src/keybindings.ts
#	apps/web/src/routes/_chat.index.tsx
#	apps/web/src/state/queries.ts
#	docs/user/keybindings.md
#	packages/contracts/src/keybindings.test.ts
#	packages/contracts/src/settings.ts
#	packages/shared/src/keybindings.ts
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:XXL 1,000+ changed lines (additions + deletions). labels Oct 21, 2026
@t3-code-bot

t3-code-bot Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

This PR does not currently meet the contribution guide's prior-approval requirement. Adds Spaces, assignment and navigation of projects/threads. Scope section says no maintainer has approved the direction; discussion #6733 supplies no approval for this implementation. Please obtain explicit upstream maintainer approval of the direction and scope in the relevant Ideas discussion and link the approval comment when requesting reconsideration. For a substantial bug fix, establish the failure and intended behavior through maintainer issue triage. Verification and draft status do not replace that requirement.

Thank you for trying to help improve T3 Code. If you think this closure was a mistake and the PR should be reopened, please tag @UtkarshUsername.

Closed at the request of @UtkarshUsername.

@t3-code-bot t3-code-bot Bot closed this Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant