cybersemics / em

A beautiful, minimalistic note-taking app for personal sensemaking.
Other
282 stars 107 forks source link

Allow cursor on context home thought #343

Open raineorshine opened 4 years ago

raineorshine commented 4 years ago

When in the Context View, if the thought is in the root context, it will display a home icon.

Screen Shot 2020-02-16 at 6 46 16 PM

Current Behavior

The cursor cannot be set on the home thought. Using the up and down arrows skips the home thought.

Expected Behavior

Instead of navigating to the home context, clicking the home icon should place the cursor on the thought. The home thought should not be editable, but may be deleted.

Using the up and down arrows should move the cursor to the home thought just like any other thought. This may require refactoring one or more of cursorUp, cursorDown, cursorNext, cursorPrev, nextSibling, prevSibling, selectNextEditable, selectPrevEditable, nextThoughtElement, and prevThoughtElement in order to have an elegant general solution instead of adding more special cases.

Also see: setCursor.

raineorshine commented 4 years ago

@shresthabijay Anmol confirms this has been fixed in dev. Could you test when you get the chance? Thanks!

shresthabijay commented 4 years ago

@raineorshine I tested this on the latest dev.

Screen Capture_select-area_20200630103115

raineorshine commented 4 years ago

when home icon thought is selected, the cursor selection still remains at the previous node

To remove the caret, consider the simple approach in b30b29b1. (Open to suggestions about how to cleanly move the side effect out of the reducer though.)

raineorshine commented 4 years ago

~Here is an example of testing the browser caret: https://github.com/cybersemics/em/blob/dev/src/reducers/__tests__/deleteEmptyThought.js#L219-L252~

raineorshine commented 3 years ago

Since JSDOM does not have full caret emulation, we should use Puppeteer for caret testing.

UPDATE: Unless RTL will work.

raineorshine commented 3 years ago

Hold until #495 since thought structure is changing