Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
2791f0b
refactor(api): Migrate hooks to React Query and centralize query logic
balazs-szucs Jul 30, 2026
3555f56
refactor: simplify endpoint key memoization and improve AppConfigProv…
balazs-szucs Jul 30, 2026
77145b1
test: remove onboarding skip from test bootstrap setup
balazs-szucs Jul 30, 2026
e1fb465
test: remove skipOnboarding from bootstrap setup
balazs-szucs Jul 30, 2026
7726bd7
refactor: reorder onboarding slide precedence to prioritize first log…
balazs-szucs Jul 30, 2026
7a0e66f
feat: trigger onboarding check on jwt-available event and initialize …
balazs-szucs Jul 30, 2026
9829b73
Merge branch 'main' into misc-tanstack
Frooodle Aug 1, 2026
1cbb406
Merge branch 'main' into misc-tanstack
balazs-szucs Aug 6, 2026
a30f338
refactor: remove redundant imports and type declarations in useGroupE…
balazs-szucs Aug 6, 2026
c122459
test: mock initReactI18next in useGroupEnabled tests to prevent initi…
balazs-szucs Aug 6, 2026
4f6d234
Merge branch 'main' into misc-tanstack
balazs-szucs Aug 7, 2026
24acee4
fix: fix AppConfigProvider and update test wrappers for consistency
balazs-szucs Aug 7, 2026
22785a4
Merge branch 'main' into misc-tanstack
balazs-szucs Aug 7, 2026
b99c6ea
test: update useGroupEnabled test to use cached snapshot for status u…
balazs-szucs Aug 7, 2026
ac040a9
Merge branch 'main' into misc-tanstack
balazs-szucs Aug 16, 2026
79333ca
refactor: remove unused imports and clean up code in useEndpointConfig
balazs-szucs Aug 16, 2026
33c58ad
refactor: improve code formatting and consistency in useEndpointConfig
balazs-szucs Aug 16, 2026
2d1b318
Merge branch 'main' into misc-tanstack
balazs-szucs Aug 29, 2026
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
17 changes: 14 additions & 3 deletions frontend/editor/src/core/components/AppProviders.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ReactNode, useEffect } from "react";
import { ReactNode, useEffect, useState } from "react";
import { QueryClientProvider } from "@tanstack/react-query";
import { ThemeProvider } from "@app/components/shared/ThemeProvider";
import { FileContextProvider } from "@app/contexts/FileContext";
import { NavigationProvider } from "@app/contexts/NavigationContext";
Expand Down Expand Up @@ -37,6 +38,7 @@ import { RedactionProvider } from "@app/contexts/RedactionContext";
import { FormFillProvider } from "@app/tools/formFill/FormFillContext";
import { FolderFileContextProvider } from "@app/contexts/FolderFileContext";
import { FolderProvider } from "@app/contexts/FolderContext";
import { createEditorQueryClient } from "@app/queryClient";

// Component to initialize scarf tracking (must be inside AppConfigProvider)
function ScarfTrackingInitializer() {
Expand Down Expand Up @@ -114,7 +116,16 @@ function ServerDefaultsSync() {
* Core application providers
* Contains all providers needed for the core
*/
export function AppProviders({
export function AppProviders(props: AppProvidersProps) {
const [queryClient] = useState(createEditorQueryClient);
return (
<QueryClientProvider client={queryClient}>
<AppProvidersTree {...props} />
</QueryClientProvider>
);
}

function AppProvidersTree({
children,
appConfigRetryOptions,
appConfigProviderProps,
Expand All @@ -133,7 +144,7 @@ export function AppProviders({
<AppConfigLoader />
<ServerDefaultsSync />
{/* Auto-popup on startup when a newer Stirling-PDF release is available.
No-ops inside Tauri the desktop popup handles that flow. */}
No-ops inside Tauri; the desktop popup handles that flow. */}
<UpdateStartupPopup />
<FileContextProvider
enableUrlSync={true}
Expand Down
35 changes: 31 additions & 4 deletions frontend/editor/src/core/contexts/AppConfigContext.test.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,43 @@
import { describe, it, expect, beforeEach, vi, afterEach } from "vitest";
import { waitFor, renderHook, act } from "@testing-library/react";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import {
AppConfigProvider,
useAppConfig,
} from "@app/contexts/AppConfigContext";
import apiClient from "@app/services/apiClient";
import { allowConsole, expectConsole } from "@app/tests/failOnConsole";
import { ReactNode } from "react";
import { ReactNode, useState } from "react";

// Mock apiClient
vi.mock("@app/services/apiClient");

function createTestQueryClient() {
return new QueryClient({
defaultOptions: {
queries: {
retry: false,
gcTime: 0,
},
},
});
}

function TestProviders({
children,
appConfigProps,
}: {
children: ReactNode;
appConfigProps?: React.ComponentProps<typeof AppConfigProvider>;
}) {
const [client] = useState(createTestQueryClient);
return (
<QueryClientProvider client={client}>
<AppConfigProvider {...appConfigProps}>{children}</AppConfigProvider>
</QueryClientProvider>
);
}

describe("AppConfigContext", () => {
beforeEach(() => {
vi.clearAllMocks();
Expand All @@ -26,7 +53,7 @@ describe("AppConfigContext", () => {
});

const wrapper = ({ children }: { children: ReactNode }) => (
<AppConfigProvider>{children}</AppConfigProvider>
<TestProviders>{children}</TestProviders>
);

it("should fetch and provide app config on non-auth pages", async () => {
Expand Down Expand Up @@ -261,9 +288,9 @@ describe("AppConfigContext", () => {
};

const customWrapper = ({ children }: { children: ReactNode }) => (
<AppConfigProvider initialConfig={initialConfig}>
<TestProviders appConfigProps={{ initialConfig }}>
{children}
</AppConfigProvider>
</TestProviders>
);

const { result } = renderHook(() => useAppConfig(), {
Expand Down
Loading
Loading