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 @@ -277,14 +277,6 @@ export class InlineAnchorWidget extends Disposable {
const relativeLabel = labelService.getUriLabel(location.uri, { relative: true });
this._register(hoverService.setupManagedHover(getDefaultHoverDelegate('element'), element, relativeLabel));

// Apply link-style if configured
this.updateAppearance();
this._register(this.configurationService.onDidChangeConfiguration(e => {
if (e.affectsConfiguration(ChatConfiguration.InlineReferencesStyle)) {
this.updateAppearance();
}
}));

// Drag and drop
if (this.data.kind !== 'symbol') {
element.draggable = true;
Expand Down Expand Up @@ -321,12 +313,6 @@ export class InlineAnchorWidget extends Disposable {
return this.element;
}

private updateAppearance(): void {
const style = this.configurationService.getValue<string>(ChatConfiguration.InlineReferencesStyle);
const useLinkStyle = style === 'link';
this.element.classList.toggle('link-style', useLinkStyle);
}

private getCellIndex(location: URI) {
const notebook = this.notebookDocumentService.getNotebook(location);
const index = notebook?.getCellIndex(location) ?? -1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,25 +60,25 @@
flex-shrink: 0;
}

/* Link-style appearance - no box, no icon */
.chat-inline-anchor-widget.link-style,
.interactive-item-container .value .rendered-markdown .chat-inline-anchor-widget.link-style {
/* Link-style appearance - no box, no icon (controlled by parent container class) */
.chat-inline-references-link-style .chat-inline-anchor-widget,
.chat-inline-references-link-style .interactive-item-container .value .rendered-markdown .chat-inline-anchor-widget {
border: none;
background-color: transparent;
padding: 0;
margin: 0;
color: var(--vscode-textLink-foreground);
}

.chat-inline-anchor-widget.link-style:hover {
.chat-inline-references-link-style .chat-inline-anchor-widget:hover {
background-color: transparent;
text-decoration: underline;
}

.chat-inline-anchor-widget.link-style .icon {
.chat-inline-references-link-style .chat-inline-anchor-widget .icon {
display: none;
}

.chat-inline-anchor-widget.link-style .icon-label {
.chat-inline-references-link-style .chat-inline-anchor-widget .icon-label {
padding: 0;
}
12 changes: 12 additions & 0 deletions src/vs/workbench/contrib/chat/browser/widget/chatListWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,18 @@ export class ChatListWidget extends Disposable {
this._lastItemIdContextKey = ChatContextKeys.lastItemId.bindTo(this.contextKeyService);
this._container = container;

// Toggle link-style for inline reference widgets based on configuration (single listener for all widgets)
const updateInlineReferencesStyle = () => {
const style = this.configurationService.getValue<string>(ChatConfiguration.InlineReferencesStyle);
this._container.classList.toggle('chat-inline-references-link-style', style === 'link');
};
updateInlineReferencesStyle();
this._register(this.configurationService.onDidChangeConfiguration(e => {
if (e.affectsConfiguration(ChatConfiguration.InlineReferencesStyle)) {
updateInlineReferencesStyle();
}
}));

const scopedInstantiationService = this._register(this.instantiationService.createChild(
new ServiceCollection([IContextKeyService, this.contextKeyService])
));
Expand Down
Loading