Inspector scope picker: folder-first workspace selection - #81
Open
dix105 wants to merge 10 commits into
Open
Conversation
- Add InspectorScope model (unset/global/project) with per-session storage - Add InspectorScopePicker: folder browser with lazy-load, search, badges - Add /api/folders/tree middleware endpoint for folder browsing - Fix workspace-api workspaceBasePath(null) to mean real global workspace - Wire scope through AppPage -> InspectorPanel -> InspectorView -> tabs - WorkspaceTab/GitTab show picker when direct chat scope is unset - Project/topic chat scope always overrides stored direct-chat scope - Reset git selection when scope changes - Tests: 7 new tests for scope model (all passing, 15 total inspector)
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
added 9 commits
May 27, 2026 17:19
The early return for unset scope was placed BEFORE useState/useEffect hooks. When switching between tabs with different scope states, React saw different hook counts and silently broke — the tab highlighted but content stopped updating. Moved the guard after all hooks, matching GitTab's correct pattern.
GitTab's handleRepoSelect was setting both workspaceRoot and repoRoot to the selected repo path. This destroyed the user's original workspace folder choice when they picked a no-Git folder first, then connected a different Git repo from the Git tab. Now only updates repoRoot — workspace folder stays as chosen. Preserves: Workspace = folder-first, Git = optional metadata.
- Remove Projects quick list from the picker sidebar - Collapse picker to a single folder list - Remove Project/Git/No Git badges from folder rows - Use neutral grey folder icons - Move Global Workspace into footer action row next to Cancel/Use - Keep project detection behavior internally without visual noise
Normal chats should not each require connecting Workspace/Git. They now default to the shared Global Workspace unless that chat has an explicit stored scope. Project/topic chats remain project-scoped.
- Make workspace picker an explicit change action instead of first-screen blocking - Add Workspace tab scope header with Global/Chat/Project labels - Add Change folder and Reset to Global actions where appropriate - Allow project workspace changes to update the existing project instead of creating a new one - Reword Git empty states so Git manages repository only - Add Change repository and Disconnect repository actions - Preserve rule: Git updates repoRoot only, Workspace owns workspaceRoot
Remove the separate hover-preview closing timer so hover open/close uses the same width and content transition path as the header sidebar toggle.
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 free
to 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.
What
Implements the planned inspector scope picker — folder-first workspace selection for each chat, with Git as optional metadata.
Scope model
Every chat gets one
InspectorScope:Rules:
globalis explicit, never a silent fallbackNew files
inspectorScope.ts— scope type, storage, helpersinspectorScope.test.ts— 7 tests (all passing)InspectorScopePicker.tsx— folder browser picker with:/api/folders/treeendpoint — returns folder metadata (hasGit, gitRoot, isProjectRoot, projectId, etc.)Changes
workspace-api.ts:workspaceBasePath(null)now means real global workspace (not localStorage fallback)AppPage.tsx: owns inspector scope state per chat, loads from storage, passes downInspectorPanel/View: accept + forward scopeWorkspaceTab/GitTab: show picker when scope is unsetTests
workspaceControlsprop)