tirkarthi commented on code in PR #45908:
URL: https://github.com/apache/airflow/pull/45908#discussion_r1924963227


##########
airflow/ui/src/components/SearchDags/SearchDagsButton.tsx:
##########
@@ -31,10 +32,19 @@ export const SearchDagsButton = () => {
     setIsOpen(false);
   };
 
+  useHotkeys(
+    "mod+k",
+    () => {
+      setIsOpen(true);
+    },
+    [isOpen],
+    { preventDefault: true },
+  );
+
   return (
     <Box>
       <Button justifyContent="flex-start" onClick={() => setIsOpen(true)} 
variant="subtle" w={200}>
-        <MdSearch /> Search Dags
+        <MdSearch /> Search Dags <Kbd size="lg">⌘K</Kbd>

Review Comment:
   I am using "mod+k" which should map to "ctrl+k" in Linux. I tested this in 
Ubuntu 20.04 with Firefox 132 which opens only the search bar and not the 
browser search since `preventMode` is passed as True. This is inline with the 
Chakra docs that use the Mac specific key notation as per the initial design 
discussion of the search button but I am open to change.
   
   
![image](https://github.com/user-attachments/assets/145ff671-e545-4eeb-8c99-a7a409364640)
   
   https://www.chakra-ui.com/docs/components/kbd#function-keys
   
   
https://react-hotkeys-hook.vercel.app/docs/documentation/useHotkeys/basic-usage#modifiers--special-keys
   
   > mod (which listens for ctrl on Windows/Linux and cmd on macOS)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to