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
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { ISessionSyncStateService, type SessionSyncState } from '../common/sessi

const statusTitle = l10n.t('Session Sync');
const sessionSyncDocsLink = 'https://aka.ms/vscode-copilot-session-sync';
const sessionsOnGitHubLink = 'https://github.com/copilot/agents';

/**
* Shows session sync status in the chat status bar popup.
Expand Down Expand Up @@ -94,9 +95,9 @@ export class SessionSyncStatus extends Disposable {
break;

case 'up-to-date':
this._statusItem.description = `$(check) ${l10n.t('{0} sessions synced', state.syncedCount)}`;
this._statusItem.description = `$(check) [${l10n.t('{0} sessions synced', state.syncedCount)}](${sessionsOnGitHubLink})`;
this._statusItem.detail = `[${l10n.t('Show insights?')}](command:workbench.action.chat.open?%7B%22query%22%3A%22%2Fchronicle%3Atips%22%7D)`;
this._statusItem.tooltip = l10n.t('Your sessions are being synced and available across devices.');
this._statusItem.tooltip = l10n.t('Your sessions are being synced and available across devices. Click to view them on GitHub.');
break;

case 'syncing':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ export class QuickFixesProvider implements vscode.CodeActionProvider {
}

private provideAltTextQuickFix(document: vscode.TextDocument, range: vscode.Range): ImageCodeAction | undefined {
if (range.start.line < 0 || range.start.line >= document.lineCount) {
return;
}
const currentLine = document.lineAt(range.start.line).text;
const generateImagePath = extractImageAttributes(currentLine);
const refineImagePath = extractImageAttributes(currentLine, true);
Expand Down
3 changes: 2 additions & 1 deletion src/vs/platform/log/electron-main/logIpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ export class LoggerChannel extends Disposable implements IServerChannel {
private log(file: URI, messages: [LogLevel, string][]): void {
const logger = this.loggers.get(file);
if (!logger) {
throw new Error('Create the logger before logging');
// Logger may have been removed while IPC messages were still in flight
return;
}
for (const [level, message] of messages) {
log(logger, level, message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,12 @@ export function buildCollectionArgs(
* Builds the single-image arguments for the carousel command.
*/
export function buildSingleImageArgs(resource: URI, data: Uint8Array): ICarouselSingleImageArgs {
const name = resource.path.split('/').pop() ?? 'image';
let name = resource.path.split('/').pop() ?? 'image';
try {
name = decodeURIComponent(name);
} catch {
// keep raw segment if it isn't valid percent-encoding
}
const mimeType = getMediaMime(resource.path) ?? getMediaMime(name) ?? 'image/png';
return { name, mimeType, data, title: name };
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,13 @@ export class ChatStatusDashboard extends DomWidget {

// Status text (right-aligned via margin-left: auto)
const statusEl = header.appendChild($('span.collapsible-status'));
statusEl.append(...renderLabelWithIcons(item.description));
const statusDisposables = this._store.add(new MutableDisposable<DisposableStore>());
const renderStatus = (text: string): void => {
const newStore = new DisposableStore();
statusDisposables.value = newStore;
this.renderTextPlus(statusEl, text, newStore);
};
renderStatus(item.description);

// Show tooltip on hover of the status text
let currentTooltip = item.tooltip;
Expand All @@ -486,7 +492,7 @@ export class ChatStatusDashboard extends DomWidget {
if (e.entry.id === item.id) {
// Update status in header
statusEl.textContent = '';
statusEl.append(...renderLabelWithIcons(e.entry.description));
renderStatus(e.entry.description);
currentTooltip = e.entry.tooltip;

// Update mutable hover content references
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,17 @@ suite('ChatImageCarouselService helpers', () => {
const data = new Uint8Array([1]);
assert.strictEqual(buildSingleImageArgs(uri, data).mimeType, 'image/png');
});

test('decodes percent-encoded filename for display', () => {
const uri = URI.file('/path/to/Element%20Screenshot.png');
const data = new Uint8Array([1, 2, 3]);
assert.deepStrictEqual(buildSingleImageArgs(uri, data), {
name: 'Element Screenshot.png',
mimeType: 'image/png',
data,
title: 'Element Screenshot.png',
});
});
});

suite('collectCarouselSections', () => {
Expand Down
Loading