Skip to content

Commit

Permalink
feat: Swipe gestures on mobile have been improved, and are now enable…
Browse files Browse the repository at this point in the history
…d by default. You can turn them off from Preferences > General > Labs (#2321)
  • Loading branch information
amanharwara committed May 9, 2023
1 parent 9b1a151 commit e1bbff1
Show file tree
Hide file tree
Showing 11 changed files with 225 additions and 114 deletions.
Binary file not shown.
3 changes: 1 addition & 2 deletions packages/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@
"dependencies": {
"@ariakit/react": "^0.1.2",
"@lexical/headless": "0.10.0",
"@radix-ui/react-slot": "^1.0.1",
"contactjs": "2.1.5"
"@radix-ui/react-slot": "^1.0.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const ListItemTags: FunctionComponent<Props> = ({ hideTags, tags }) => {
}

return (
<div className="mt-1.5 flex flex-wrap gap-2 text-sm lg:text-xs">
<div className="mt-1.5 flex flex-wrap gap-2 overflow-hidden text-sm lg:text-xs">
{tags.map((tag) => (
<span
className="inline-flex items-center rounded-sm bg-passive-4-opacity-variant py-1 px-1.5 text-foreground"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const NoteListItem: FunctionComponent<DisplayableListItemProps<SNNote>> = ({
<div
ref={listItemRef}
className={classNames(
'content-list-item text-tex flex w-full cursor-pointer items-stretch',
'content-list-item flex w-full cursor-pointer items-stretch text-text',
selected && `selected border-l-2 border-solid border-accessory-tint-${tint}`,
isPreviousItemTiled && 'mt-3 border-t border-solid border-t-border',
isNextItemTiled && 'mb-3 border-b border-solid border-b-border',
Expand Down
10 changes: 9 additions & 1 deletion packages/web/src/javascripts/Components/NoteView/NoteView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ type State = {
syncTakingTooLong: boolean
monospaceFont?: boolean
plainEditorFocused?: boolean
paneGestureEnabled?: boolean

updateSavingIndicator?: boolean
editorFeatureIdentifier?: string
Expand Down Expand Up @@ -676,13 +677,19 @@ class NoteView extends AbstractComponent<NoteViewProps, State> {
PrefDefaults[PrefKey.UpdateSavingStatusIndicator],
)

const paneGestureEnabled = this.application.getPreference(
PrefKey.PaneGesturesEnabled,
PrefDefaults[PrefKey.PaneGesturesEnabled],
)

await this.reloadSpellcheck()

this.reloadLineWidth()

this.setState({
monospaceFont,
updateSavingIndicator,
paneGestureEnabled,
})

reloadFont(monospaceFont)
Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit e1bbff1

Please sign in to comment.