top | item 32494407

(no title)

bww | 3 years ago

This looks pretty cool. I've long been looking for something similar to Soulver (https://soulver.app/) that I can use on Linux. This seems promising.

One small criticism: In my opinion, no web-based writing app is useful unless the tab key inserts a tab. The default behavior of most browsers to move focus to the next field is tremendously infuriating in this context. Unfortunately, that's what happens here, at least for Firefox.

(Related: key combinations that normally perform cursor movements but which are often used by browser for navigation.)

discuss

order

madrox|3 years ago

While I tend to agree, this can break accessibility. The official WAI-ARIA authoring practices recommend Control+M. https://www.w3.org/WAI/ARIA/apg/

There should likely be an explicit override of accessibility so the visitor knows what they're getting into.

sleightofmind|3 years ago

Couldn't agree more with the last two paragraphs. Web standards purists will trot out a reference to some standard and point out the imagined (and terrifying) consequences of making the TAB or ENTER key behave just as they would in a non-web application, AKA a real data-entry program. This is just a version of the "lest thou cause thy brother to stumble" club used to nudge the religious into compliance with strictures that make no sense to them (and yeah, the quote is probably not verbatim, but hopefully the gist of it is clear).

Example: I (who am not a programmer) once wrote a tangled mess of HTML and JavaScript to accept, and tabulate data entry for rebar (reinforcing steel) estimates. I was inordinately proud of it, bird's nest of bad programming practice that it was. I could TAB or ENTER-key my way through all fields, the up and down arrows performed the same tasks as the TAB-key, just like on a desktop program.

So why was it important to do things this way, and break the conventions so dear to the heart of the standard's purist? Because this is how I (and many others) estimated rebar in the 1990's:

You sat at a wide desk or table with a set of plans 30" to 48"-wide spread out to your left (if you were lucky) and another 30"-48" of table was needed to catch the plan pages turned to reveal the one you were working on. You right hand rested on the keyboard's ten-key pad some 3-5 feet away. You didn't look at your right hand -- you looked at your left hand index finger which was glued to (and rarely left) the large page at precisely the item you wanted to enter into your tabulation program, as you entered the SAC code, the qty per unit, the number of units, the bar size number, the bend category, the grade of steel, and the total length. Your eyes never left the drawing as you did this, and immediately upon completing that line item, your left hand picked up a yellow highlighter and highlighted that item -- one of many hundreds or thousands that would be necessary in a materials take-off of any appreciable size. To force the use of the TAB-key, or the mouse to move through data-entry fields would simply guarantee that no one would use your program. Ever.

But the purist says, "Someone may stumble." Aunt Loreen said, "Sometimes the 'You shoulds' are the sh-ts."

mk12|3 years ago

I've never used Soulver, but there is a free web app https://numbr.dev that seems very similar to it.

gnramires|3 years ago

Note: I had this response typed up but didn't submit...

One related app that I absolutely love is Qalculate![1] (yes, it has a built-in exclamation for default enthusiasm :) )

It can do cool stuff like converting N (newtons) to kg.m/s^2 when you specify units as ?kg. It also converts units like 1kW x 1year = 31.55... GJ

It's fantastic for engineering and specially back-of-envelope calculations. This notepad aspect does seem useful though. One alternative is to use Jupyter notebooks, sometimes I work problems with Sage[2]+Jupyter. Sage is extremely powerful (you can do calculus, linear algebra, and more) but doesn't support units (that I know of), it's more geared toward advanced maths.

[1] https://qalculate.github.io/

[2] https://www.sagemath.org/ It's a bit on the heavy side although it's definitely worth it if you're doing a lot of math. I think the flatpak is preferred due to its significant size.

usrme|3 years ago

Might not be as comprehensive as Soulver, but here's something I've been using in a browser to fiddle with: https://cruncher.io/.

Groxx|3 years ago

> Cruncher can also automatically plot changes as you adjust a variable

Well that's pretty neat. I've seen it in fancier setups, but not something Soulver-like. It seems a lot more usable here, since practically any equation can show it.

tonyonodi|3 years ago

Gosh, everyone has made one of these haven't they?

cpow3104|3 years ago

I came here to deposit this exact same comment with one addition. Great project but seems to be lacking base support. As an engineer I need hex at least.

tonyonodi|3 years ago

Yeah, honestly this has been annoying me too, I just haven't got around to fixing it. It's using CodeMirror 6 as the editor, the author said he deliberately made this version not "break" the default tab behaviour, which I think is understandable as a library author, but that makes it my job to fix!

dugmartin|3 years ago

To save you some time, here is what I did to add tabs to CM 6 (I think I found it somewhere or I may have cobbled it together to insert two spaces):

First import things you need:

    import { indentMore, indentLess } from "@codemirror/commands"
Then create a command:

    export const insertTab: StateCommand = ({state, dispatch}) => {
      if (state.selection.ranges.some(r => !r.empty)) return indentMore({state, dispatch})
      dispatch(state.update(state.replaceSelection("  "), {scrollIntoView: true, userEvent: "input"}))
      return true
    }
and then add it to the keymap in your extensions array:

    const extensions: Extension[] = [
      ...other extensions here...,
      keymap.of([
          ...closeBracketsKeymap,
          ...defaultKeymap,
          ...searchKeymap,
          ...historyKeymap,
          ...completionKeymap,
          {key: "Tab", run: insertTab, shift: indentLess}
        ]),
    ]
and then pass the extensions array into where you setup your editor view, eg:

    const view = new EditorView({
      state: EditorState.create({
        doc: textarea.value,
        extensions
      }),
      parent: editor
    })

math-dev|3 years ago

I thought CM had some example code on how to override the tab behaviour. Might be worth checking out as I agree it sucks to not have tab = indent 4 spaces

sabellito|3 years ago

I've made this one and use it daily:

https://github.com/filipesabella/calcpad

It's electron though, if that's important to you.

anthropodie|3 years ago

Hey this is pretty cool. Instead of Electron app I would prefer it as a browser tab. Wish it could be self hosted.

justinlloyd|3 years ago

SoulVer on macOS as you know. OpalCalc on Windows. Speedcrunch on all three platforms, though I will categorically state that whilst Speedcrunch is very good, it is no Soulver/OpalCalc.

sigmaprimus|3 years ago

Good Feedback! I would think a checkbox that enables tab function would be best, how would you feel about a FF Plugin that achieves this? My only concern would be that FF has reserved that particular key and it would require special permissions to map it to your needs.

addandsubtract|3 years ago

I think it should just be a toggle on the page: "Hijack keyboard shortcuts? Y/N". Figma, Miro, Google and co do it without asking. It's something we've come to expect with web apps, so a toggle would be a fair middle ground.