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


##########
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:
   `userAgent` seems to be also not recommended. Agreed on "Ctrl" which will 
have more users. I have added a small util function for this which should 
default to "Ctrl" unless "Mac" is present in `appVersion` .
   
   
https://stackoverflow.com/questions/34199584/is-window-navigator-useragent-really-going-to-be-deprecated
   https://developer.mozilla.org/en-US/docs/Web/API/Navigator/userAgent



-- 
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