notecalc3 icon indicating copy to clipboard operation
notecalc3 copied to clipboard

DOM-based frontend

Open xixixao opened this issue 5 years ago • 1 comments

See https://github.com/bbodi/notecalc3/issues/6#issuecomment-749095742 for reasoning on why the current implementation is canvas based.

I get that motivation, but I think for this to be a great UI it needs to be using "native" text input, as provided by the browser / whatever platform the client is implemented in. Things that currently don't work because of this:

  1. Any text selection on mobile
  2. Double tap to select word on desktop
  3. Smooth scrolling (instead of row-based scrolling like a spreadsheet), native scrolling speed (instead of constant)
  4. Go to end of line, end of word via OS-standard keyboard shortcuts (on a mac cmd/alt arrow)
  5. Select all via keyboard shortcut (mac OS)
  6. Undo/redo (mac OS)

A lot of these things are handled already by CodeMirror / Monaco / Ace. I'd be curious whether you looked into any of these, or decided early that you didn't want to wrestle with their APIs.

Regardless kudos for this awesome project!

xixixao avatar Dec 21 '20 20:12 xixixao

I used CodeMirror for a previous version of NoteCalc (https://github.com/bbodi/notecalc2). The editor/lib itself is great, but for my usecase it was painful to use.

Point 2 and 3 can be solved with the current canvas-based solution, I noted them down, thanks for mentioning them.

Regardless, I admit I did not know that shortcuts are so different on macOS, and yes I agree that DOM based frontend would have some benefits.

However I don't see much chance to implement it in the near future, the reasoning is that mobile is just a secondary target platform currently: I use NoteCalc as a better calculator alternative on my phone, but I think the small screen and slow text editing makes NoteCalc just another calculator on mobiles, it can't utilize its feature set, so currently I would not spend much effort on it.

If however anybody is interested in it, I can help and also provide better documentation.

bbodi avatar Dec 21 '20 20:12 bbodi