mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-25 22:38:56 +08:00
fix(core): artifact rendering issue in standalone ai chat panel (#13166)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Improved chat component to support document link navigation directly from chat messages, allowing users to open documents in the workbench when links are clicked. * **Refactor** * Streamlined notification handling and property access in document composition tools for a cleaner user experience. * Updated import statements for improved code clarity and maintainability. * Enhanced code artifact tool rendering to ensure consistent theming. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -58,7 +58,9 @@ function useCopilotClient() {
|
||||
|
||||
function createMockStd(workspace: Workspace) {
|
||||
workspace.meta.initialize();
|
||||
const store = workspace.createDoc().getStore();
|
||||
// just pick a random doc for now
|
||||
const store = workspace.docs.values().next().value?.getStore();
|
||||
if (!store) return null;
|
||||
const std = new BlockStdScope({
|
||||
store,
|
||||
extensions: [...getViewManager().config.init().value.get('page')],
|
||||
@@ -187,7 +189,7 @@ export const Component = () => {
|
||||
content.session = currentSession;
|
||||
content.workspaceId = workspaceId;
|
||||
content.extensions = specs;
|
||||
content.std = mockStd;
|
||||
content.host = mockStd?.host;
|
||||
content.docDisplayConfig = docDisplayConfig;
|
||||
content.searchMenuConfig = searchMenuConfig;
|
||||
content.networkSearchConfig = networkSearchConfig;
|
||||
|
||||
Reference in New Issue
Block a user