From 178d0ebe7aafe6c09ec561f7b79a87d8043aeb1a Mon Sep 17 00:00:00 2001 From: Paul Lizer Date: Fri, 9 Oct 2026 11:34:05 -0400 Subject: [PATCH] Move public search scope into Documents Place aggregate public scope choices in the existing Documents picker while preserving the public directory handoff and Orchestrate manual-controls placement. Add regression coverage and update the V2 documentation and version. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- application/single_app/config.py | 2 +- .../v2_ui/src/components/chat/Composer.tsx | 75 +++--- .../src/components/chat/ComposerEditor.tsx | 7 +- .../components/chat/DocumentPickerPopover.tsx | 41 +++ .../features/CHAT_CONTEXT_PICKER.md | 12 +- .../features/V2_AGGREGATE_PUBLIC_CHAT.md | 26 +- .../V2_DOCUMENT_SEARCH_SCOPE_PLACEMENT_FIX.md | 97 +++++++ docs/guides/use-public-workspaces.md | 6 +- docs/reference/chat-controls.md | 7 +- .../test_v2_chat_context_picker.py | 18 +- .../fixtures/orchestration/harness_entry.tsx | 3 + ui_tests/test_v2_chat_context_selection.py | 4 +- ui_tests/test_v2_orchestration_composer.py | 39 ++- ui_tests/test_v2_public_chat_scope.py | 249 ++++++++++++++++-- ui_tests/test_v2_public_directory.py | 11 +- 15 files changed, 530 insertions(+), 67 deletions(-) create mode 100644 docs/explanation/fixes/V2_DOCUMENT_SEARCH_SCOPE_PLACEMENT_FIX.md diff --git a/application/single_app/config.py b/application/single_app/config.py index 14e7f949f..43ca4b9fe 100644 --- a/application/single_app/config.py +++ b/application/single_app/config.py @@ -101,7 +101,7 @@ EXECUTOR_TYPE = 'thread' EXECUTOR_MAX_WORKERS = 30 SESSION_TYPE = 'filesystem' -VERSION = "0.261.314" +VERSION = "0.261.315" IS_DEVELOPMENT = is_development_env_enabled() # Opt-out for deployments where App Service Easy Auth is active but the platform diff --git a/application/v2_ui/src/components/chat/Composer.tsx b/application/v2_ui/src/components/chat/Composer.tsx index 41e6c6d42..8cc1cd0bb 100644 --- a/application/v2_ui/src/components/chat/Composer.tsx +++ b/application/v2_ui/src/components/chat/Composer.tsx @@ -35,7 +35,6 @@ import { buildSelectionFields, hasResolvableAgent } from '../../lib/chatRequestS import { modelSelectionKey, findModel, type ModelCatalogEntry } from '../../lib/models'; import { promptUrls, resolveGating } from '../../lib/composerGating'; import { resolveDocumentScope } from '../../lib/documentScope'; -import { readPublicWorkspaceSelection } from '../../lib/publicChatScope'; import { usePublicWorkspaceLabels } from '../../lib/publicWorkspaceLabels'; import { addContextItem, @@ -165,7 +164,7 @@ function ToolToggle({ )} > {icon} - {label} + {label} ); } @@ -391,6 +390,11 @@ export function Composer({ initialAgentSelection }: { initialAgentSelection?: st // when orchestrating with manual controls left reachable. const manualControlsVisible = !orchestrating || (manualControlsGovernable && manualControlsOpen); + useEffect(() => { + if (!manualControlsVisible) { + setPickerOpen(false); + } + }, [manualControlsVisible]); /** * The Orchestrate model: Auto (a model chosen per step) or one pinned model. @@ -1014,7 +1018,19 @@ export function Composer({ initialAgentSelection }: { initialAgentSelection?: st const submit = (allowUnfilled = false) => { if (publicWorkspaceSelection && (!features.enable_public_workspaces || publicScopeConflict || answeringFromStoredResult || (options.imageGeneration && !orchestrating))) { - toast.error('Public search needs public sources only. Clear incompatible sources or choose Current context.'); + const recovery = options.imageGeneration && !orchestrating + ? 'Turn off Image, then open Documents and choose Current context.' + : answeringFromStoredResult + ? 'Remove the saved result, then open Documents and choose Current context.' + : orchestrating && !manualControlsGovernable + ? 'Switch to Manual mode, then open Documents and choose Current context, or start a new chat.' + : `Open ${orchestrating ? 'Manual controls, then ' : ''}Documents to clear incompatible references or choose Current context.`; + toast.error(`Public search needs available public sources only. ${recovery}`); + if (!answeringFromStoredResult && !(options.imageGeneration && !orchestrating) + && (!orchestrating || manualControlsGovernable)) { + setManualControlsOpen(true); + setPickerOpen(true); + } return; } if (streaming || !canPost || uploadsBlocked || workflowResultOpening) { @@ -1651,35 +1667,21 @@ export function Composer({ initialAgentSelection }: { initialAgentSelection?: st )} - {!shared && (features.enable_public_workspaces || publicWorkspaceSelection) && ( -
- - - {publicWorkspaceSelection && - {publicWorkspaceSelection === 'all' ? 'Public only, including hidden workspaces.' : 'Public only, using your directory visibility choices.'} - } - {publicScopeConflict &&

- {nonPublicReferences - ? 'Clear personal or group references, or choose Current context before sending.' - : 'Clear whole-workspace references, or choose Current context to search a selected workspace.'} -

} - {publicWorkspaceSelection && !features.enable_public_workspaces &&

- Public workspaces are currently disabled. Choose Current context to continue. -

} -
- )} { if (open) { clearAnalysisResultContext(); } setPickerOpen(open); + if (!open) { + textareaRef.current?.focus(); + } }} searchAll={options.documentSearch} onToggleSearchAll={publicWorkspaceSelection ? undefined : () => { @@ -1939,7 +1944,7 @@ export function Composer({ initialAgentSelection }: { initialAgentSelection?: st