Finish the mobile performance pass
- Cache the model catalog once per user and each conversation's setting separately; clear both on logout and after model saves - Compress hashed assets asynchronously with a byte budget and set Vary - Memoize message parsing and throttle selection reads - Debounce draft writes to localStorage - Keep the composer editor on the page and focused, as before - Add a bundle budget check and run it in CI - Show a loading block while sessions load and a workspace avatar in the mobile conversation header
This commit is contained in:
@@ -2,6 +2,7 @@ import fetchApi from "@moduletrace/twui/utils/fetch/fetchApi";
|
||||
import type { APIResponseObject } from "@moduletrace/bunext/types";
|
||||
import type { SaveBotHarnessSettingsRequest } from "@/src/schemas/harness-schema";
|
||||
import type { BotHarnessOverviewPayload } from "@/src/types";
|
||||
import { clearHarnessCache } from "@/src/utils/harness-cache";
|
||||
|
||||
/**
|
||||
* Saves a worker bot's own model settings and returns the fresh page data.
|
||||
@@ -9,11 +10,15 @@ import type { BotHarnessOverviewPayload } from "@/src/types";
|
||||
export default async function saveBotHarnessSettings(
|
||||
body: SaveBotHarnessSettingsRequest,
|
||||
) {
|
||||
return await fetchApi<
|
||||
const res = await fetchApi<
|
||||
SaveBotHarnessSettingsRequest,
|
||||
APIResponseObject<BotHarnessOverviewPayload>
|
||||
>(`/api/admin/bots/save-harness-settings`, {
|
||||
method: "POST",
|
||||
body,
|
||||
});
|
||||
|
||||
if (res.success) clearHarnessCache();
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -2,16 +2,21 @@ import fetchApi from "@moduletrace/twui/utils/fetch/fetchApi";
|
||||
import type { APIResponseObject } from "@moduletrace/bunext/types";
|
||||
import type { SaveWorkspaceHarnessSettingsRequest } from "@/src/schemas/harness-schema";
|
||||
import type { BotHarnessOverviewPayload } from "@/src/types";
|
||||
import { clearHarnessCache } from "@/src/utils/harness-cache";
|
||||
|
||||
/**
|
||||
* Saves a workspace's model settings and returns the fresh page data.
|
||||
*/
|
||||
export default async function saveWorkspaceHarnessSettings(body: SaveWorkspaceHarnessSettingsRequest) {
|
||||
return await fetchApi<
|
||||
const res = await fetchApi<
|
||||
SaveWorkspaceHarnessSettingsRequest,
|
||||
APIResponseObject<BotHarnessOverviewPayload>
|
||||
>(`/api/admin/workspaces/save-harness-settings`, {
|
||||
method: "POST",
|
||||
body,
|
||||
});
|
||||
|
||||
if (res.success) clearHarnessCache();
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user