mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-10 22:32:16 +02:00
feat(rename): complete searchSpace to workspace transition across frontend and backend
- Introduced a comprehensive specification for renaming `searchSpace` to `workspace` in `surfsense_web` and `surfsense_desktop`, ensuring all TypeScript identifiers, React props, and local data structures are updated. - Implemented migration shims for persisted local state to prevent data loss during the transition. - Updated observability metrics and IPC channels to reflect the new naming convention. - Removed legacy `active-search-space` module and replaced it with `active-workspace` to maintain consistency. - Ensured no behavioral changes or data loss for users during the renaming process.
This commit is contained in:
parent
2a020629c5
commit
a8c1fb660d
259 changed files with 5480 additions and 2285 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import type { GetConnectorsRequest } from "@/contracts/types/connector.types";
|
||||
import type { GetDocumentsRequest } from "@/contracts/types/document.types";
|
||||
import type { GetLogsRequest } from "@/contracts/types/log.types";
|
||||
import type { GetSearchSpacesRequest } from "@/contracts/types/workspace.types";
|
||||
import type { GetWorkspacesRequest } from "@/contracts/types/workspace.types";
|
||||
|
||||
/**
|
||||
* Convert an object to a stable array of [key, value] pairs sorted by key.
|
||||
|
|
@ -30,51 +30,51 @@ export const cacheKeys = {
|
|||
document: (documentId: string) => ["document", documentId] as const,
|
||||
},
|
||||
logs: {
|
||||
list: (searchSpaceId?: number | string) => ["logs", "list", searchSpaceId] as const,
|
||||
list: (workspaceId?: number | string) => ["logs", "list", workspaceId] as const,
|
||||
detail: (logId: number | string) => ["logs", "detail", logId] as const,
|
||||
summary: (searchSpaceId?: number | string) => ["logs", "summary", searchSpaceId] as const,
|
||||
summary: (workspaceId?: number | string) => ["logs", "summary", workspaceId] as const,
|
||||
withQueryParams: (queries: GetLogsRequest["queryParams"]) =>
|
||||
["logs", "with-query-params", ...stableEntries(queries)] as const,
|
||||
},
|
||||
modelConnections: {
|
||||
all: (searchSpaceId: number) => ["model-connections", searchSpaceId] as const,
|
||||
all: (workspaceId: number) => ["model-connections", workspaceId] as const,
|
||||
global: () => ["model-connections", "global"] as const,
|
||||
globalConfigStatus: () => ["model-connections", "global-config-status"] as const,
|
||||
providers: () => ["model-connections", "providers"] as const,
|
||||
roles: (searchSpaceId: number) => ["model-roles", searchSpaceId] as const,
|
||||
roles: (workspaceId: number) => ["model-roles", workspaceId] as const,
|
||||
},
|
||||
auth: {
|
||||
user: ["auth", "user"] as const,
|
||||
},
|
||||
searchSpaces: {
|
||||
all: ["search-spaces"] as const,
|
||||
withQueryParams: (queries: GetSearchSpacesRequest["queryParams"]) =>
|
||||
["search-spaces", ...stableEntries(queries)] as const,
|
||||
detail: (searchSpaceId: string) => ["search-spaces", searchSpaceId] as const,
|
||||
workspaces: {
|
||||
all: ["workspaces"] as const,
|
||||
withQueryParams: (queries: GetWorkspacesRequest["queryParams"]) =>
|
||||
["workspaces", ...stableEntries(queries)] as const,
|
||||
detail: (workspaceId: string) => ["workspaces", workspaceId] as const,
|
||||
},
|
||||
user: {
|
||||
current: () => ["user", "me"] as const,
|
||||
},
|
||||
roles: {
|
||||
all: (searchSpaceId: string) => ["roles", searchSpaceId] as const,
|
||||
byId: (searchSpaceId: string, roleId: string) => ["roles", searchSpaceId, roleId] as const,
|
||||
all: (workspaceId: string) => ["roles", workspaceId] as const,
|
||||
byId: (workspaceId: string, roleId: string) => ["roles", workspaceId, roleId] as const,
|
||||
},
|
||||
permissions: {
|
||||
all: () => ["permissions"] as const,
|
||||
},
|
||||
members: {
|
||||
all: (searchSpaceId: string) => ["members", searchSpaceId] as const,
|
||||
myAccess: (searchSpaceId: string) => ["members", "my-access", searchSpaceId] as const,
|
||||
all: (workspaceId: string) => ["members", workspaceId] as const,
|
||||
myAccess: (workspaceId: string) => ["members", "my-access", workspaceId] as const,
|
||||
},
|
||||
invites: {
|
||||
all: (searchSpaceId: string) => ["invites", searchSpaceId] as const,
|
||||
all: (workspaceId: string) => ["invites", workspaceId] as const,
|
||||
info: (inviteCode: string) => ["invites", "info", inviteCode] as const,
|
||||
},
|
||||
agentTools: {
|
||||
all: () => ["agent-tools"] as const,
|
||||
},
|
||||
connectors: {
|
||||
all: (searchSpaceId: string) => ["connectors", searchSpaceId] as const,
|
||||
all: (workspaceId: string) => ["connectors", workspaceId] as const,
|
||||
withQueryParams: (queries: GetConnectorsRequest["queryParams"]) =>
|
||||
["connectors", ...stableEntries(queries)] as const,
|
||||
byId: (connectorId: string) => ["connector", connectorId] as const,
|
||||
|
|
@ -96,31 +96,31 @@ export const cacheKeys = {
|
|||
},
|
||||
publicChatSnapshots: {
|
||||
all: ["public-chat-snapshots"] as const,
|
||||
bySearchSpace: (searchSpaceId: number) =>
|
||||
["public-chat-snapshots", "search-space", searchSpaceId] as const,
|
||||
byWorkspace: (workspaceId: number) =>
|
||||
["public-chat-snapshots", "workspace", workspaceId] as const,
|
||||
},
|
||||
prompts: {
|
||||
all: () => ["prompts"] as const,
|
||||
public: () => ["prompts", "public"] as const,
|
||||
},
|
||||
notifications: {
|
||||
search: (searchSpaceId: number | null, search: string, tab: string) =>
|
||||
["notifications", "search", searchSpaceId, search, tab] as const,
|
||||
sourceTypes: (searchSpaceId: number | null) =>
|
||||
["notifications", "source-types", searchSpaceId] as const,
|
||||
batchUnreadCounts: (searchSpaceId: number | null) =>
|
||||
["notifications", "unread-counts-batch", searchSpaceId] as const,
|
||||
search: (workspaceId: number | null, search: string, tab: string) =>
|
||||
["notifications", "search", workspaceId, search, tab] as const,
|
||||
sourceTypes: (workspaceId: number | null) =>
|
||||
["notifications", "source-types", workspaceId] as const,
|
||||
batchUnreadCounts: (workspaceId: number | null) =>
|
||||
["notifications", "unread-counts-batch", workspaceId] as const,
|
||||
},
|
||||
automations: {
|
||||
// list endpoint is keyed by pagination too so distinct pages don't collide
|
||||
list: (searchSpaceId: number, limit: number, offset: number) =>
|
||||
["automations", "list", searchSpaceId, limit, offset] as const,
|
||||
list: (workspaceId: number, limit: number, offset: number) =>
|
||||
["automations", "list", workspaceId, limit, offset] as const,
|
||||
detail: (automationId: number) => ["automations", "detail", automationId] as const,
|
||||
runs: (automationId: number, limit: number, offset: number) =>
|
||||
["automations", "runs", automationId, limit, offset] as const,
|
||||
run: (automationId: number, runId: number) =>
|
||||
["automations", "runs", automationId, runId] as const,
|
||||
modelEligibility: (searchSpaceId: number) =>
|
||||
["automations", "model-eligibility", searchSpaceId] as const,
|
||||
modelEligibility: (workspaceId: number) =>
|
||||
["automations", "model-eligibility", workspaceId] as const,
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue