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
50 changes: 34 additions & 16 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 18 additions & 9 deletions src/renderer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,12 @@ <h2 class="sidebar-title">INSTALLED</h2>
<input type="text" id="tools-search-input" class="search-input" placeholder="Search installed tools..." />
<button type="button" class="search-clear-btn" data-clear-target="tools-search-input" aria-label="Clear installed tools search" title="Clear search">&times;</button>
</div>
<button class="search-filter-btn" id="tools-filter-btn" title="Filters and Sort">
<img width="16" height="16" alt="Filter Icon" />
</button>
<div class="filter-btn-group">
<button type="button" class="search-filter-btn" id="tools-filter-btn" aria-label="Open filters and sort" title="Filters and Sort">
<img width="16" height="16" alt="" aria-hidden="true" />
</button>
<button type="button" class="search-filter-btn filter-clear-btn" id="tools-filter-clear-btn" aria-label="Clear active filters" title="Clear active filters" style="display: none">&times;</button>
</div>
</div>
<div class="filter-dropdown" id="tools-filter-dropdown" style="display: none">
<div class="filter-section">
Expand Down Expand Up @@ -115,9 +118,12 @@ <h2 class="sidebar-title">CONNECTIONS</h2>
<input type="text" id="connections-search-input" class="search-input" placeholder="Search connections..." />
<button type="button" class="search-clear-btn" data-clear-target="connections-search-input" aria-label="Clear connections search" title="Clear search">&times;</button>
</div>
<button class="search-filter-btn" id="connections-filter-btn" title="Filters and Sort">
<img width="16" height="16" alt="Filter Icon" />
</button>
<div class="filter-btn-group">
<button class="search-filter-btn" id="connections-filter-btn" title="Filters and Sort" aria-label="Open filters and sort">
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The connections-filter-btn button is missing type="button". While it currently isn’t inside a <form>, the default button type is submit, which can cause accidental form submissions if the markup is refactored later. Add an explicit type="button" for consistency with the other filter buttons.

Suggested change
<button class="search-filter-btn" id="connections-filter-btn" title="Filters and Sort" aria-label="Open filters and sort">
<button type="button" class="search-filter-btn" id="connections-filter-btn" title="Filters and Sort" aria-label="Open filters and sort">

Copilot uses AI. Check for mistakes.
<img width="16" height="16" alt="" aria-hidden="true" />
</button>
<button type="button" class="search-filter-btn filter-clear-btn" id="connections-filter-clear-btn" aria-label="Clear active filters" title="Clear active filters" style="display: none">&times;</button>
</div>
</div>
<div class="filter-dropdown" id="connections-filter-dropdown" style="display: none">
<div class="filter-section">
Expand Down Expand Up @@ -175,9 +181,12 @@ <h2 class="sidebar-title">MARKETPLACE</h2>
<input type="text" id="marketplace-search-input" class="search-input" placeholder="Search tools..." />
<button type="button" class="search-clear-btn" data-clear-target="marketplace-search-input" aria-label="Clear marketplace search" title="Clear search">&times;</button>
</div>
<button class="search-filter-btn" id="marketplace-filter-btn" title="Filters and Sort">
<img width="16" height="16" alt="Filter Icon" />
</button>
<div class="filter-btn-group">
<button class="search-filter-btn" id="marketplace-filter-btn" aria-label="Open marketplace filters and sort options" title="Filters and Sort">
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The marketplace-filter-btn button is missing type="button". Buttons default to submit, which can introduce unintended behavior if this UI ever ends up inside a <form>. Consider adding type="button" to match the other buttons in this toolbar.

Suggested change
<button class="search-filter-btn" id="marketplace-filter-btn" aria-label="Open marketplace filters and sort options" title="Filters and Sort">
<button type="button" class="search-filter-btn" id="marketplace-filter-btn" aria-label="Open marketplace filters and sort options" title="Filters and Sort">

Copilot uses AI. Check for mistakes.
<img width="16" height="16" alt="" aria-hidden="true" />
</button>
<button type="button" class="search-filter-btn filter-clear-btn" id="marketplace-filter-clear-btn" aria-label="Clear active filters" title="Clear active filters" style="display: none">&times;</button>
</div>
</div>
<div class="filter-dropdown" id="marketplace-filter-dropdown" style="display: none">
<div class="filter-section">
Expand Down
38 changes: 38 additions & 0 deletions src/renderer/modules/connectionManagement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1948,6 +1948,17 @@ export async function loadSidebarConnections(): Promise<void> {
// Category filter
const selectedCategory = categoryFilter?.value || "";

// Update filter button indicator and one-click clear button visibility
const hasDropdownFilters = !!(selectedEnvironment || selectedAuthType || selectedCategory);
const connectionsFilterBtn = document.getElementById("connections-filter-btn");
if (connectionsFilterBtn) {
connectionsFilterBtn.classList.toggle("has-active-filters", hasDropdownFilters);
}
const connectionsFilterClearBtn = document.getElementById("connections-filter-clear-btn") as HTMLButtonElement | null;
if (connectionsFilterClearBtn) {
connectionsFilterClearBtn.style.display = hasDropdownFilters ? "flex" : "none";
}

// Apply filters
const filteredConnections = connections.filter((conn: DataverseConnection) => {
// Search filter (name or URL)
Expand Down Expand Up @@ -2241,3 +2252,30 @@ export async function loadSidebarConnections(): Promise<void> {
logError("Failed to load connections", error);
}
}

/**
* Clear only the dropdown filter selections (environment, auth type, category) for connections.
* Leaves the search input unchanged.
*/
export function clearConnectionDropdownFilters(): void {
// Reset environment filter
const environmentFilter = document.getElementById("connections-environment-filter") as HTMLSelectElement | null;
if (environmentFilter) {
environmentFilter.value = "";
}

// Reset auth type filter
const authFilter = document.getElementById("connections-auth-filter") as HTMLSelectElement | null;
if (authFilter) {
authFilter.value = "";
}

// Reset category filter
const categoryFilter = document.getElementById("connections-category-filter") as HTMLSelectElement | null;
if (categoryFilter) {
categoryFilter.value = "";
}

// Reload the connections list to reflect the cleared filters
loadSidebarConnections();
}
2 changes: 2 additions & 0 deletions src/renderer/modules/homepageManagement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import type { LastUsedToolEntry } from "../../common/types";
import { applyToolIconMasks, generateToolIconHtml } from "../utils/toolIconResolver";
import { filterMarketplaceByNew } from "./marketplaceManagement";
import { switchSidebar } from "./sidebarManagement";
import { launchTool, LaunchToolOptions } from "./toolManagement";
import { logError } from "../../common/logger";
Expand Down Expand Up @@ -113,6 +114,7 @@ async function loadNewToolsNotification(): Promise<void> {
notificationBar.style.cursor = "pointer";
notificationBar.onclick = () => {
switchSidebar("marketplace");
filterMarketplaceByNew();
};
} else if (notificationBar) {
notificationBar.style.display = "none";
Expand Down
34 changes: 31 additions & 3 deletions src/renderer/modules/initialization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
import { setupAutoUpdateListeners } from "./autoUpdateManagement";
import { initializeBrowserWindowModals } from "./browserWindowModals";
import {
clearConnectionDropdownFilters,
exportConnections,
handleReauthentication,
importConnections,
Expand All @@ -27,15 +28,15 @@ import {
} from "./connectionManagement";
import { initializeGlobalSearch } from "./globalSearchManagement";
import { loadHomepageData, setupHomepageActions } from "./homepageManagement";
import { handleProtocolInstallToolRequest, loadMarketplace, loadToolsLibrary } from "./marketplaceManagement";
import { clearMarketplaceDropdownFilters, handleProtocolInstallToolRequest, loadMarketplace, loadToolsLibrary } from "./marketplaceManagement";
import { closeModal, openModal } from "./modalManagement";
import { setDefaultNotificationDuration, showPPTBNotification } from "./notifications";
import { openSettingsTab } from "./settingsManagement";
import { switchSidebar } from "./sidebarManagement";
import { handleTerminalClosed, handleTerminalCommandCompleted, handleTerminalCreated, handleTerminalError, handleTerminalOutput, setupTerminalPanel } from "./terminalManagement";
import { applyDebugMenuVisibility, applyTerminalFont, applyTheme } from "./themeManagement";
import { applyAppearanceSettings, closeAllTools, initializeTabScrollButtons, launchTool, restoreSession, setupKeyboardShortcuts, showHomePage } from "./toolManagement";
import { loadSidebarTools } from "./toolsSidebarManagement";
import { clearInstalledToolsDropdownFilters, loadSidebarTools } from "./toolsSidebarManagement";

/**
* Initialize the application
Expand Down Expand Up @@ -819,6 +820,15 @@ function setupFilterDropdownToggles(): void {
});
}

// Tools filter clear button
const toolsFilterClearBtn = document.getElementById("tools-filter-clear-btn");
if (toolsFilterClearBtn) {
toolsFilterClearBtn.addEventListener("click", (e) => {
e.stopPropagation();
clearInstalledToolsDropdownFilters();
});
}

// Connections filter dropdown
const connectionsFilterBtn = document.getElementById("connections-filter-btn");
const connectionsFilterDropdown = document.getElementById("connections-filter-dropdown");
Expand All @@ -840,6 +850,15 @@ function setupFilterDropdownToggles(): void {
});
}

// Connections filter clear button
const connectionsFilterClearBtn = document.getElementById("connections-filter-clear-btn");
if (connectionsFilterClearBtn) {
connectionsFilterClearBtn.addEventListener("click", (e) => {
e.stopPropagation();
clearConnectionDropdownFilters();
});
}

// Marketplace filter dropdown
const marketplaceFilterBtn = document.getElementById("marketplace-filter-btn");
const marketplaceFilterDropdown = document.getElementById("marketplace-filter-dropdown");
Expand All @@ -861,10 +880,19 @@ function setupFilterDropdownToggles(): void {
});
}

// Marketplace filter clear button
const marketplaceFilterClearBtn = document.getElementById("marketplace-filter-clear-btn");
if (marketplaceFilterClearBtn) {
marketplaceFilterClearBtn.addEventListener("click", (e) => {
e.stopPropagation();
clearMarketplaceDropdownFilters();
});
}

// Close dropdowns when clicking outside
document.addEventListener("click", (e) => {
const target = e.target as HTMLElement;
if (!target.closest(".filter-dropdown") && !target.closest(".search-filter-btn")) {
if (!target.closest(".filter-dropdown") && !target.closest(".search-filter-btn") && !target.closest(".filter-clear-btn")) {
document.querySelectorAll(".filter-dropdown").forEach((dropdown) => {
(dropdown as HTMLElement).style.display = "none";
});
Expand Down
Loading
Loading