From 6712c83cf644ac78ae25251ae0dcb6fec868268d Mon Sep 17 00:00:00 2001
From: DrMelone <27028174+Classic298@users.noreply.github.com>
Date: Mon, 13 Apr 2026 00:20:48 +0200
Subject: [PATCH] fix: restore JSDoc marker, wire modal bindings, align
chatDirection, drop nested form, parallelize load
- Restore the /** opener above displayFileHandler in utils/index.ts that
was dropped during the earlier merge; the orphaned comment body made
the file fail TypeScript parsing and broke the frontend build.
- admin Settings/Interface.svelte now imports InterfaceDefaultsModal
and ConfirmDialog and declares the showInterfaceDefaultsModal /
showResetConfirmDialog flags that were already being bound at the
bottom of the template, resolving the unresolved-identifier compile
errors.
- InterfaceDefaultsModal no longer lowercases chatDirection before
saving. The user-side store is typed 'LTR' | 'RTL' | 'auto' and the
toggle/render logic matches those uppercase values; lowercasing on
the admin side made every saved RTL/LTR default silently render as
"Auto" for end users.
- InterfaceDefaultsModal drops the outer
+
{:else}
diff --git a/src/lib/utils/index.ts b/src/lib/utils/index.ts
index 9617f4e6d4..4d26d1ff4d 100644
--- a/src/lib/utils/index.ts
+++ b/src/lib/utils/index.ts
@@ -1840,6 +1840,7 @@ export const formatSkillName = (name) => {
return name.replace(/[-_]/g, ' ').replace(/\b\w/g, (c) => c.toUpperCase());
};
+/**
* Open the file browser panel to display a specific file.
* Used by both the direct tool execution path (client-side) and the
* backend event path (server-side) so behaviour is consistent.
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index edebe8b14f..480f01f2c4 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -916,19 +916,21 @@
$socket?.on('events', chatEventHandler);
$socket?.on('events:channel', channelEventHandler);
- const userSettings = await getUserSettings(localStorage.token);
+ // Fetch user settings and admin-configured interface defaults in
+ // parallel — both are independent network calls on the hot
+ // authenticated-load path, and serializing them added
+ // avoidable round-trip latency. Defaults fall back to {} if
+ // the endpoint is unavailable so user settings still apply.
+ const [userSettings, adminDefaults] = await Promise.all([
+ getUserSettings(localStorage.token),
+ getInterfaceDefaults(localStorage.token).catch((e) => {
+ console.warn('Failed to load admin interface defaults:', e);
+ return {};
+ })
+ ]);
- // Fetch admin-configured interface defaults and merge with user settings
- let effectiveSettings = {};
- try {
- const adminDefaults = await getInterfaceDefaults(localStorage.token);
- const userUI = userSettings?.ui ?? {};
- // Admin defaults are base, user settings override
- effectiveSettings = deepMerge(adminDefaults, userUI);
- } catch (e) {
- // Fall back to user settings if admin defaults unavailable
- effectiveSettings = userSettings?.ui ?? {};
- }
+ // Admin defaults are base, user settings override.
+ const effectiveSettings = deepMerge(adminDefaults ?? {}, userSettings?.ui ?? {});
if (userSettings) {
settings.set(effectiveSettings);