em icon indicating copy to clipboard operation
em copied to clipboard

Allow cursor on context home thought

Open raineorshine opened this issue 4 years ago • 6 comments

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 avatar Feb 17 '20 01:02 raineorshine

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

raineorshine avatar Jun 29 '20 18:06 raineorshine

@raineorshine I tested this on the latest dev.

  • Using the up and down arrows moves the cursor to the home thought just like any other thought. But when home icon thought is selected, the cursor selection still remains at the previous node. So on trying to edit will actually cause edit on previous node.

Screen Capture_select-area_20200630103115

  • Clicking the home icon doesn't place the cursor on the thought and still navigates to the home context.
  • Delete inside context view doesn't work at all for me for any thoughts.

shresthabijay avatar Jun 30 '20 05:06 shresthabijay

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 avatar Jul 02 '20 23:07 raineorshine

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

raineorshine avatar Aug 08 '20 16:08 raineorshine

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

UPDATE: Unless RTL will work.

raineorshine avatar Dec 26 '20 17:12 raineorshine

Hold until #495 since thought structure is changing

raineorshine avatar Jul 26 '21 15:07 raineorshine