#### PR Dependency Tree
* **PR #14258** 👈
This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
## Release Notes
* **Removed Features**
* Web search functionality has been removed from AI chat and related AI
features. Users will no longer see network search options or toggles in
chat preferences and panels.
* AI chat requests no longer support external web search capabilities.
<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
#### PR Dependency Tree
* **PR #14258** 👈
* **PR #14259**
This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Copilot now defaults to the updated Claude Sonnet 4.5 model across
experiences for improved responses.
* **Chores**
* Consolidated available Anthropic models, removing older Sonnet 3.x
variants and standardizing Sonnet 4/4.5 options.
* Updated configuration defaults and schema mappings to reference the
new Sonnet 4.5 model.
* **Tests**
* Updated unit and end-to-end tests to reference the new model to ensure
consistent behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Style**
* Simplified the AI chat composer tip: removed the dynamic
embedding-status tooltip so only a single static caution remains — “AI
outputs can be misleading or wrong.”
* **Tests**
* One end-to-end test related to embedding status was commented out and
is no longer executed.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Tests**
* Improved test reliability by automatically cleaning up workspace
snapshots during embedding status checks in end-to-end tests.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Close [AI-407](https://linear.app/affine-design/issue/AI-407)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Ensured that images included in the chat context are now properly sent
as attachments during AI chat interactions.
* **Tests**
* Enhanced chat tests to verify that the AI correctly identifies images
of kittens or cats in its responses.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
> CLOSE AF-2774
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Tests**
* Updated translation tests to use Simplified Chinese instead of German
as the target language.
* Adjusted expected results in assertions to match Chinese characters
"苹果" instead of the German word "Apfel" across relevant test cases.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Close [AI-395](https://linear.app/affine-design/issue/AI-395)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved chat stability by resetting chat action signals after
processing to prevent repeated triggers.
* **New Features**
* Added end-to-end tests for new chat session creation and chat pinning
functionality to enhance reliability.
* **Enhancements**
* Enhanced chat toolbar with test identifiers and pinned state
attributes for better accessibility and testing.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: fengmk2 <fengmk2@gmail.com>
> CLOSE AF-2773
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Tests**
* Updated AI chat translation tests to use Simplified Chinese instead of
German, adjusting expected results and assertions accordingly.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
fix AI-367
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved document filtering to exclude settings documents and empty
blobs from embedding and status calculations.
* Enhanced embedding jobs to skip processing deprecated documents if a
newer version exists, ensuring only up-to-date documents are embedded.
* **New Features**
* Added a mutation to trigger the cron job for generating missing
titles.
* **Tests**
* Added test to verify exclusion of documents with empty content from
embedding.
* Updated embedding-related tests to toggle embedding state during
attachment upload under simulated network conditions.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Close [AI-351](https://linear.app/affine-design/issue/AI-351)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Disabled action updates related to document IDs and sessions in the AI
chat content panel.
* **Tests**
* Skipped all end-to-end tests for the "should show chat history in chat
panel" scenario across various AI action test suites. These tests will
no longer run during automated testing.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Tests**
* Temporarily skipped tests related to chatting with tags and specified
documents due to flakiness.
* Improved chat retry test by streamlining status checks for faster
validation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Close [AI-301](https://linear.app/affine-design/issue/AI-301)
<img width="571" height="204" alt="截屏2025-07-11 17 33 01"
src="https://github.com/user-attachments/assets/3b7ed81f-1137-4c01-8fe2-9fe5ebf2adf3"
/>
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Introduced a new component for adding context (images, documents,
tags, collections) to AI chat via a plus button and popover menu.
* Added notification feedback for duplicate chip additions and image
upload limits.
* Chips panel now supports collapsing and expanding for improved UI
control.
* **Improvements**
* Refactored chip management for better error handling, feedback, and
external control.
* Streamlined image and document uploads through a unified menu-driven
interface.
* Enhanced chip management methods with clearer naming and robust
synchronization.
* Updated chat input to delegate image upload and context additions to
the new add-context component.
* **Bug Fixes**
* Improved cancellation and cleanup of ongoing chip addition operations
to prevent conflicts.
* **Tests**
* Updated end-to-end tests to reflect the new menu-driven image upload
workflow and removed legacy checks.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: fengmk2 <fengmk2@gmail.com>
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Tests**
* Removed the test verifying the scroll indicator appears when there are
many chat messages.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Close [AI-260](https://linear.app/affine-design/issue/AI-260)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Added theme support to AI chat and message components, enabling
dynamic theming based on the current app theme.
* Introduced a reactive theme signal to the theme service for improved
theme handling.
* Integrated notification and theme services across various AI chat,
playground, and message components for consistent user experience.
* **Refactor**
* Simplified component APIs by removing dependencies on editor host and
related properties across AI chat, message, and tool components.
* Centralized and streamlined clipboard and markdown conversion
utilities, reducing external dependencies.
* Standardized the interface for context file addition and improved type
usage for better consistency.
* Reworked notification service to a class-based implementation for
improved encapsulation.
* Updated AI chat components to use injected notification and theme
services instead of host-based retrieval.
* **Bug Fixes**
* Improved reliability of copy and notification actions by decoupling
them from editor host dependencies.
* **Chores**
* Updated and cleaned up internal imports and removed unused properties
to enhance maintainability.
* Added test IDs for sidebar close button to improve test reliability.
* Updated test prompts in end-to-end tests for consistency.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
fix AI-121
fix AI-118
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **Bug Fixes**
- Improved handling of connection closures and request abortion for
streaming and non-streaming chat endpoints, ensuring session data is
saved appropriately even if the connection is interrupted.
- **Refactor**
- Streamlined internal logic for managing request signals and connection
events, resulting in more robust and explicit session management during
streaming interactions.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Close [AI-259](https://linear.app/affine-design/issue/AI-259)
Close [AI-243](https://linear.app/affine-design/issue/AI-243)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Introduced a unified AI chat content component to manage and display
chat interactions.
* Added new chat block message components for improved chat message
rendering.
* **Refactor**
* Simplified and unified session management across all AI chat
components, now passing full session objects instead of session IDs.
* Updated component and property names for clarity and consistency
(e.g., chat message and block message components).
* Consolidated chat history and actions retrieval for a more streamlined
chat experience.
* Removed redundant session ID getters and replaced them with direct
session object usage.
* Streamlined chat panel and composer components by removing internal
message and context state management.
* **Bug Fixes**
* Improved handling of chat session state and loading, reducing
redundant state properties.
* Enhanced event handling to prevent errors when chat parameters are
missing.
* **Tests**
* Removed outdated chat clearing test cases to align with new chat state
management.
* **Chores**
* Updated import paths and reorganized module exports for better
maintainability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
> CLOSE BS-3582
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Added a "Check status" button in the AI chat interface that opens the
embedding settings panel for improved user access.
- **Refactor**
- Simplified the embedding status tooltip to display static information
and a direct link to settings, removing dynamic progress updates.
- Integrated workspace dialog service across AI chat components for
consistent dialog management.
- **Tests**
- Updated end-to-end tests to verify that clicking the "Check status"
button opens the embedding settings panel.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Style**
* Improved visual styling and cursor behavior for chat input send, stop,
and preference trigger buttons.
* Enhanced appearance and interactivity cues for the chat input
preference trigger.
* **Refactor**
* Simplified image preview grid by using CSS hover states for close
button visibility and switching to background images for previews.
* Streamlined image deletion process for a more intuitive user
experience.
* **Tests**
* Updated image upload test to wait for image container elements,
improving test reliability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Refactor**
* Replaced the boolean flag for selecting AI workflow endpoints with a
clear and flexible enum, enhancing clarity and maintainability for
AI-powered features.
* **Tests**
* Simplified example text in AI action tests to improve consistency.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: DarkSky <25152247+darkskygit@users.noreply.github.com>
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Added support for image uploads in the chat panel, including upload
limits and user feedback when limits are exceeded.
- Introduced a unified chat input preference menu for selecting AI
models, toggling extended thinking, and enabling web search.
- Menu buttons and menus now support test identifiers for improved
testing.
- **Improvements**
- Updated chat input UI with enhanced styling, consolidated controls,
and simplified feature toggling.
- Improved layout and spacing for chat chips and image preview grids.
- Chat abort icon now adapts to the current color theme.
- **Refactor**
- Replaced the separate AI model selection component with the new chat
input preference menu.
- Streamlined imports and custom element registrations for chat input
preferences.
- **Tests**
- Enhanced test utilities to support the new chat input preference menu
interactions.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **New Features**
- Added real-time embedding status tracking and progress messages to the AI chat composer, with automatic updates every 10 seconds.
- **Refactor**
- Simplified the embedding status tooltip to display a static message, removing dynamic status updates and hover-based refresh.
- **Tests**
- Enhanced embedding status tooltip test by creating sample documents and extending visibility timeout to 50 seconds.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Support [AI-59](https://linear.app/affine-design/issue/AI-59)
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **New Features**
- Updated the default AI model for chat prompts to use Claude Sonnet 4.
- **Bug Fixes**
- Improved model selection logic to better support reasoning features across more AI models.
- **Tests**
- Enhanced test cases with consistent instructions for response length.
- Skipped certain chat-related tests to refine test suite stability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **Tests**
- Improved test stability by handling potential errors during embedding progress checks in end-to-end tests.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## TL;DR
Workspace embedding settings opt:
* **local workspace**: show enable cloud panel
* **no-access workspace**: disable settings panel


> CLOSE AI-155
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **New Features**
- Embedding settings UI now displays a tooltip indicating that only workspace owners can enable Workspace Embedding.
- Embedding settings are modularized for local and cloud workspaces, with clear separation and appropriate enablement controls.
- Attachments in embedding settings cannot be deleted when the settings are disabled.
- **Accessibility**
- Settings wrapper now includes an aria-disabled attribute for improved assistive technology support.
- **Localization**
- Added a new tooltip message: "Only the workspace owner can enable Workspace Embedding."
- **Tests**
- Added end-to-end tests for local workspace UI and disabled state when not the workspace owner.
- **UI Improvements**
- Updated settings panel to better reflect disabled states with tooltips and conditional controls.
- Improved synchronization when opening the embedding settings panel for a smoother user experience.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
### TL;DR
fix: in edgeless mode, an error occurs when asking AI questions without selecting any content
> CLOSE AI-133
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **New Features**
- Added support for asking AI input in edgeless mode when no content is selected.
- Enhanced AI panel behavior with improved input handling and chat message sending in edgeless mode.
- **Bug Fixes**
- Improved handling of AI chat input visibility and context extraction in edgeless mode.
- **Tests**
- Introduced new end-to-end tests to verify chat interactions with AI in edgeless mode.
- Centralized editor content removal logic in test utilities for better maintainability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
### TL;DR
feat: optimize workspace attachment uploading & error display

### What Changes
####
Support for Workspace Attachment Uploading & Error Handling
* Added support for three attachment states: uploading (local), upload failed (local error), and uploaded (persisted). The frontend UI now displays real-time upload progress and error messages.
* Attachments that fail to upload can be deleted directly without confirmation.
* Merged display of uploading and uploaded attachments for a smoother user experience.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **New Features**
- Attachments now show real-time upload status including uploading, error, and uploaded states.
- Users can remove failed (error) attachments instantly without confirmation.
- Attachment list merges uploading and uploaded files, displaying up to 10 items.
- **Bug Fixes**
- Improved error handling and messaging for failed attachment uploads.
- **Style**
- Enhanced visual styling for error attachments with distinct colors and backgrounds.
- **Tests**
- Added tests simulating slow network uploads, upload failures, and direct removal of error attachments.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
### TL;DR
* refactor: use horizontal scrolling to display images
* refactor: change max images to 9
* test: add test cases for validating the maximum number of uploadable images
> CLOSE AI-6

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **New Features**
- Added a notification to inform users when attempting to upload more images than allowed in the AI chat input.
- **Bug Fixes**
- Prevented uploading more than 9 images at once in the AI chat input.
- **Style**
- Improved image preview grid layout to display images in a single horizontally scrollable row.
- **Tests**
- Added an end-to-end test to verify that an error message appears when too many images are uploaded.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
### TL;DR
feat: show embedding progress in settings panel

### What changed
* show embedding progress in settings panel
* polling embedding status based on RxJS
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **New Features**
- Added real-time embedding progress tracking and display in embedding settings, including a visual progress bar and status messages.
- Introduced localized text for embedding progress statuses.
- Added an optional test ID attribute to the progress bar component for improved testing.
- **Style**
- Added new styles for embedding progress UI elements.
- **Tests**
- Added an end-to-end test to verify embedding progress is displayed correctly in the settings UI.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **Chores**
- Updated Playwright test configurations to use full URL strings instead of port numbers for web server identification.
- Unified server startup approach in test environments by integrating web server configuration directly into Playwright, replacing custom setup scripts.
- Removed obsolete development server setup files to streamline test initialization.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
### TL;DR
refactor: rename settings, indexer embedding -> embedding
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **Refactor**
- Unified naming in workspace settings from "Indexer & Embedding" to "Embedding" for improved clarity.
- Updated sidebar labels, tab keys, and test IDs to reflect the new naming convention.
- Streamlined the layout and organization of the embedding settings interface for a more consistent user experience.
- Simplified the export and component structure for embedding settings.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
### TL;DR
feat: display embedding tip for ai chat

> CLOSE BS-3051
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **New Features**
- Introduced an embedding status tooltip in the AI chat interface, providing real-time feedback on embedding progress for your workspace.
- Added support for embedding status tracking within the AI provider and client services.
- **Style**
- Updated the AI chat footer layout for improved clarity and usability.
- **Tests**
- Added an end-to-end test to ensure the embedding status tooltip displays correctly.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
fix AI-127
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **New Features**
- Added automated event handling for workspace updates and document embedding, streamlining document embedding workflows.
- Introduced detection and queuing of documents needing embedding, excluding ignored documents.
- **Improvements**
- Enhanced performance of embedding-related searches by filtering results at the database level.
- Increased concurrency for embedding job processing to improve throughput.
- **Bug Fixes**
- Improved error handling and fallback for missing document titles during embedding.
- Added safeguards to skip invalid embedding jobs based on document identifiers.
- **Tests**
- Expanded test coverage for document embedding and ignored document filtering.
- Updated end-to-end tests to use dynamic content for improved reliability.
- Added synchronization waits in document creation utilities to improve test stability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **New Features**
- Introduced "Indexer & Embedding" workspace settings to manage AI embedding for local content, including document ignoring and attachment uploads.
- Added UI components for embedding settings, attachments, and ignored documents with pagination and deletion capabilities.
- Provided comprehensive file-type icons for attachments.
- **Improvements**
- Added a new tab for indexing and embedding in workspace settings navigation.
- Included test identifiers on key UI elements to enhance automated testing.
- **Localization**
- Added English localization strings covering all embedding-related UI text and actions.
- **Bug Fixes**
- Enabled previously skipped end-to-end tests for embedding settings to improve reliability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
### TL;DR
tests: workspace embedding e2e
> CLOSE BS-3052
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **New Features**
- Introduced comprehensive end-to-end tests for workspace embedding settings, including toggling embedding, uploading and managing attachments, pagination, and ignoring documents.
- Added utilities for automated interaction with the settings panel and document creation in tests.
- **Tests**
- Implemented detailed scenarios to verify workspace embedding functionality and user interactions within the settings panel.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
### TL;DR
feat: show stop model if click-outside during ai generating
>CLOSE AI-89
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **New Features**
- Added a confirmation dialog when attempting to stop AI content generation by clicking outside the panel, ensuring users can confirm or cancel the stop action.
- **Tests**
- Introduced an end-to-end test to verify the confirmation dialog appears and AI generation stops as expected when clicking outside during generation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **Tests**
- Updated test assertions to use case-insensitive matching for verifying displayed text, improving test reliability across different text casing scenarios.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
> Close AF-2616