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 @@ -157,10 +157,10 @@ export class AgentSessionsControl extends Disposable implements IAgentSessionsCo
hide(this.emptyFilterMessage);

const span = append(this.emptyFilterMessage, $('span'));
span.textContent = localize('agentSessions.noFilterResults', "No matching sessions.");
span.textContent = `${localize('agentSessions.noFilterResults', "No matching sessions")} - `;

const link = append(this.emptyFilterMessage, $('span.reset-filter-link'));
link.textContent = localize('agentSessions.clearFilters', "Clear Filter");
link.textContent = localize('agentSessions.resetFilter', "Reset Filter");
Comment thread
bpasero marked this conversation as resolved.
link.tabIndex = 0;
link.setAttribute('role', 'button');
this._register(addDisposableListener(link, EventType.CLICK, () => this.options.filter.reset()));
Expand Down Expand Up @@ -235,7 +235,7 @@ export class AgentSessionsControl extends Disposable implements IAgentSessionsCo
}));

this._register(sessionFilter.onDidGetChildren(count => {
this.updateEmptyFilterMessage(count);
this.updateEmpty(count === 0);
}));

const model = this.agentSessionsService.model;
Expand Down Expand Up @@ -287,18 +287,18 @@ export class AgentSessionsControl extends Disposable implements IAgentSessionsCo
}));
}

private updateEmptyFilterMessage(visibleChildren: number): void {
private updateEmpty(isEmpty: boolean): void {
if (!this.emptyFilterMessage || !this.sessionsList) {
return;
}

const model = this.agentSessionsService.model;
const hasSessionsInModel = model.sessions.length > 0;
const hasVisibleChildren = visibleChildren > 0;
const isFilterActive = !this.options.filter.isDefault();

const showMessage = hasSessionsInModel && !hasVisibleChildren && isFilterActive;
setVisibility(showMessage, this.emptyFilterMessage);
const showEmpty = hasSessionsInModel && isEmpty && isFilterActive;
setVisibility(showEmpty, this.emptyFilterMessage);
setVisibility(!showEmpty, this.sessionsList.getHTMLElement());
}

private hasTodaySessions(): boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,6 @@
color: var(--vscode-descriptionForeground);

.reset-filter-link {
margin-left: 4px;
color: var(--vscode-textLink-foreground);
cursor: pointer;
text-decoration: none;
Expand Down
Loading