feat: improve connector popup with grouped OAuth connectors

Active Connectors tab:
- Group OAuth connectors by type (Gmail, Google Drive, etc.)
- Show account count badge on grouped cards
- Show most recent last indexed date across all accounts
- Show non-OAuth connectors individually with active task messages

All Connectors tab:
- Show most recent last indexed date for OAuth connector types
- Check if any account is indexing for OAuth types

Accounts List View:
- Remove document count from individual account cards
- Back button returns to previous tab (not always All Connectors)

General:
- Update handleViewAccountsList to use (connectorType, connectorTitle) signature
- Consistent behavior for viewing accounts from both tabs
This commit is contained in:
CREDO23 2026-01-07 11:40:21 +02:00
parent 9ad1348d6b
commit 3ff87a218d
6 changed files with 193 additions and 93 deletions

View file

@ -679,19 +679,20 @@ export const useConnectorDialog = () => {
// Handle viewing accounts list for OAuth connector type
const handleViewAccountsList = useCallback(
(connector: (typeof OAUTH_CONNECTORS)[number]) => {
(connectorType: string, connectorTitle: string) => {
if (!searchSpaceId) return;
setViewingAccountsType({
connectorType: connector.connectorType,
connectorTitle: connector.title,
connectorType,
connectorTitle,
});
// Update URL to show accounts view
// Update URL to show accounts view, preserving current tab
const url = new URL(window.location.href);
url.searchParams.set("modal", "connectors");
url.searchParams.set("view", "accounts");
url.searchParams.set("connectorType", connector.connectorType);
url.searchParams.set("connectorType", connectorType);
// Keep the current tab in URL so we can go back to it
window.history.pushState({ modal: true }, "", url.toString());
},
[searchSpaceId]
@ -702,7 +703,7 @@ export const useConnectorDialog = () => {
setViewingAccountsType(null);
const url = new URL(window.location.href);
url.searchParams.set("modal", "connectors");
url.searchParams.set("tab", "all");
// Keep the current tab (don't change it) - just remove view-specific params
url.searchParams.delete("view");
url.searchParams.delete("connectorType");
router.replace(url.pathname + url.search, { scroll: false });