mirror of
https://github.com/ByteAtATime/raycast-linux.git
synced 2025-08-31 03:07:23 +00:00
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:
parent
1ae8a571cb
commit
28d1605bba
8 changed files with 125 additions and 2 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue