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
3 changes: 3 additions & 0 deletions build/buildfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export const workbenchDesktop = [

export const workbenchWeb = createModuleDescription('vs/workbench/workbench.web.main.internal');

export const sessionsWeb = createModuleDescription('vs/sessions/sessions.web.main.internal');

export const keyboardMaps = [
Comment thread
osortega marked this conversation as resolved.
createModuleDescription('vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.linux'),
createModuleDescription('vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.darwin'),
Expand Down Expand Up @@ -73,6 +75,7 @@ const buildfile = {
workerBackgroundTokenization,
workbenchDesktop,
workbenchWeb,
sessionsWeb,
keyboardMaps,
code,
codeWeb,
Expand Down
1 change: 1 addition & 0 deletions build/gulpfile.vscode.web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ const vscodeWebEntryPoints = [
buildfile.workerBackgroundTokenization,
buildfile.keyboardMaps,
buildfile.workbenchWeb,
buildfile.sessionsWeb,
].flat();

/**
Expand Down
1 change: 1 addition & 0 deletions build/lib/mangle/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ const skippedExportMangledFiles = [
buildfile.workerBackgroundTokenization,
buildfile.workbenchDesktop,
buildfile.workbenchWeb,
Comment thread
rebornix marked this conversation as resolved.
buildfile.sessionsWeb,
buildfile.code,
buildfile.codeWeb
].flat().map(x => x.name),
Expand Down
7 changes: 7 additions & 0 deletions build/next/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ const webEntryPoints = [
'vs/code/browser/workbench/workbench',
];

// Additional web-only entry points (CDN build only, not in server-web)
const webOnlyEntryPoints = [
'vs/sessions/sessions.web.main.internal',
];

const keyboardMapEntryPoints = [
'vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.linux',
'vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.darwin',
Expand Down Expand Up @@ -173,6 +178,7 @@ function getEntryPointsForTarget(target: BuildTarget): string[] {
case 'web':
return [
...workerEntryPoints,
...webOnlyEntryPoints,
'vs/workbench/workbench.web.main.internal', // web workbench only (no browser shell)
...keyboardMapEntryPoints,
];
Expand Down Expand Up @@ -220,6 +226,7 @@ function getCssBundleEntryPointsForTarget(target: BuildTarget): Set<string> {
case 'web':
return new Set([
'vs/workbench/workbench.web.main.internal',
'vs/sessions/sessions.web.main.internal',
]);
default:
throw new Error(`Unknown target: ${target}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
*--------------------------------------------------------------------------------------------*/

import { Disposable, DisposableMap, DisposableStore, toDisposable } from '../../../../base/common/lifecycle.js';
import { isWeb } from '../../../../base/common/platform.js';
import * as nls from '../../../../nls.js';
import { IRemoteAgentHostService, RemoteAgentHostConnectionStatus, RemoteAgentHostsEnabledSettingId } from '../../../../platform/agentHost/common/remoteAgentHostService.js';
import { ITunnelAgentHostService, TUNNEL_ADDRESS_PREFIX, type ITunnelInfo } from '../../../../platform/agentHost/common/tunnelAgentHost.js';
import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';
import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';
import { ILogService } from '../../../../platform/log/common/log.js';
import { INotificationService, Severity } from '../../../../platform/notification/common/notification.js';
import { IWorkbenchContribution, registerWorkbenchContribution2, WorkbenchPhase } from '../../../../workbench/common/contributions.js';
import { IAuthenticationService } from '../../../../workbench/services/authentication/common/authentication.js';
import { ISessionsProvidersService } from '../../../services/sessions/browser/sessionsProvidersService.js';
import { RemoteAgentHostSessionsProvider } from './remoteAgentHostSessionsProvider.js';

Expand All @@ -33,6 +36,8 @@ export class TunnelAgentHostContribution extends Disposable implements IWorkbenc
@IConfigurationService private readonly _configurationService: IConfigurationService,
@IInstantiationService private readonly _instantiationService: IInstantiationService,
@INotificationService private readonly _notificationService: INotificationService,
@ILogService private readonly _logService: ILogService,
@IAuthenticationService private readonly _authenticationService: IAuthenticationService,
) {
super();

Expand All @@ -50,6 +55,15 @@ export class TunnelAgentHostContribution extends Disposable implements IWorkbenc
this._reconcileProviders();
}));

// Re-run discovery when a GitHub session becomes available
// (e.g. after the walkthrough completes sign-in).
this._register(this._authenticationService.onDidChangeSessions(e => {
if (e.providerId === 'github') {
this._logService.info('[TunnelAgentHost] GitHub sessions changed, retrying discovery...');
this._silentStatusCheck();
}
}));

// Silently check status of cached tunnels on startup
this._silentStatusCheck();
}
Expand Down Expand Up @@ -219,6 +233,15 @@ export class TunnelAgentHostContribution extends Disposable implements IWorkbenc
}
}

// Auto-cache online tunnels that aren't cached yet so they
// appear in the UI on first discovery (e.g. fresh web session).
const cachedIds = new Set(cached.map(t => t.tunnelId));
for (const tunnel of onlineTunnels) {
if (!cachedIds.has(tunnel.tunnelId) && tunnel.hostConnectionCount > 0) {
this._tunnelService.cacheTunnel(tunnel);
}
}

// Update online/offline status based on hostConnectionCount.
// For tunnels, Connected means "host is online" (clickable to connect),
// Disconnected means "host is offline". Actual relay connection
Expand All @@ -241,6 +264,23 @@ export class TunnelAgentHostContribution extends Disposable implements IWorkbenc
provider.setConnectionStatus(RemoteAgentHostConnectionStatus.Disconnected);
}
}

// Auto-connect online tunnels that aren't connected yet.
// On web there is no workspace picker to trigger manual connection,
// so we connect eagerly when a tunnel is discovered and online.
if (isWeb) {
for (const tunnel of onlineTunnels) {
if (tunnel.hostConnectionCount > 0) {
const address = `${TUNNEL_ADDRESS_PREFIX}${tunnel.tunnelId}`;
const alreadyConnected = this._remoteAgentHostService.connections.some(
c => c.address === address && c.status === RemoteAgentHostConnectionStatus.Connected
);
if (!alreadyConnected) {
this._connectTunnel(address);
}
}
}
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,17 @@ const EMPTY_FILTER: IStorageSourceFilter = {
sources: [],
};

/**
* Empty descriptor returned when no harness is registered yet.
*/
const EMPTY_DESCRIPTOR: IHarnessDescriptor = {
id: '',
label: '',
icon: Codicon.sparkle,
getStorageSourceFilter: () => ({ sources: [] }),
};


/**
* Hooks filter — local, user, and plugin sources.
*/
Expand Down Expand Up @@ -502,13 +513,19 @@ export class CustomizationHarnessServiceBase implements ICustomizationHarnessSer
getStorageSourceFilter(type: PromptsType): IStorageSourceFilter {
const activeId = this._activeHarness.get();
const all = this._getAllHarnesses();
if (all.length === 0) {
return EMPTY_FILTER;
}
const descriptor = all.find(h => h.id === activeId) ?? all[0];
return descriptor?.getStorageSourceFilter(type) ?? EMPTY_FILTER;
}

getActiveDescriptor(): IHarnessDescriptor {
const activeId = this._activeHarness.get();
const all = this._getAllHarnesses();
if (all.length === 0) {
return EMPTY_DESCRIPTOR;
}
return all.find(h => h.id === activeId) ?? all[0];
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/componentFixtures/blocks-ci-screenshots.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- auto-generated by CI — do not edit manually -->

#### editor/codeEditor/CodeEditor/Dark
![screenshot](https://hediet-screenshots.azurewebsites.net/images/fb6693f7373d126fda52629148610777edb8ae8fec5b9f3d14053d25b86cfd56)
![screenshot](https://hediet-screenshots.azurewebsites.net/images/cb32a3e854b5734fe5aaca2318f2e0a42ee821b05ea97883ea42c5ba95edb3c3)

#### editor/codeEditor/CodeEditor/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/df3ff700f2f8df41b522d37cfdb488e147dfe3ecf9c66a6313375dde493807e2)
![screenshot](https://hediet-screenshots.azurewebsites.net/images/42624fbba5e0db7f32c224b5eb9c5dd3b08245697ae2e7d2a88be0d7c287129b)
Loading