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
17 changes: 17 additions & 0 deletions src/vs/sessions/contrib/sessions/browser/media/sessionsList.css
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,25 @@
}
}

.monaco-list-row .session-pinned-indicator {
display: none;
height: 16px;
align-items: center;
color: var(--vscode-descriptionForeground);
font-size: 12px;
pointer-events: none;

&.visible {
display: flex;
}
}

.monaco-list-row:hover,
.monaco-list-row.focused:not(.selected) {
.session-pinned-indicator {
display: none;
}

.session-title-toolbar {
display: block;
}
Expand Down
11 changes: 9 additions & 2 deletions src/vs/sessions/contrib/sessions/browser/views/sessionsList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ interface ISessionItemTemplate {
readonly container: HTMLElement;
readonly iconContainer: HTMLElement;
readonly title: HTMLElement;
readonly pinnedIndicator: HTMLElement;
readonly titleToolbar: MenuWorkbenchToolBar;
readonly detailsRow: HTMLElement;
readonly approvalRow: HTMLElement;
Expand Down Expand Up @@ -178,6 +179,7 @@ class SessionItemRenderer implements ITreeRenderer<SessionListItem, FuzzyScore,
const mainCol = DOM.append(container, $('.session-main'));
const titleRow = DOM.append(mainCol, $('.session-title-row'));
const title = DOM.append(titleRow, $('.session-title'));
const pinnedIndicator = DOM.append(titleRow, $('.session-pinned-indicator'));
const titleToolbarContainer = DOM.append(titleRow, $('.session-title-toolbar'));
const detailsRow = DOM.append(mainCol, $('.session-details-row'));

Expand All @@ -192,7 +194,7 @@ class SessionItemRenderer implements ITreeRenderer<SessionListItem, FuzzyScore,
menuOptions: { shouldForwardArgs: true },
}));

return { container, iconContainer, title, titleToolbar, detailsRow, approvalRow, approvalLabel, approvalButtonContainer, contextKeyService, disposables, elementDisposables };
return { container, iconContainer, title, pinnedIndicator, titleToolbar, detailsRow, approvalRow, approvalLabel, approvalButtonContainer, contextKeyService, disposables, elementDisposables };
}

renderElement(node: ITreeNode<SessionListItem, FuzzyScore>, _index: number, template: ISessionItemTemplate): void {
Expand All @@ -210,8 +212,13 @@ class SessionItemRenderer implements ITreeRenderer<SessionListItem, FuzzyScore,
template.titleToolbar.context = element;

// Context key: isPinned
IsSessionPinnedContext.bindTo(template.contextKeyService).set(this.options.isPinned(element));
const isPinned = this.options.isPinned(element);
IsSessionPinnedContext.bindTo(template.contextKeyService).set(isPinned);
IsSessionArchivedContext.bindTo(template.contextKeyService).set(element.isArchived.get());

// Pinned indicator — inline pin icon, hidden on hover when toolbar shows
template.pinnedIndicator.className = 'session-pinned-indicator ' + ThemeIcon.asClassName(Codicon.pinned);
template.pinnedIndicator.classList.toggle('visible', isPinned);
IsSessionReadContext.bindTo(template.contextKeyService).set(element.isRead.get());

// Archived styling — reactive
Expand Down
Loading