feat: Swipe gestures on mobile have been improved, and are now enabled by default. You can turn them off from Preferences > General > Labs (#2321)

This commit is contained in:
Aman Harwara
2023-05-09 22:04:46 +05:30
committed by GitHub
parent 9b1a1510cf
commit e1bbff14b6
11 changed files with 231 additions and 120 deletions

View File

@@ -69,6 +69,7 @@ type State = {
syncTakingTooLong: boolean
monospaceFont?: boolean
plainEditorFocused?: boolean
paneGestureEnabled?: boolean
updateSavingIndicator?: boolean
editorFeatureIdentifier?: string
@@ -676,6 +677,11 @@ class NoteView extends AbstractComponent<NoteViewProps, State> {
PrefDefaults[PrefKey.UpdateSavingStatusIndicator],
)
const paneGestureEnabled = this.application.getPreference(
PrefKey.PaneGesturesEnabled,
PrefDefaults[PrefKey.PaneGesturesEnabled],
)
await this.reloadSpellcheck()
this.reloadLineWidth()
@@ -683,6 +689,7 @@ class NoteView extends AbstractComponent<NoteViewProps, State> {
this.setState({
monospaceFont,
updateSavingIndicator,
paneGestureEnabled,
})
reloadFont(monospaceFont)
@@ -893,7 +900,8 @@ class NoteView extends AbstractComponent<NoteViewProps, State> {
ref={this.editorContentRef}
>
{editorMode === 'component' && this.state.editorComponentViewer && (
<div className="component-view flex-grow">
<div className="component-view relative flex-grow">
{this.state.paneGestureEnabled && <div className="absolute top-0 left-0 h-full w-[20px] md:hidden" />}
<ComponentView
key={this.state.editorComponentViewer.identifier}
componentViewer={this.state.editorComponentViewer}