A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
some improvements in ux
ammarahm-ed94f8981831fb
diff --git a/apps/mobile/src/components/ActionIcon/index.js b/apps/mobile/src/components/ActionIcon/index.jsindex d5bd1714f..d429aa2eb 100644--- a/apps/mobile/src/components/ActionIcon/index.js+++ b/apps/mobile/src/components/ActionIcon/index.js@@ -4,7 +4,7 @@ import { useTracked } from '../../provider';import { PressableButton } from '../PressableButton';import { SIZE } from '../../utils/SizeUtils';import { hexToRGBA, RGB_Linear_Shade } from '../../utils/ColorUtils';-import { showTooltip } from '../../utils';+import { showTooltip, TOOLTIP_POSITIONS } from '../../utils';export const ActionIcon = ({onPress,@@ -22,7 +22,8 @@ export const ActionIcon = ({onLongPress,tooltipText,type = 'gray',- fwdRef+ fwdRef,+ tooltipPosition = TOOLTIP_POSITIONS.TOP}) => {const [state, dispatch] = useTracked();const { colors } = state;@@ -39,7 +40,7 @@ export const ActionIcon = ({return;}if (tooltipText) {- showTooltip(event, tooltipText);+ showTooltip(event, tooltipText, tooltipPosition);}}}disabled={disabled}diff --git a/apps/mobile/src/components/Button/index.js b/apps/mobile/src/components/Button/index.jsindex f9cf1c064..8e22ae6a8 100644--- a/apps/mobile/src/components/Button/index.js+++ b/apps/mobile/src/components/Button/index.js@@ -2,7 +2,7 @@ import React from 'react';import { ActivityIndicator } from 'react-native';import Icon from 'react-native-vector-icons/MaterialCommunityIcons';import { useTracked } from '../../provider';-import { BUTTON_TYPES, showTooltip } from '../../utils';+import { BUTTON_TYPES, showTooltip, TOOLTIP_POSITIONS } from '../../utils';import { SIZE } from '../../utils/SizeUtils';import { PressableButton } from '../PressableButton';import Heading from '../Typography/Heading';@@ -59,7 +59,7 @@ export const Button = ({return;}if (tooltipText) {- showTooltip(event, tooltipText);+ showTooltip(event, tooltipText, TOOLTIP_POSITIONS.TOP);}}}disabled={loading}diff --git a/apps/mobile/src/components/SimpleList/empty.js b/apps/mobile/src/components/SimpleList/empty.jsindex 17f50a8f3..caddfad88 100644--- a/apps/mobile/src/components/SimpleList/empty.js+++ b/apps/mobile/src/components/SimpleList/empty.js@@ -23,7 +23,6 @@ export const Empty = React.memo(screen === 'Notes' && introCompleted ? 'first-note' : placeholderData.type || type,screen === 'Notes' ? 'notes' : null);-const color =colors[COLORS_NOTE[headerProps.color?.toLowerCase()] ? headerProps.color : 'accent'];return (diff --git a/apps/mobile/src/components/SimpleList/notebookheader.js b/apps/mobile/src/components/SimpleList/notebookheader.jsindex 4e889b4aa..05e66fcf3 100644--- a/apps/mobile/src/components/SimpleList/notebookheader.js+++ b/apps/mobile/src/components/SimpleList/notebookheader.js@@ -1,22 +1,36 @@-import React, { useState } from 'react';-import { Platform, View } from 'react-native';+import React, { useEffect, useRef, useState } from 'react';+import { View } from 'react-native';import { useTracked } from '../../provider';import { useMenuStore } from '../../provider/stores';import { ToastEvent } from '../../services/EventManager';+import { TipManager } from '../../services/tip-manager';import { getTotalNotes } from '../../utils';import { db } from '../../utils/database';import { SIZE } from '../../utils/SizeUtils';+import useTooltip, { useTooltipHandler } from '../../utils/use-tooltip';import { ActionIcon } from '../ActionIcon';-import { Button } from '../Button';import Heading from '../Typography/Heading';import Paragraph from '../Typography/Paragraph';-export const NotebookHeader = ({ notebook, onPress, onEditNotebook }) => {+export const NotebookHeader = ({ notebook, onEditNotebook }) => {const [state] = useTracked();const { colors } = state;const [isPinnedToMenu, setIsPinnedToMenu] = useState(db.settings.isPinned(notebook.id));const setMenuPins = useMenuStore(state => state.setMenuPins);const totalNotes = getTotalNotes(notebook);+ const tooltip = useTooltip();+ const shortcutRef = useRef();++ useTooltipHandler('notebookshortcut', () => {+ const popup = TipManager.popup('notebookshortcut');+ if (popup) {+ tooltip.show(shortcutRef, popup, 'top');+ }+ });++ useEffect(() => {+ useTooltip.present('notebookshortcut');+ }, []);const onPinNotebook = async () => {try {@@ -36,6 +50,7 @@ export const NotebookHeader = ({ notebook, onPress, onEditNotebook }) => {return (<View+ ref={tooltip.parent}style={{marginBottom: 5,padding: 0,@@ -67,6 +82,8 @@ export const NotebookHeader = ({ notebook, onPress, onEditNotebook }) => {<ActionIconname={isPinnedToMenu ? 'link-variant-off' : 'link-variant'}onPress={onPinNotebook}+ tooltipText={'Create shortcut in side menu'}+ fwdRef={shortcutRef}customStyle={{marginRight: 15,width: 40,@@ -79,6 +96,7 @@ export const NotebookHeader = ({ notebook, onPress, onEditNotebook }) => {<ActionIconsize={SIZE.lg}onPress={onEditNotebook}+ tooltipText="Edit this notebook"name="pencil"type="grayBg"color={colors.icon}diff --git a/apps/mobile/src/components/SimpleList/sectionheader.js b/apps/mobile/src/components/SimpleList/sectionheader.jsindex fa367ffde..dae7ca62a 100644--- a/apps/mobile/src/components/SimpleList/sectionheader.js+++ b/apps/mobile/src/components/SimpleList/sectionheader.js@@ -122,6 +122,7 @@ export const SectionHeader = ({ item, index, type, color, screen }) => {component: <Sort screen={screen} type={type} />});}}+ tooltipText="Change sorting of items in list"fwdRef={sortRef}title={groupBy}icon={groupOptions.sortDirection === 'asc' ? 'sort-ascending' : 'sort-descending'}@@ -142,6 +143,9 @@ export const SectionHeader = ({ item, index, type, color, screen }) => {width: 25,height: 25}}+ tooltipText={+ listMode == 'compact' ? 'Switch to normal mode' : 'Switch to compact mode'+ }fwdRef={compactModeRef}color={colors.icon}name={listMode == 'compact' ? 'view-list' : 'view-list-outline'}diff --git a/apps/mobile/src/services/tipmanager.ts b/apps/mobile/src/services/tipmanager.tsindex fe125255d..7d5198628 100644--- a/apps/mobile/src/services/tipmanager.ts+++ b/apps/mobile/src/services/tipmanager.ts@@ -25,7 +25,8 @@ type Context =| 'first-note'| 'first-editor-launch'| 'monographs'- | 'trash';+ | 'trash'+ | 'topics';export type TTip = {text: string;@@ -134,7 +135,7 @@ const tips: TTip[] = [},{text: 'Long press on any item in list to open quick actions menu.',- contexts: ['notes', 'notebook', 'notebook', 'tags']+ contexts: ['notes', 'notebook', 'notebook', 'tags', 'topics']},{text: 'Monographs enable you to share your notes in a secure and private way',@@ -150,11 +151,11 @@ const tips: TTip[] = [},{text: 'A notebook can have unlimited topics with unlimited notes.',- contexts: ['notebook']+ contexts: ['notebook', 'topics']},{text: 'You can multi-select notes and move them to a notebook at once',- contexts: ['notebook']+ contexts: ['notebook', 'topics']},{text: 'Items in trash are kept for 7 days after which they are permanently deleted.',@@ -186,6 +187,10 @@ const popups: Popup[] = [{id: 'searchreplace',text: 'Switch to search/replace mode'+ },+ {+ id: 'notebookshortcut',+ text: 'Create shortcut of this notebook in side menu'}];@@ -197,7 +202,8 @@ const placeholderTips = ['Get Notesnook on all your devices. Or even open it in browser by going to https://app.notesnook.com to access all your notes',`With note history, you can restore back to an older version of the note if you accidently deleted something.`,`When your heart speaks\, take good notes. - Judith Campbell`,- `If other\'s can read your notes\, they are not your notes anymore.`,"You can publish a note and share it with anyone. Even if they don't use Notesnook!",- 'Published notes can be encrypted. Which means only you and the person you share the password with can read them.'+ 'Published notes can be encrypted. Which means only you and the person you share the password with can read them.',+ 'You can change default font size from editor settings at the end of toolbar',+ 'The editor toolbar can be scrolled horizontally to add more formats and blocks'];diff --git a/apps/mobile/src/utils/useTooltip.ts b/apps/mobile/src/utils/useTooltip.tsindex a7c292ebb..236497637 100644--- a/apps/mobile/src/utils/useTooltip.ts+++ b/apps/mobile/src/utils/useTooltip.ts@@ -68,7 +68,7 @@ const useTooltip = () => {return { parent, show };};-type TTooltipIdentifiers = 'sectionheader' | 'searchreplace';+type TTooltipIdentifiers = 'sectionheader' | 'searchreplace' | 'notebookshortcut';export const useTooltipHandler = (id: TTooltipIdentifiers, callback: () => void) => {useEffect(() => {diff --git a/apps/mobile/src/views/Notebook/index.js b/apps/mobile/src/views/Notebook/index.jsindex fe360d57a..6d814e5c0 100644--- a/apps/mobile/src/views/Notebook/index.js+++ b/apps/mobile/src/views/Notebook/index.js@@ -118,7 +118,7 @@ export const Notebook = ({ route, navigation }) => {placeholderData={{heading: params.current.notebook.title,paragraph: 'You have not added any topics yet.',- button: 'Add a topic',+ button: 'Add first topic',action: _onPressBottomButton,loading: 'Loading notebook topics'}}