Skip to content

Commit

Permalink
feat: Reassign save search shortcut for Arc (#389)
Browse files Browse the repository at this point in the history
  • Loading branch information
ernestii authored May 1, 2024
1 parent 148c92b commit ebd3f25
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/kind-moons-appear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hyperdx/app': patch
---

Reassign save search shortcut for Arc to CMD+SHIFT+S
6 changes: 4 additions & 2 deletions packages/app/src/LogTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

Expand Down
9 changes: 8 additions & 1 deletion packages/app/src/SearchPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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');
},
Expand Down

0 comments on commit ebd3f25

Please sign in to comment.