From 894b10e40e8d453d2e34a6d165e47f00f8351389 Mon Sep 17 00:00:00 2001 From: CJ Pais Date: Wed, 7 May 2025 07:56:01 -0700 Subject: [PATCH] slightly better ui --- src-tauri/capabilities/default.json | 1 + src-tauri/src/lib.rs | 2 +- src-tauri/tauri.conf.json | 2 +- src/App.css | 6 +- src/App.tsx | 10 +-- src/components/icons/HandyTextLogo.tsx | 88 +++++++++++++++++++ src/components/settings/KeyboardShortcuts.tsx | 25 +----- src/components/settings/Settings.tsx | 19 +--- 8 files changed, 103 insertions(+), 50 deletions(-) create mode 100644 src/components/icons/HandyTextLogo.tsx diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json index 379b810..e29d868 100644 --- a/src-tauri/capabilities/default.json +++ b/src-tauri/capabilities/default.json @@ -9,6 +9,7 @@ "global-shortcut:allow-is-registered", "global-shortcut:allow-register", "global-shortcut:allow-unregister", + "global-shortcut:allow-unregister-all", "macos-permissions:default" ] } diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 78c7958..d38d6f3 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -102,7 +102,7 @@ pub fn run() { app.handle().plugin( tauri_plugin_global_shortcut::Builder::new() - .with_shortcuts(["alt+space"])? // Register "alt+space" + .with_shortcuts(["alt+space", "ctrl+d"])? // Register "alt+space" .with_handler(move |app_handle_from_plugin, shortcut, event| { // Retrieve managers from state let recording_manager_state = diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 8ef7d61..33a3188 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -13,7 +13,7 @@ "windows": [ { "title": "Handy", - "width": 800, + "width": 400, "height": 600 } ], diff --git a/src/App.css b/src/App.css index 7909a38..c14d949 100644 --- a/src/App.css +++ b/src/App.css @@ -1,15 +1,15 @@ @import "tailwindcss"; -@font-face { +/* @font-face { src: url("/src/assets/fonts/ShortStack-Regular.ttf"); font-family: 'Short Stack'; font-weight: 400; font-style: normal; font-display: swap; -} +} */ :root { - font-family: 'Short Stack', sans-serif; + /* font-family: 'Short Stack', sans-serif; */ font-size: 16px; line-height: 24px; font-weight: 400; diff --git a/src/App.tsx b/src/App.tsx index 6a41559..b4e6845 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -6,6 +6,7 @@ import { requestAccessibilityPermissions, } from "tauri-plugin-macos-permissions-api"; import { register } from "@tauri-apps/plugin-global-shortcut"; +import HandyTextLogo from "./components/icons/HandyTextLogo"; function App() { const [hasAccessibility, setHasAccessibility] = useState(false); @@ -20,16 +21,12 @@ function App() { } setHasAccessibility(hasPermissions); }); - - register("ctrl+d", () => { - console.log("Ctrl+D pressed"); - }); }, []); return ( -
+
{!hasAccessibility && ( -
+

@@ -39,6 +36,7 @@ function App() {

)} +
); diff --git a/src/components/icons/HandyTextLogo.tsx b/src/components/icons/HandyTextLogo.tsx new file mode 100644 index 0000000..26ab975 --- /dev/null +++ b/src/components/icons/HandyTextLogo.tsx @@ -0,0 +1,88 @@ +import React from "react"; + +const HandyTextLogo = ({ + width, + height, +}: { + width?: number; + height?: number; +}) => { + return ( + + + + + + + + + + + + + + ); +}; + +export default HandyTextLogo; diff --git a/src/components/settings/KeyboardShortcuts.tsx b/src/components/settings/KeyboardShortcuts.tsx index cd97527..3960d48 100644 --- a/src/components/settings/KeyboardShortcuts.tsx +++ b/src/components/settings/KeyboardShortcuts.tsx @@ -14,20 +14,8 @@ export const KeyboardShortcuts: React.FC = () => { id: "transcribe", name: "Transcribe", description: "Convert speech to text", - keys: ["⌃", "⌘"], + keys: ["⌃", "Space"], }, - // { - // id: 'instruct', - // name: 'AI Chat', - // description: 'Start a conversation with AI', - // keys: ['⇧', '⌥'], - // }, - // { - // id: 'code', - // name: 'Generate Code', - // description: 'Generate code from voice input', - // keys: ['⌃', '⌥', '⌘'], - // }, ]; return ( @@ -57,17 +45,6 @@ export const KeyboardShortcuts: React.FC = () => {
))} - -
-
-
-

- Note: Keyboard shortcuts are currently managed by the system. - Custom configuration will be available in a future update. -

-
-
-
); }; diff --git a/src/components/settings/Settings.tsx b/src/components/settings/Settings.tsx index 215fc0d..1da8538 100644 --- a/src/components/settings/Settings.tsx +++ b/src/components/settings/Settings.tsx @@ -4,21 +4,10 @@ import { KeyboardShortcuts } from "./KeyboardShortcuts"; export const Settings: React.FC = () => { return ( -
-
-

Settings

- - {/* AI Configuration Section */} -
-

- AI Configuration -

- {/* */} -
- - {/* Keyboard Shortcuts Section */} -
-

+
+
+
+

Keyboard Shortcuts