From cdd1d326c97e4c3b06d741eaa8db23f1cbb00a34 Mon Sep 17 00:00:00 2001 From: Panthevm Date: Wed, 29 Jul 2026 17:56:14 +0300 Subject: [PATCH 1/3] Query: disable refetch on window focus and reconnect MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Returning to the browser tab silently discarded unsaved editor changes. The QueryClient had no defaultOptions, so refetchOnWindowFocus was on and staleTime was 0: every visibilitychange refetched the resource query. A successful fetch always bumps dataUpdatedAt, even when the response is byte-identical, and ResourceEditorPage is keyed by `type/id@dataUpdatedAt` — so the page remounted and useState(initialResource) re-initialized from the server copy. useUnsavedChangesBlocker cannot catch this: a remount is not a navigation. Hitting Save afterwards wrote the rolled-back version back to Aidbox. Turn both automatic refetches off globally. Nothing overrides them to true, so the editor now remounts only where it was intended to — after Save invalidates its query key. --- src/index.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/index.tsx b/src/index.tsx index 875fe1d..3b4ded3 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -18,7 +18,14 @@ if ( const router = createRouter({ basepath: UI_BASE_PATH, routeTree }); -const queryClient = new QueryClient(); +const queryClient = new QueryClient({ + defaultOptions: { + queries: { + refetchOnWindowFocus: false, + refetchOnReconnect: false, + }, + }, +}); declare module "@tanstack/react-router" { interface Register { From f1141d3ca63f90d45070b82c30b4f5e7db5e3e5c Mon Sep 17 00:00:00 2001 From: Panthevm Date: Wed, 29 Jul 2026 18:07:31 +0300 Subject: [PATCH 2/3] CodeEditor: bump aidbox-ts-sdk for two-space editor indentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Picks up react-components 484b967: the editor's indentUnit was a tab, so auto-indent produced 4 columns against content pretty-printed with 2 spaces — Enter inside a JSON object left the caret one level too deep. Tab now uses indentMore instead of inserting a literal "\t", which is invalid indentation in YAML. --- aidbox-ts-sdk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aidbox-ts-sdk b/aidbox-ts-sdk index 6e75111..484b967 160000 --- a/aidbox-ts-sdk +++ b/aidbox-ts-sdk @@ -1 +1 @@ -Subproject commit 6e75111fa388d693a98e77bf287441539b254d55 +Subproject commit 484b967fd576638120d3eff0d4bbf1449847cb5e From c3004929ba5ed2db92d9695bc213aadd998a20a6 Mon Sep 17 00:00:00 2001 From: Panthevm Date: Wed, 29 Jul 2026 18:12:43 +0300 Subject: [PATCH 3/3] Resource Browser: reserve scrollbar gutter so search stops shifting the list The scroll container is overflow-y-auto and everything inside it is centered with `mx-auto max-w-[990px]`. Typing changes the virtualizer's total size, so around ~5 results the classic 8px scrollbar (from the ::-webkit-scrollbar rules in index.css) keeps appearing and disappearing. Each toggle resizes the content box by 8px and moves the centered column by 4px, which reads as the list jumping left and right while searching. scrollbar-gutter: stable reserves the gutter in both states. --- src/components/ResourceBrowser/browser.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/ResourceBrowser/browser.tsx b/src/components/ResourceBrowser/browser.tsx index 0d0a6f9..e436e0e 100644 --- a/src/components/ResourceBrowser/browser.tsx +++ b/src/components/ResourceBrowser/browser.tsx @@ -563,7 +563,10 @@ export function Browser() { }; return ( -
+