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:
Anish Sarkar 2026-07-06 15:12:40 +05:30
parent 2a020629c5
commit a8c1fb660d
259 changed files with 5480 additions and 2285 deletions

View file

@ -19,12 +19,12 @@ function videoStatus(status: string): LibraryArtifactStatus {
// Each list is fetched independently; one failing source shouldn't blank the
// whole library, so failures degrade to an empty slice.
async function fetchLibraryArtifacts(searchSpaceId: number): Promise<LibraryArtifact[]> {
async function fetchLibraryArtifacts(workspaceId: number): Promise<LibraryArtifact[]> {
const [reports, podcasts, videos, images] = await Promise.all([
reportsApiService.list(searchSpaceId).catch(() => []),
podcastsApiService.list(searchSpaceId).catch(() => []),
videoPresentationsApiService.list(searchSpaceId).catch(() => []),
imageGenerationsApiService.list(searchSpaceId).catch(() => []),
reportsApiService.list(workspaceId).catch(() => []),
podcastsApiService.list(workspaceId).catch(() => []),
videoPresentationsApiService.list(workspaceId).catch(() => []),
imageGenerationsApiService.list(workspaceId).catch(() => []),
]);
const artifacts: LibraryArtifact[] = [];
@ -86,11 +86,11 @@ async function fetchLibraryArtifacts(searchSpaceId: number): Promise<LibraryArti
);
}
export function useLibraryArtifacts(searchSpaceId: number) {
export function useLibraryArtifacts(workspaceId: number) {
const { data, isLoading, error, refetch } = useQuery({
queryKey: ["artifacts-library", searchSpaceId],
queryFn: () => fetchLibraryArtifacts(searchSpaceId),
enabled: Number.isFinite(searchSpaceId) && searchSpaceId > 0,
queryKey: ["artifacts-library", workspaceId],
queryFn: () => fetchLibraryArtifacts(workspaceId),
enabled: Number.isFinite(workspaceId) && workspaceId > 0,
staleTime: 60 * 1000,
});