feat: add hud API

This commit adds the HUD API, allowing extensions to display temporary, non-interactive messages on the screen. The implementation adds a `show_hud` Tauri command that manages a dedicated, borderless Svelte window. This window is dynamically resized to fit its content and is automatically hidden after two seconds.
This commit is contained in:
ByteAtATime 2025-06-22 09:04:10 -07:00
parent 1ae8a571cb
commit 28d1605bba
No known key found for this signature in database
8 changed files with 125 additions and 2 deletions

View file

@ -78,6 +78,15 @@ const HideToastPayloadSchema = z.object({
id: z.number()
});
const ShowHudPayloadSchema = z.object({
title: z.string()
});
const ShowHudMessageSchema = z.object({
type: z.literal('SHOW_HUD'),
payload: ShowHudPayloadSchema
});
export const CommandSchema = z.discriminatedUnion('type', [
z.object({ type: z.literal('CREATE_INSTANCE'), payload: CreateInstancePayloadSchema }),
z.object({ type: z.literal('CREATE_TEXT_INSTANCE'), payload: CreateTextInstancePayloadSchema }),
@ -292,6 +301,7 @@ const OauthRemoveTokensMessageSchema = z.object({
export const SidecarMessageWithPluginsSchema = z.union([
BatchUpdateSchema,
CommandSchema,
ShowHudMessageSchema,
LogMessageSchema,
PluginListSchema,
PreferenceValuesSchema,