From f11efe7278a7b2243f8c60dfcd25b126f485e6de Mon Sep 17 00:00:00 2001 From: Utkarsh Agarwal Date: Sat, 18 Oct 2025 23:58:41 +0530 Subject: [PATCH 1/2] Add Search bar Keyboard Shortcut --- index.html | 5 +++++ src/js/main.ts | 16 ++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/index.html b/index.html index 6c4ba4a..3550f27 100644 --- a/index.html +++ b/index.html @@ -218,6 +218,11 @@ class="w-full pl-10 pr-4 py-3 bg-gray-700 text-white border border-gray-600 rounded-lg focus:ring-indigo-500 focus:border-indigo-500" placeholder="Search for a tool (e.g., 'split', 'organize'...)" /> + + + diff --git a/src/js/main.ts b/src/js/main.ts index 7f9a0c3..1c15401 100644 --- a/src/js/main.ts +++ b/src/js/main.ts @@ -83,6 +83,22 @@ const init = () => { }); }); + window.addEventListener('keydown', function (e) { + const isMac = navigator.userAgent.toUpperCase().includes('MAC'); + const isCtrlK = e.ctrlKey && e.key === 'k'; + const isCmdK = isMac && e.metaKey && e.key === 'k'; + + if (isCtrlK || isCmdK) { + e.preventDefault(); + searchBar.focus(); + } + }); + + const shortcutK = document.getElementById('shortcut'); + shortcutK.textContent = navigator.userAgent.toUpperCase().includes('MAC') + ? '⌘ K' + : 'Ctrl K'; + dom.toolGrid.addEventListener('click', (e) => { // @ts-expect-error TS(2339) FIXME: Property 'closest' does not exist on type 'EventTa... Remove this comment to see the full error message const card = e.target.closest('.tool-card'); From 6bfcb30592926849cf9bbf0e1aa8e73889b83c45 Mon Sep 17 00:00:00 2001 From: Utkarsh Agarwal Date: Sun, 19 Oct 2025 20:22:45 +0530 Subject: [PATCH 2/2] fix caps on focus and ios/android disabled display --- src/js/main.ts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/js/main.ts b/src/js/main.ts index 1c15401..e7861cb 100644 --- a/src/js/main.ts +++ b/src/js/main.ts @@ -84,9 +84,10 @@ const init = () => { }); window.addEventListener('keydown', function (e) { + const key = e.key.toLowerCase(); const isMac = navigator.userAgent.toUpperCase().includes('MAC'); - const isCtrlK = e.ctrlKey && e.key === 'k'; - const isCmdK = isMac && e.metaKey && e.key === 'k'; + const isCtrlK = e.ctrlKey && key === 'k'; + const isCmdK = isMac && e.metaKey && key === 'k'; if (isCtrlK || isCmdK) { e.preventDefault(); @@ -95,9 +96,15 @@ const init = () => { }); const shortcutK = document.getElementById('shortcut'); - shortcutK.textContent = navigator.userAgent.toUpperCase().includes('MAC') - ? '⌘ K' - : 'Ctrl K'; + const isIosOrAndroid = /Android|iPhone|iPad|iPod/i.test(navigator.userAgent); + + if (isIosOrAndroid) { + shortcutK.style.display = 'none'; + } else { + shortcutK.textContent = navigator.userAgent.toUpperCase().includes('MAC') + ? '⌘ + K' + : 'Ctrl + K'; + } dom.toolGrid.addEventListener('click', (e) => { // @ts-expect-error TS(2339) FIXME: Property 'closest' does not exist on type 'EventTa... Remove this comment to see the full error message