diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 0207048..22bf594 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,4 +1,2 @@ -github: cjpais -custom: ["https://handy.computer/donate", "https://www.paypal.me/cjpais"] -buy_me_a_coffee: cjpais -ko_fi: cjpais +github: 0xNyk +custom: ["https://0xnyk.gumroad.com/l/dictx"] diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9749e07..f447044 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -304,6 +304,7 @@ Look for issues labeled `good first issue` or `help wanted` if you're new to the ## 📞 Getting Help - **Discussions**: Ask questions in [GitHub Discussions](https://github.com/0xNyk/dictx/discussions) + ## 📜 License By contributing to Dictx, you agree that your contributions will be licensed under the MIT License. See [LICENSE](LICENSE) for details. diff --git a/src/App.tsx b/src/App.tsx index 873d084..8f16e6e 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -15,6 +15,7 @@ import AccessibilityPermissions from "./components/AccessibilityPermissions"; import Footer from "./components/footer"; import Onboarding, { AccessibilityOnboarding } from "./components/onboarding"; import { Sidebar, SidebarSection, SECTIONS_CONFIG } from "./components/Sidebar"; +import { ShortcutsDialog } from "./components/ui/ShortcutsDialog"; import { useSettings } from "./hooks/useSettings"; import { useSettingsStore } from "./stores/settingsStore"; import { commands } from "@/bindings"; @@ -38,6 +39,7 @@ function App() { const [isReturningUser, setIsReturningUser] = useState(false); const [currentSection, setCurrentSection] = useState("general"); + const [showShortcuts, setShowShortcuts] = useState(false); const { settings, updateSetting } = useSettings(); const direction = getLanguageDirection(i18n.language); const refreshAudioDevices = useSettingsStore( @@ -72,7 +74,7 @@ function App() { } }, [onboardingStep, refreshAudioDevices, refreshOutputDevices]); - // Handle keyboard shortcuts for debug mode toggle + // Handle keyboard shortcuts for debug mode toggle and shortcuts dialog useEffect(() => { const handleKeyDown = (event: KeyboardEvent) => { // Check for Ctrl+Shift+D (Windows/Linux) or Cmd+Shift+D (macOS) @@ -86,12 +88,20 @@ function App() { const currentDebugMode = settings?.debug_mode ?? false; updateSetting("debug_mode", !currentDebugMode); } + + // Show shortcuts help with "?" when no input is focused + if ( + event.key === "?" && + !event.ctrlKey && + !event.metaKey && + !(event.target instanceof HTMLInputElement) && + !(event.target instanceof HTMLTextAreaElement) + ) { + setShowShortcuts((prev) => !prev); + } }; - // Add event listener when component mounts document.addEventListener("keydown", handleKeyDown); - - // Cleanup event listener when component unmounts return () => { document.removeEventListener("keydown", handleKeyDown); }; @@ -198,6 +208,10 @@ function App() { {/* Fixed footer at bottom */}