From 33e4451be2b75f230b14b0ff2eb83f8ce29932ad Mon Sep 17 00:00:00 2001 From: Huakun Shen Date: Wed, 29 Jan 2025 18:56:16 -0500 Subject: [PATCH] Fix: action panel (#83) * fix: change action trigger hotkey on win and linux from control + k to alt + k * chore: Update macOS build matrix to use macos-13 instead of macos-12 * feat: improve action panel, disable actions vimBindings --- .github/workflows/beta-build.yml | 6 +- .../app/extension/ui-worker/+page.svelte | 10 +- .../demo-worker-template-ext/src/index.ts | 57 -- packages/supabase/src/database.types.ts | 596 +++++++++--------- .../permissions/autogenerated/reference.md | 2 - .../extension/StoreExtDetail.svelte | 2 +- .../extension/templates/list-view.svelte | 1 + .../ui/src/components/main/ActionPanel.svelte | 15 +- .../main/GlobalCommandPaletteFooter.svelte | 2 +- 9 files changed, 317 insertions(+), 374 deletions(-) diff --git a/.github/workflows/beta-build.yml b/.github/workflows/beta-build.yml index 54a0047..c5113ca 100644 --- a/.github/workflows/beta-build.yml +++ b/.github/workflows/beta-build.yml @@ -91,7 +91,7 @@ jobs: run: | matrix="" if [ "${{ github.event_name }}" == "schedule" ]; then - matrix="\"windows-latest\",\"ubuntu-22.04\",\"macos-14\",\"macos-12\"" + matrix="\"windows-latest\",\"ubuntu-22.04\",\"macos-14\",\"macos-13\"" build_mode="" build_path="release" retention_days='1' @@ -106,7 +106,7 @@ jobs: matrix="${matrix}\"macos-14\"," fi if [ "${{ inputs.platform_macos_x86_64 }}" == "true" ]; then - matrix="${matrix}\"macos-12\"," + matrix="${matrix}\"macos-13\"," fi if [ -z "${matrix}" ]; then matrix="\"windows-latest\"," @@ -217,7 +217,7 @@ jobs: run: mv target/${{ env.BUILD_PATH }}/bundle/dmg/*.dmg target/${{ env.BUILD_PATH }}/bundle/dmg/${{ env.FILE_PREFIX }}-aarch64.dmg - name: Rename macos-x86_64 - if: matrix.os == 'macos-12' + if: matrix.os == 'macos-13' run: mv target/${{ env.BUILD_PATH }}/bundle/dmg/*.dmg target/${{ env.BUILD_PATH }}/bundle/dmg/${{ env.FILE_PREFIX }}-amd64.dmg - name: Rename windows diff --git a/apps/desktop/src/routes/app/extension/ui-worker/+page.svelte b/apps/desktop/src/routes/app/extension/ui-worker/+page.svelte index 4beb019..e34a11e 100644 --- a/apps/desktop/src/routes/app/extension/ui-worker/+page.svelte +++ b/apps/desktop/src/routes/app/extension/ui-worker/+page.svelte @@ -273,8 +273,14 @@ keySet.has(_platform === "macos" ? "Meta" : "Control") && keySet.has("k") ) { - console.log("open action panel") - actionPanelOpen = true + // actionPanelOpen = true + setTimeout(() => { + console.log("toggle action panel") + actionPanelOpen = !actionPanelOpen + if (!actionPanelOpen) { + onActionPanelBlur() + } + }, 100) } }) diff --git a/packages/extensions/demo-worker-template-ext/src/index.ts b/packages/extensions/demo-worker-template-ext/src/index.ts index 46057e1..23fc453 100644 --- a/packages/extensions/demo-worker-template-ext/src/index.ts +++ b/packages/extensions/demo-worker-template-ext/src/index.ts @@ -50,68 +50,11 @@ class ExtensionTemplate extends WorkerExtension { } async load() { - clipboard.readText().then((text) => { - console.log("Clipboard text:", text) - }) - kv.exists("test").then((exists) => { - console.log("KV exists:", exists) - }) - kv.set("test", Math.random().toString()).then(() => { - return kv.get("test").then((value) => { - console.log("KV value:", value) - }) - }) - - // console.log("Check screen capture permission:", await security.mac.checkScreenCapturePermission()) - // await security.mac.revealSecurityPane("AllFiles") - // console.log(await security.mac.verifyFingerprint()) ui.setSearchBarPlaceholder("Search for items") ui.showLoadingBar(true) setTimeout(() => { ui.showLoadingBar(false) }, 2000) - const { rpcChannel, process, command } = await shell.createDenoRpcChannel< - {}, - { - add(a: number, b: number): Promise - subtract(a: number, b: number): Promise - readImageMetadata(path: string): Promise - batchReadImageMetadata: (paths: string[]) => Promise - } - >( - "$EXTENSION/deno-src/rpc.ts", - [], - { - // allowEnv: ["npm_package_config_libvips"], - allowAllEnv: true, - // allowFfi: ["*sharp-darwin-arm64.node"], - allowAllFfi: true, - allowAllRead: true, - allowAllSys: true, - // allowRun: ["*exiftool"] - allowAllRun: true - }, - {} - ) - // const child = new Child(process.pid) - command.stdout.on("data", (data) => { - console.log("stdout", data.toString()) - }) - command.stderr.on("data", (data) => { - console.log("stderr", data.toString()) - }) - // await api - // .readImageMetadata("/Users/hacker/Pictures/3D-Image/pics/IMG_0767.jpeg") - // .then((data) => { - // console.log("metadata", data) - // }) - // .catch((err) => { - // console.error("error", err) - // }) - // await api.add(1, 2).then(console.log) - // await api.subtract(1, 2).then(console.log) - - await process.kill() const extPath = await path.extensionDir() // console.log("Extension path:", extPath) const tagList = new List.ItemDetailMetadataTagList({ diff --git a/packages/supabase/src/database.types.ts b/packages/supabase/src/database.types.ts index 79617f7..b80cc87 100644 --- a/packages/supabase/src/database.types.ts +++ b/packages/supabase/src/database.types.ts @@ -1,325 +1,311 @@ -export type Json = - | string - | number - | boolean - | null - | { [key: string]: Json | undefined } - | Json[] +export type Json = string | number | boolean | null | { [key: string]: Json | undefined } | Json[] export type Database = { - public: { - Tables: { - events: { - Row: { - created_at: string - data: Json | null - event_type: Database["public"]["Enums"]["event_type"] - id: number - ip: string - } - Insert: { - created_at?: string - data?: Json | null - event_type: Database["public"]["Enums"]["event_type"] - id?: number - ip: string - } - Update: { - created_at?: string - data?: Json | null - event_type?: Database["public"]["Enums"]["event_type"] - id?: number - ip?: string - } - Relationships: [] - } - ext_images: { - Row: { - created_at: string - image_path: string - sha512: string - } - Insert: { - created_at?: string - image_path: string - sha512: string - } - Update: { - created_at?: string - image_path?: string - sha512?: string - } - Relationships: [] - } - ext_publish: { - Row: { - api_version: string | null - cmd_count: number - created_at: string - demo_images: string[] - downloads: number - extension_state: Database["public"]["Enums"]["extension_state"] - id: number - identifier: string - manifest: Json - metadata: Json | null - name: string - package_json: Json | null - readme: string | null - shasum: string - tarball_path: string - tarball_size: number - unpacked_size: number | null - version: string - } - Insert: { - api_version?: string | null - cmd_count: number - created_at?: string - demo_images: string[] - downloads: number - extension_state?: Database["public"]["Enums"]["extension_state"] - id?: number - identifier: string - manifest: Json - metadata?: Json | null - name: string - package_json?: Json | null - readme?: string | null - shasum: string - tarball_path: string - tarball_size: number - unpacked_size?: number | null - version: string - } - Update: { - api_version?: string | null - cmd_count?: number - created_at?: string - demo_images?: string[] - downloads?: number - extension_state?: Database["public"]["Enums"]["extension_state"] - id?: number - identifier?: string - manifest?: Json - metadata?: Json | null - name?: string - package_json?: Json | null - readme?: string | null - shasum?: string - tarball_path?: string - tarball_size?: number - unpacked_size?: number | null - version?: string - } - Relationships: [ - { - foreignKeyName: "ext_publish_identifier_fkey" - columns: ["identifier"] - isOneToOne: false - referencedRelation: "extensions" - referencedColumns: ["identifier"] - }, - ] - } - extensions: { - Row: { - api_version: string - author_id: string | null - created_at: string - downloads: number - icon: Json | null - identifier: string - long_description: string | null - name: string - readme: string | null - short_description: string - tarball_size: number | null - version: string - } - Insert: { - api_version: string - author_id?: string | null - created_at?: string - downloads: number - icon?: Json | null - identifier: string - long_description?: string | null - name: string - readme?: string | null - short_description: string - tarball_size?: number | null - version: string - } - Update: { - api_version?: string - author_id?: string | null - created_at?: string - downloads?: number - icon?: Json | null - identifier?: string - long_description?: string | null - name?: string - readme?: string | null - short_description?: string - tarball_size?: number | null - version?: string - } - Relationships: [] - } - stargazers: { - Row: { - created_at: string - id: number - star_date: string - username: string - } - Insert: { - created_at?: string - id?: number - star_date: string - username: string - } - Update: { - created_at?: string - id?: number - star_date?: string - username?: string - } - Relationships: [] - } - } - Views: { - [_ in never]: never - } - Functions: { - get_aggregated_downloads: { - Args: Record - Returns: { - identifier: string - total_downloads: number - }[] - } - get_aggregated_downloads_with_details: { - Args: Record - Returns: { - identifier: string - total_downloads: number - name: string - short_description: string - }[] - } - increment_downloads: { - Args: { - t_identifier: string - t_version: string - } - Returns: number - } - } - Enums: { - event_type: "download" | "updater" | "schema" | "nightly_schema" - extension_state: "public" | "pending" | "under_review" | "private" - } - CompositeTypes: { - [_ in never]: never - } - } + public: { + Tables: { + events: { + Row: { + created_at: string + data: Json | null + event_type: Database["public"]["Enums"]["event_type"] + id: number + ip: string + } + Insert: { + created_at?: string + data?: Json | null + event_type: Database["public"]["Enums"]["event_type"] + id?: number + ip: string + } + Update: { + created_at?: string + data?: Json | null + event_type?: Database["public"]["Enums"]["event_type"] + id?: number + ip?: string + } + Relationships: [] + } + ext_images: { + Row: { + created_at: string + image_path: string + sha512: string + } + Insert: { + created_at?: string + image_path: string + sha512: string + } + Update: { + created_at?: string + image_path?: string + sha512?: string + } + Relationships: [] + } + ext_publish: { + Row: { + api_version: string | null + cmd_count: number + created_at: string + demo_images: string[] + downloads: number + extension_state: Database["public"]["Enums"]["extension_state"] + id: number + identifier: string + manifest: Json + metadata: Json | null + name: string + package_json: Json | null + readme: string | null + shasum: string + tarball_path: string + tarball_size: number + unpacked_size: number | null + version: string + } + Insert: { + api_version?: string | null + cmd_count: number + created_at?: string + demo_images: string[] + downloads: number + extension_state?: Database["public"]["Enums"]["extension_state"] + id?: number + identifier: string + manifest: Json + metadata?: Json | null + name: string + package_json?: Json | null + readme?: string | null + shasum: string + tarball_path: string + tarball_size: number + unpacked_size?: number | null + version: string + } + Update: { + api_version?: string | null + cmd_count?: number + created_at?: string + demo_images?: string[] + downloads?: number + extension_state?: Database["public"]["Enums"]["extension_state"] + id?: number + identifier?: string + manifest?: Json + metadata?: Json | null + name?: string + package_json?: Json | null + readme?: string | null + shasum?: string + tarball_path?: string + tarball_size?: number + unpacked_size?: number | null + version?: string + } + Relationships: [ + { + foreignKeyName: "ext_publish_identifier_fkey" + columns: ["identifier"] + isOneToOne: false + referencedRelation: "extensions" + referencedColumns: ["identifier"] + } + ] + } + extensions: { + Row: { + api_version: string + author_id: string | null + created_at: string + downloads: number + icon: Json | null + identifier: string + long_description: string | null + name: string + readme: string | null + short_description: string + tarball_size: number | null + version: string + } + Insert: { + api_version: string + author_id?: string | null + created_at?: string + downloads: number + icon?: Json | null + identifier: string + long_description?: string | null + name: string + readme?: string | null + short_description: string + tarball_size?: number | null + version: string + } + Update: { + api_version?: string + author_id?: string | null + created_at?: string + downloads?: number + icon?: Json | null + identifier?: string + long_description?: string | null + name?: string + readme?: string | null + short_description?: string + tarball_size?: number | null + version?: string + } + Relationships: [] + } + stargazers: { + Row: { + created_at: string + id: number + star_date: string + username: string + } + Insert: { + created_at?: string + id?: number + star_date: string + username: string + } + Update: { + created_at?: string + id?: number + star_date?: string + username?: string + } + Relationships: [] + } + } + Views: { + [_ in never]: never + } + Functions: { + get_aggregated_downloads: { + Args: Record + Returns: { + identifier: string + total_downloads: number + }[] + } + get_aggregated_downloads_with_details: { + Args: Record + Returns: { + identifier: string + total_downloads: number + name: string + short_description: string + }[] + } + increment_downloads: { + Args: { + t_identifier: string + t_version: string + } + Returns: number + } + } + Enums: { + event_type: "download" | "updater" | "schema" | "nightly_schema" + extension_state: "public" | "pending" | "under_review" | "private" + } + CompositeTypes: { + [_ in never]: never + } + } } type PublicSchema = Database[Extract] export type Tables< - PublicTableNameOrOptions extends - | keyof (PublicSchema["Tables"] & PublicSchema["Views"]) - | { schema: keyof Database }, - TableName extends PublicTableNameOrOptions extends { schema: keyof Database } - ? keyof (Database[PublicTableNameOrOptions["schema"]]["Tables"] & - Database[PublicTableNameOrOptions["schema"]]["Views"]) - : never = never, + PublicTableNameOrOptions extends + | keyof (PublicSchema["Tables"] & PublicSchema["Views"]) + | { schema: keyof Database }, + TableName extends PublicTableNameOrOptions extends { schema: keyof Database } + ? keyof (Database[PublicTableNameOrOptions["schema"]]["Tables"] & + Database[PublicTableNameOrOptions["schema"]]["Views"]) + : never = never > = PublicTableNameOrOptions extends { schema: keyof Database } - ? (Database[PublicTableNameOrOptions["schema"]]["Tables"] & - Database[PublicTableNameOrOptions["schema"]]["Views"])[TableName] extends { - Row: infer R - } - ? R - : never - : PublicTableNameOrOptions extends keyof (PublicSchema["Tables"] & - PublicSchema["Views"]) - ? (PublicSchema["Tables"] & - PublicSchema["Views"])[PublicTableNameOrOptions] extends { - Row: infer R - } - ? R - : never - : never + ? (Database[PublicTableNameOrOptions["schema"]]["Tables"] & + Database[PublicTableNameOrOptions["schema"]]["Views"])[TableName] extends { + Row: infer R + } + ? R + : never + : PublicTableNameOrOptions extends keyof (PublicSchema["Tables"] & PublicSchema["Views"]) + ? (PublicSchema["Tables"] & PublicSchema["Views"])[PublicTableNameOrOptions] extends { + Row: infer R + } + ? R + : never + : never export type TablesInsert< - PublicTableNameOrOptions extends - | keyof PublicSchema["Tables"] - | { schema: keyof Database }, - TableName extends PublicTableNameOrOptions extends { schema: keyof Database } - ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"] - : never = never, + PublicTableNameOrOptions extends keyof PublicSchema["Tables"] | { schema: keyof Database }, + TableName extends PublicTableNameOrOptions extends { schema: keyof Database } + ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"] + : never = never > = PublicTableNameOrOptions extends { schema: keyof Database } - ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends { - Insert: infer I - } - ? I - : never - : PublicTableNameOrOptions extends keyof PublicSchema["Tables"] - ? PublicSchema["Tables"][PublicTableNameOrOptions] extends { - Insert: infer I - } - ? I - : never - : never + ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends { + Insert: infer I + } + ? I + : never + : PublicTableNameOrOptions extends keyof PublicSchema["Tables"] + ? PublicSchema["Tables"][PublicTableNameOrOptions] extends { + Insert: infer I + } + ? I + : never + : never export type TablesUpdate< - PublicTableNameOrOptions extends - | keyof PublicSchema["Tables"] - | { schema: keyof Database }, - TableName extends PublicTableNameOrOptions extends { schema: keyof Database } - ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"] - : never = never, + PublicTableNameOrOptions extends keyof PublicSchema["Tables"] | { schema: keyof Database }, + TableName extends PublicTableNameOrOptions extends { schema: keyof Database } + ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"] + : never = never > = PublicTableNameOrOptions extends { schema: keyof Database } - ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends { - Update: infer U - } - ? U - : never - : PublicTableNameOrOptions extends keyof PublicSchema["Tables"] - ? PublicSchema["Tables"][PublicTableNameOrOptions] extends { - Update: infer U - } - ? U - : never - : never + ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends { + Update: infer U + } + ? U + : never + : PublicTableNameOrOptions extends keyof PublicSchema["Tables"] + ? PublicSchema["Tables"][PublicTableNameOrOptions] extends { + Update: infer U + } + ? U + : never + : never export type Enums< - PublicEnumNameOrOptions extends - | keyof PublicSchema["Enums"] - | { schema: keyof Database }, - EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database } - ? keyof Database[PublicEnumNameOrOptions["schema"]]["Enums"] - : never = never, + PublicEnumNameOrOptions extends keyof PublicSchema["Enums"] | { schema: keyof Database }, + EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database } + ? keyof Database[PublicEnumNameOrOptions["schema"]]["Enums"] + : never = never > = PublicEnumNameOrOptions extends { schema: keyof Database } - ? Database[PublicEnumNameOrOptions["schema"]]["Enums"][EnumName] - : PublicEnumNameOrOptions extends keyof PublicSchema["Enums"] - ? PublicSchema["Enums"][PublicEnumNameOrOptions] - : never + ? Database[PublicEnumNameOrOptions["schema"]]["Enums"][EnumName] + : PublicEnumNameOrOptions extends keyof PublicSchema["Enums"] + ? PublicSchema["Enums"][PublicEnumNameOrOptions] + : never export type CompositeTypes< - PublicCompositeTypeNameOrOptions extends - | keyof PublicSchema["CompositeTypes"] - | { schema: keyof Database }, - CompositeTypeName extends PublicCompositeTypeNameOrOptions extends { - schema: keyof Database - } - ? keyof Database[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"] - : never = never, + PublicCompositeTypeNameOrOptions extends + | keyof PublicSchema["CompositeTypes"] + | { schema: keyof Database }, + CompositeTypeName extends PublicCompositeTypeNameOrOptions extends { + schema: keyof Database + } + ? keyof Database[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"] + : never = never > = PublicCompositeTypeNameOrOptions extends { schema: keyof Database } - ? Database[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"][CompositeTypeName] - : PublicCompositeTypeNameOrOptions extends keyof PublicSchema["CompositeTypes"] - ? PublicSchema["CompositeTypes"][PublicCompositeTypeNameOrOptions] - : never + ? Database[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"][CompositeTypeName] + : PublicCompositeTypeNameOrOptions extends keyof PublicSchema["CompositeTypes"] + ? PublicSchema["CompositeTypes"][PublicCompositeTypeNameOrOptions] + : never diff --git a/packages/tauri-plugins/jarvis/permissions/autogenerated/reference.md b/packages/tauri-plugins/jarvis/permissions/autogenerated/reference.md index 19f9805..7020b75 100644 --- a/packages/tauri-plugins/jarvis/permissions/autogenerated/reference.md +++ b/packages/tauri-plugins/jarvis/permissions/autogenerated/reference.md @@ -1,4 +1,3 @@ - ## Permission Table @@ -7,7 +6,6 @@ -
Description
diff --git a/packages/ui/src/components/extension/StoreExtDetail.svelte b/packages/ui/src/components/extension/StoreExtDetail.svelte index 3431a27..37fa582 100644 --- a/packages/ui/src/components/extension/StoreExtDetail.svelte +++ b/packages/ui/src/components/extension/StoreExtDetail.svelte @@ -286,7 +286,7 @@

README

{#if extPublish?.readme} - + {/if} diff --git a/packages/ui/src/components/extension/templates/list-view.svelte b/packages/ui/src/components/extension/templates/list-view.svelte index 5d8c863..2cb5078 100644 --- a/packages/ui/src/components/extension/templates/list-view.svelte +++ b/packages/ui/src/components/extension/templates/list-view.svelte @@ -90,6 +90,7 @@ Actions - - K + + {#if isMac} + + {:else} + Ctl + {/if} + + + + {/snippet} - + { diff --git a/packages/ui/src/components/main/GlobalCommandPaletteFooter.svelte b/packages/ui/src/components/main/GlobalCommandPaletteFooter.svelte index 4d16d51..c00f54b 100644 --- a/packages/ui/src/components/main/GlobalCommandPaletteFooter.svelte +++ b/packages/ui/src/components/main/GlobalCommandPaletteFooter.svelte @@ -40,7 +40,7 @@ {#if defaultAction} {/if} {#if actionPanel}