feat: Added search and replace to Super notes on web/desktop. Press Ctrl+F in a super note to toggle search. (skip e2e) (#2128)

This commit is contained in:
Aman Harwara
2023-01-12 18:57:41 +05:30
committed by GitHub
parent 2fc365434f
commit 8104522658
21 changed files with 1180 additions and 45 deletions

View File

@@ -25,7 +25,14 @@ export const OPEN_NOTE_HISTORY_COMMAND = createKeyboardCommand('OPEN_NOTE_HISTOR
export const CAPTURE_SAVE_COMMAND = createKeyboardCommand('CAPTURE_SAVE_COMMAND')
export const STAR_NOTE_COMMAND = createKeyboardCommand('STAR_NOTE_COMMAND')
export const PIN_NOTE_COMMAND = createKeyboardCommand('PIN_NOTE_COMMAND')
export const SUPER_TOGGLE_SEARCH = createKeyboardCommand('SUPER_TOGGLE_SEARCH')
export const SUPER_SEARCH_TOGGLE_CASE_SENSITIVE = createKeyboardCommand('SUPER_SEARCH_TOGGLE_CASE_SENSITIVE')
export const SUPER_SEARCH_TOGGLE_REPLACE_MODE = createKeyboardCommand('SUPER_SEARCH_TOGGLE_REPLACE_MODE')
export const SUPER_SEARCH_NEXT_RESULT = createKeyboardCommand('SUPER_SEARCH_NEXT_RESULT')
export const SUPER_SEARCH_PREVIOUS_RESULT = createKeyboardCommand('SUPER_SEARCH_PREVIOUS_RESULT')
export const SUPER_SHOW_MARKDOWN_PREVIEW = createKeyboardCommand('SUPER_SHOW_MARKDOWN_PREVIEW')
export const SUPER_EXPORT_JSON = createKeyboardCommand('SUPER_EXPORT_JSON')
export const SUPER_EXPORT_MARKDOWN = createKeyboardCommand('SUPER_EXPORT_MARKDOWN')
export const SUPER_EXPORT_HTML = createKeyboardCommand('SUPER_EXPORT_HTML')

View File

@@ -24,6 +24,11 @@ import {
SUPER_SHOW_MARKDOWN_PREVIEW,
OPEN_PREFERENCES_COMMAND,
TOGGLE_DARK_MODE_COMMAND,
SUPER_TOGGLE_SEARCH,
SUPER_SEARCH_TOGGLE_CASE_SENSITIVE,
SUPER_SEARCH_NEXT_RESULT,
SUPER_SEARCH_PREVIOUS_RESULT,
SUPER_SEARCH_TOGGLE_REPLACE_MODE,
} from './KeyboardCommands'
import { KeyboardKey } from './KeyboardKey'
import { KeyboardModifier } from './KeyboardModifier'
@@ -141,6 +146,30 @@ export function getKeyboardShortcuts(platform: Platform, _environment: Environme
modifiers: [primaryModifier, KeyboardModifier.Shift],
preventDefault: true,
},
{
command: SUPER_TOGGLE_SEARCH,
key: 'f',
modifiers: [primaryModifier],
},
{
command: SUPER_SEARCH_TOGGLE_REPLACE_MODE,
key: 'h',
modifiers: [primaryModifier],
},
{
command: SUPER_SEARCH_TOGGLE_CASE_SENSITIVE,
key: 'c',
modifiers: [KeyboardModifier.Alt],
},
{
command: SUPER_SEARCH_NEXT_RESULT,
key: 'F3',
},
{
command: SUPER_SEARCH_PREVIOUS_RESULT,
key: 'F3',
modifiers: [KeyboardModifier.Shift],
},
{
command: SUPER_SHOW_MARKDOWN_PREVIEW,
key: 'm',