feat: Reassign save search shortcut for Arc (#389)

This commit is contained in:
Ernest Iliiasov 2024-05-01 05:31:16 -07:00 committed by GitHub
parent 148c92b504
commit ebd3f25d28
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 17 additions and 3 deletions

View file

@ -0,0 +1,5 @@
---
'@hyperdx/app': patch
---
Reassign save search shortcut for Arc to CMD+SHIFT+S

View file

@ -577,10 +577,12 @@ export const RawLogTable = memo(
[highlightedLineId, onRowExpandClick, dedupLogs],
);
useHotkeys(['ArrowRight', 'j'], () => {
useHotkeys(['ArrowRight', 'ArrowDown', 'j'], e => {
e.preventDefault();
shiftHighlightedLineId(1);
});
useHotkeys(['ArrowLeft', 'k'], () => {
useHotkeys(['ArrowLeft', 'ArrowUp', 'k'], e => {
e.preventDefault();
shiftHighlightedLineId(-1);
});

View file

@ -482,8 +482,15 @@ function SearchPage() {
}
}, [selectedSavedSearch, setSearchedQuery, _searchedQuery]);
const isArcBrowser =
typeof window !== 'undefined' &&
window
.getComputedStyle?.(document.documentElement)
.getPropertyValue('--arc-palette-title');
useHotkeys(
['ctrl+s', 'meta+s'],
// Arc Browser uses CMD+S for toggling sidebar which conflicts with save search
isArcBrowser ? ['ctrl+shift+s', 'meta+shift+s'] : ['ctrl+s', 'meta+s'],
() => {
setSaveSearchModalMode('save');
},