Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 6 additions & 2 deletions web/src/contexts/UICustomizationProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,13 @@ export function UICustomizationProvider({ children }: { children: ReactNode }) {
capabilitiesQuery.data,
);
const query = useEffectiveSettings({ keys: UI_CUSTOMIZATION_KEYS, enabled: isSupported });
// A failed background refetch keeps the last good capabilities answer as
// `data` under an error status. That answer still says what the server
// supports, so only a missing answer makes the editors unavailable. A failed
// settings read still closes them: the editors save whole documents built
// from those values.
const isUnavailable =
(!capabilitiesQuery.isLoading &&
(capabilitiesQuery.isError || capabilitiesQuery.data === undefined)) ||
(!capabilitiesQuery.isLoading && capabilitiesQuery.data === undefined) ||
Comment thread
Quick104 marked this conversation as resolved.
Resolved
(isSupported && !query.isLoading && (query.isError || query.data === undefined));
// A disabled query may still expose data cached before a server downgrade or
// reconnect. Ignore it until the connected server proves support.
Expand Down
5 changes: 4 additions & 1 deletion web/src/contexts/uiCustomizationContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ export interface UICustomizationValue {
/** The server can merge shortcut item mutations without lost updates. */
supportsAtomicShortcuts: boolean;
isLoading: boolean;
/** Capability or effective-value loading failed, so whole-document editors must stay closed. */
/**
* No capabilities answer has arrived, or the effective-value read failed, so
* whole-document editors must stay closed.
*/
isUnavailable: boolean;
}

Expand Down
Loading