feat: add admin UI control for chat auto-archive days (#24704)

Relates to #24642 

Adds admin UI controls for managing chat auto-archive (days) under
"Lifecycle".
Also adds a "Days" label to the right of the pre-existing unitless
numeric input for consistency.

Exemplary screenshot below. More screens available in Storybook.

<img width="847" height="585" alt="Screenshot 2026-04-24 at 16 48 59"
src="https://github.com/user-attachments/assets/d38de5f8-d379-4b06-b175-ac399f31e578"
/>
This commit is contained in:
Cian Johnston
2026-04-27 09:54:22 +01:00
committed by GitHub
parent 069223ae26
commit 2f26903af9
8 changed files with 556 additions and 14 deletions
+18
View File
@@ -3379,6 +3379,24 @@ class ExperimentalApiMethods {
await this.axios.put("/api/experimental/chats/config/retention-days", req);
};
getChatAutoArchiveDays =
async (): Promise<TypesGen.ChatAutoArchiveDaysResponse> => {
const response =
await this.axios.get<TypesGen.ChatAutoArchiveDaysResponse>(
"/api/experimental/chats/config/auto-archive-days",
);
return response.data;
};
updateChatAutoArchiveDays = async (
req: TypesGen.UpdateChatAutoArchiveDaysRequest,
): Promise<void> => {
await this.axios.put(
"/api/experimental/chats/config/auto-archive-days",
req,
);
};
updateChatTemplateAllowlist = async (
req: TypesGen.ChatTemplateAllowlist,
): Promise<void> => {
+16
View File
@@ -1351,6 +1351,22 @@ export const updateChatRetentionDays = (queryClient: QueryClient) => ({
},
});
const chatAutoArchiveDaysKey = ["chat-auto-archive-days"] as const;
export const chatAutoArchiveDays = () => ({
queryKey: chatAutoArchiveDaysKey,
queryFn: () => API.experimental.getChatAutoArchiveDays(),
});
export const updateChatAutoArchiveDays = (queryClient: QueryClient) => ({
mutationFn: API.experimental.updateChatAutoArchiveDays,
onSuccess: async () => {
await queryClient.invalidateQueries({
queryKey: chatAutoArchiveDaysKey,
});
},
});
const chatTemplateAllowlistKey = ["chat-template-allowlist"] as const;
export const chatTemplateAllowlist = () => ({