Skip to content

Show every file a conversation produced in the V2 Documents drawer - #1720

Merged
Paul Lizer (paullizer) merged 2 commits into
paullizer-react-v2-uifrom
paullizer-generated-files-documents-pane
Oct 8, 2026
Merged

Paul Lizer (paullizer) merged 2 commits into
paullizer-react-v2-uifrom
paullizer-generated-files-documents-pane

Conversation

@paullizer

Copy link
Copy Markdown
Contributor

Summary

In V2 chat, a file a conversation produced only appeared as a card in the thread. For example, a plan rendered us_states_and_capitals.csv, the reply showed Completed and Download CSV, and the Documents drawer still said "No documents used yet". Only images showed up, through the Media section.

The drawer's Generated section (added in 0.261.255) only ran in shared conversations, and it only listed documents agents saved with the SimpleChat upload actions. Plan outputs, exports and Analyze files are recorded on the reply's metadata, and nothing passed them to the drawer.

  • Every generated file, in every conversation. Generated now lists:

    • every format a plan can render: CSV, Excel, Word, PDF, PowerPoint, Markdown, text, JSON, XML and YAML;
    • exports, Analyze summaries and comparison files a reply wrote.

    A file that is not ready yet (waiting, rendering, failed, cancelled, or awaiting approval in a shared chat) is listed with its status. Download appears once it is ready, Preview opens Markdown and files that carry a preview, and Show in conversation scrolls to the reply that produced it.

  • Agent documents in personal chats. New owner-only routes GET /api/conversations/<id>/generated-documents and .../generated-documents/<document_id>/download give personal conversations what shared ones already had. They reuse the shared conversation's reader (collect_generated_documents) and its download rules (authorize_generated_document_download).

  • Header badge. The Documents button's count now includes generated files as well as documents used in answers, each counted once.

  • Empty state. The empty drawer now says "No documents yet".

How it fits together, and what to look at in review:

  • Reused readers. The file list is built on the client (lib/conversationGeneratedFiles.ts) from the messages already loaded, using the readers the thread's own cards use. Those are readGeneratedArtifacts, normalizeOrchestrationAttempt with committedOrchestrationArtifact, and the live orchestration run state.
  • Same visibility rules. The drawer applies the same masking, workflow-reply and saved-Analyze rules as the thread, and lists a plan's committed file once. No new request is needed for these files.
  • Existing download routes. Downloads use the routes the cards already use: /api/chat_artifacts/download (with its approval and publication checks) or /api/workspace_documents/download.
  • One shared copy. stores/generatedDocumentsStore.ts holds a single copy of the agent-document list, shared by the badge and the drawer, so opening the drawer doesn't repeat the badge's request.
  • When the list is read. The list is only requested when a reply ran an upload action or came from an agent. It is read again whenever the replies the thread shows change: a new or deleted reply, another attempt shown, or a reply masked.
  • Visible documents only. Only documents whose reply is shown are listed.
  • Shared chats. A shared chat's list is requested once the reader has joined, and a refused read is never cached.
  • Live background exports. A background export's card now reports when its run finishes (stores/generatedExportRunStore.ts), so the drawer updates without reloading.
  • Refactor. The shared-chat file fetch moved from lib/collaboration.ts to lib/generatedDocuments.ts. The old collaborative-only useGeneratedDocuments hook is replaced, and ArtifactPreviewDialog is exported for reuse.

Linked issue

N/A (no associated issue)

Release Notes & Latest Features

  • New Feature
  • Bug Fix
  • UI Enhancement
  • Breaking Change
  • Internal only

Is this visible to end users?

  • Yes
  • No

Is this admin-facing (Admin Settings, governance, deployment, config)?

  • Yes
  • No

Should this become a Latest Feature card?

  • Yes
  • No
  • Already added

Screenshot needed for the card?

  • Yes
  • No
  • Attached

Version bump

  • application/single_app/config.py VERSION third segment bumped, or not needed because this is docs-only (0.261.301 -> 0.261.302)
  • deployers/version.txt bumped, or not needed because deployers/ was not changed

Testing / validation

  • npm --prefix application\v2_ui run typecheck: passed
  • npm --prefix application\v2_ui run build: passed. Also built into ui_tests\artifacts\orchestration-plan-editor for the UI tests.
  • node functional_tests\test_v2_drawer_generated_files_logic.mjs: passed (new)
  • node functional_tests\test_v2_drawer_media_logic.mjs: passed
  • python functional_tests\test_personal_conversation_generated_documents.py: passed, 4/4 (new)
  • python functional_tests\test_collaboration_generated_documents.py: passed, 5/5
  • python functional_tests\test_v2_conversation_drawer.py: passed, 8/8
  • python -m pytest functional_tests\test_personal_conversation_generated_documents.py functional_tests\test_collaboration_generated_documents.py -q: 9 passed
  • Route policy tests: all passed.
    • python functional_tests\route_tests\test_route_blueprint_policy_inventory.py: 14/14
    • python functional_tests\route_tests\test_route_unauthenticated_policy_contract.py: 9/9
    • python functional_tests\route_tests\test_route_policy_test_coverage.py: 3/3
  • python scripts\check_xss_sinks.py --base-sha fa3422dee --head-sha HEAD <changed files>: passed, 18 files
  • python scripts\check_broken_access_control.py --base-sha fa3422dee --head-sha HEAD <changed .py files>: passed, 6 files
  • Docs: all passed.
    • python scripts\build_docs_inventory.py: no inventory change
    • python functional_tests\test_docs_app_surface_coverage.py: 7/7
    • python functional_tests\test_docs_site_quality.py: 6/6
  • python -m pytest ui_tests\test_v2_drawer_generated_files.py ui_tests\test_v2_collaboration_ux.py -q: 13 passed. These include the new drawer tests and a new shared-chat invitation test.
  • python -m pytest ui_tests\test_v2_orchestration_planning_retry.py ui_tests\test_v2_orchestration_outputs.py ui_tests\test_v2_media_galleries.py ui_tests\test_v2_new_chat_reset.py ui_tests\test_v2_sidebar_conversation_scroll.py ui_tests\test_v2_workflow_saved_output_publication.py ui_tests\test_v2_workflow_run_tracker_spa.py -q: 185 passed
  • Regression checks, each run against code without the fix:
    • The attempt/masking, refused-list and invitation UI tests fail against the first commit's version of the shared store.
    • The background export UI test fails without the export card's report to the drawer.
  • Pre-existing failures, unchanged by this PR:
    • python functional_tests\test_logging_tag_standardization.py fails on existing nonstandard and undocumented tags. The new [CONVERSATION_GENERATED_DOCUMENTS] tag is documented and is not among the failures.
    • 20 older functional tests that read the touched files fail identically on the base commit, compared side by side in a baseline worktree. Causes include version-pin assertions, a lib.GEN_EMAIL import error and test_backend_conversations_swagger_integration.py (3/5 on both).

Documentation

  • Release notes updated, or not needed (not updated in this PR; can follow up with a 0.261.302 entry)
  • Feature documentation updated, or not needed: docs/explanation/features/V2_COLLABORATION_UX.md, plus a new Documents drawer section in docs/reference/chat-controls.md
  • Fix documentation updated, or not needed: docs/explanation/fixes/DOCUMENTS_DRAWER_GENERATED_FILES_FIX.md

Security checklist

  • New Flask routes include @swagger_route(security=get_auth_security()). Both new routes also use @login_required and @user_required, and call _authorize_personal_conversation_read before any read. The list response carries no group ids, and the download only serves a document this conversation produced.
  • Settings sent to non-admin frontends use sanitize_settings_for_user() (no settings are sent by this change)
  • Browser JavaScript is served from local SimpleChat static assets only; no CDN-hosted JS (no new dependencies)
  • No secrets, keys, connection strings, or local-only artifacts are included (build outputs are gitignored)

Paul Lizer (paullizer) and others added 2 commits October 8, 2026 11:42
The drawer's Generated section only ran for shared conversations and only listed
SimpleChat upload documents, so a plan's CSV (and every other rendered file, export
or Analyze summary) was only reachable from its card in the thread.

- Collect the files replies produced from the loaded messages with the thread's own
  readers (plan outputs and committed receipts, exports, analysis files), including
  live run state, with status for files that are not ready yet.
- List SimpleChat upload documents in personal conversations through new owner-only
  /api/conversations/<id>/generated-documents list and download routes.
- Merge both into one Generated section with preview, download and Show in
  conversation, and count them in the header's Documents badge.

Version 0.261.302.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…sees

Review follow-up for the generated files drawer:

- Re-read the agent-document list when the replies the thread shows change (new or
  deleted reply, another attempt shown, a reply masked or unmasked), not only when the
  reply count changes, and list only documents whose reply is shown.
- In a shared conversation, wait until the reader has joined before asking for the list,
  and read it as soon as they join, instead of caching the refusal of a pending invite.
- Never keep a refused or failed read as final, and forget the list when the open
  conversation needs none, so returning to a conversation reads it afresh.
- Regression tests for attempt switching, masking, refusal retry, invitation join,
  conversation return and background export completion.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@paullizer
Paul Lizer (paullizer) merged commit f60b982 into paullizer-react-v2-ui Oct 8, 2026
11 checks passed
Paul Lizer (paullizer) added a commit to paullizer/simplechat that referenced this pull request Oct 8, 2026
…files

Brings in microsoft#1720, which lists every file and agent document a conversation
produced in the V2 Documents drawer, for the replies the thread shows. The
merge had no textual conflicts.

Semantic resolution: this branch hides an orchestration attempt that a later
retry replaced. microsoft#1720's drawer filters only skipped replies replaced by a
workflow reply, so a hidden attempt's files and agent documents would still
be listed. collectConversationGeneratedFiles() and visibleGeneratedDocuments()
now skip replaced attempts too, with a regression case in the drawer logic
test, and this branch's docs and release notes say so.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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