tirkarthi commented on code in PR #45908:
URL: https://github.com/apache/airflow/pull/45908#discussion_r1929075301
##########
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:
Looks like OS detection is known problem in JS with no standard recommended
approach. There is `navigator.platform` but it's deprecated. There is
`NavigatorUAData.platform` but it's experimental. There is `platform.js` but
is archived now. Any thoughts on this?
https://github.com/bestiejs/platform.js#readme
https://stackoverflow.com/questions/11219582/how-to-detect-my-browser-version-and-operating-system-using-javascript
https://developer.mozilla.org/en-US/docs/Web/API/NavigatorUAData/platform
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/platform#browser_compatibility
--
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]