Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/vs/base/browser/touch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,24 @@ export class Gesture extends Disposable {
return toDisposable(remove);
}

/**
* Whether the device is able to represent touch events.
*/
@memoize
static isTouchDevice(): boolean {
// `'ontouchstart' in window` always evaluates to true with typescript's modern typings. This causes `window` to be
// `never` later in `window.navigator`. That's why we need the explicit `window as Window` cast
return 'ontouchstart' in mainWindow || navigator.maxTouchPoints > 0;
}

/**
* Whether the device's primary input is able to hover.
*/
@memoize
static isHoverDevice(): boolean {
return mainWindow.matchMedia('(hover: hover)').matches;
}

public override dispose(): void {
if (this.handle) {
this.handle.dispose();
Expand Down
1 change: 1 addition & 0 deletions src/vs/platform/mcp/common/mcpManagement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ export const mcpAccessConfig = 'chat.mcp.access';
export const mcpGalleryServiceUrlConfig = 'chat.mcp.gallery.serviceUrl';
export const mcpGalleryServiceEnablementConfig = 'chat.mcp.gallery.enabled';
export const mcpAutoStartConfig = 'chat.mcp.autostart';
export const mcpAppsEnabledConfig = 'chat.mcp.apps.enabled';

export interface IMcpGalleryConfig {
readonly serviceUrl?: string;
Expand Down
8 changes: 7 additions & 1 deletion src/vs/workbench/contrib/chat/browser/chat.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { Extensions as ConfigurationExtensions, ConfigurationScope, IConfigurati
import { SyncDescriptor } from '../../../../platform/instantiation/common/descriptors.js';
import { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js';
import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';
import { McpAccessValue, McpAutoStartValue, mcpAccessConfig, mcpAutoStartConfig, mcpGalleryServiceEnablementConfig, mcpGalleryServiceUrlConfig } from '../../../../platform/mcp/common/mcpManagement.js';
import { McpAccessValue, McpAutoStartValue, mcpAccessConfig, mcpAutoStartConfig, mcpGalleryServiceEnablementConfig, mcpGalleryServiceUrlConfig, mcpAppsEnabledConfig } from '../../../../platform/mcp/common/mcpManagement.js';
import product from '../../../../platform/product/common/product.js';
import { Registry } from '../../../../platform/registry/common/platform.js';
import { EditorPaneDescriptor, IEditorPaneRegistry } from '../../../browser/editor.js';
Expand Down Expand Up @@ -465,6 +465,12 @@ configurationRegistry.registerConfiguration({
],
tags: ['experimental'],
},
[mcpAppsEnabledConfig]: {
type: 'boolean',
description: nls.localize('chat.mcp.ui.enabled', "Controls whether MCP servers can provide custom UI for tool invocations."),
default: false,
tags: ['experimental'],
},
[mcpServerSamplingSection]: {
type: 'object',
description: nls.localize('chat.mcp.serverSampling', "Configures which models are exposed to MCP servers for sampling (making model requests in the background). This setting can be edited in a graphical way under the `{0}` command.", 'MCP: ' + nls.localize('mcp.list', 'List Servers')),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ export interface IChatContentPart extends IDisposable {
*/
hasSameContent(other: IChatRendererContent, followingContent: IChatRendererContent[], element: ChatTreeItem): boolean;

/**
* Called when the content part is mounted to the DOM after being detached
* due to virtualization.
*/
onDidRemount?(): void;

addDisposable?(disposable: IDisposable): void;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class ChatInputOutputMarkdownProgressPart extends BaseChatToolInvocationS
this.getAutoApproveMessageContent(),
context,
toCodePart(input),
processedOutput && {
processedOutput && processedOutput.length > 0 ? {
parts: processedOutput.map((o, i): ChatCollapsibleIOPart => {
const permalinkBasename = o.type === 'ref' || o.uri
? basename(o.uri!)
Expand Down Expand Up @@ -124,7 +124,7 @@ export class ChatInputOutputMarkdownProgressPart extends BaseChatToolInvocationS
return { kind: 'data', value: decoded || new TextEncoder().encode(o.value), mimeType: o.mimeType, uri: permalinkUri, audience: o.audience };
}
}),
},
} : undefined,
isError,
ChatInputOutputMarkdownProgressPart._expandedByDefault.get(toolInvocation) ?? false,
));
Expand Down
Loading
Loading