feat: let web search widen past the focused session's workspace - #312
Merged
Conversation
Third and last surface. #309 gave the TUI a Tab toggle and #311 gave Telegram a button; the web UI still had no way to ask for a cross-workspace search while a session was focused. Its anchoring was already right -- it passed the focused session's workdir, which is what Telegram had to be fixed to do -- but the scope was derived and never overridable: ...(focusedSession()?.workdir ? { workdir: focusedSession()!.workdir, scope: "workspace" } : { scope: "all" }) So global search was reachable only by accident, when nothing happened to be focused. With a session open you searched one directory, and the 73% precision@1 path the feature exists for was unreachable. A segmented control in the modal header now switches This workspace / All workspaces. It is an override on top of the derived default rather than a replacement for it, so focusing a session later does not silently undo a choice the user made. The control is hidden entirely when nothing is focused, because there is no workspace to scope to and a toggle with one meaningful position is noise. The debounce effect now depends on scope as well as query, so flipping re-runs the current query instead of leaving stale hits from the other regime on screen. Zero hits under workspace scope also offers a widen button inline -- the same reasoning as the Telegram keyboard, since an empty scoped result is exactly when widening helps. Ctrl+K is taken for open/close, so this is a click target rather than a key. Results already render hit.workdir, so global hits were legible without further work. Worth recording, since it is easy to misread: a workspace is a DIRECTORY, not a session family. workspaceIdFromPath hashes workdir + account_id + project_id, so every session that ever ran in that directory under the same tenant shares the workspace, related or not -- and a fork isolated into a git worktree gets a different path, so it lands OUTSIDE its parent's scope. That is precisely the history cross-workspace search recovers. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
rsharath
approved these changes
Sep 1, 2026
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.
Third and last surface. #309 gave the TUI a Tab toggle, #311 gave Telegram a button, and the web UI still had no way to ask for a cross-workspace search while a session was focused.
The gap
The web UI's anchoring was already correct — it passed the focused session's workdir, which is what Telegram had to be fixed to do. But the scope was derived and never overridable:
Global search was reachable only by accident, when nothing happened to be focused. With a session open you searched one directory, and the 73% precision@1 path the feature exists for was unreachable.
The change
A segmented control in the modal header switches This workspace / All workspaces.
scopeas well asquery, so flipping re-runs the current query instead of leaving stale hits from the other regime on screenCtrl+K is taken for open/close, so this is a click target rather than a key. Results already render
hit.workdir, so global hits were legible without further work.A workspace is a directory, not a session family
Worth recording because it's easy to misread.
workspaceIdFromPathhashesworkdir + account_id + project_id, so:That second point is precisely the history cross-workspace search recovers, and it's invisible unless you can ask for it.
Verification
bun run typecheckclean (root + web)bun run lintclean (360 files)scopedependency in the effect, so they're real rather than passing either wayCo-authored-by: Claude Opus 5 (1M context) noreply@anthropic.com
🤖 Generated with Claude Code