Readit News logoReadit News
Posted by u/jonatanheyman 2 years ago
Show HN: Heynote – A dedicated scratchpad for developersheynote.com/...
Hey!

I made Heynote entirely for my own use case. For many years, I always had an Emacs instance running with the scratch buffer open, even long after I had abandoned Emacs as my programming editor in favor of more recent IDE:s.

The simplicity of having just one big scratch buffer appeals to me, but I still want to separate the different things I jot down somehow (without using tabs or similar). Previously, my solution was to insert a bunch of blank lines between the notes, but hitting C-A would still select the entire buffer. That's why I came up with the concept of "blocks", which turned out really well for my use cases.

I decided to release Heynote, thinking it might be useful to others.

jsdalton · 2 years ago
This is just outstanding. It's so exactly what I wish for out of a scratch pad.

My feature request to add to your pile (possibly a lonely one, since maybe it's just unique to how my brain works):

I really want a scratch pad like this to have UX that supports "inverted" order. Meaning, new blocks get added to the top of the page instead of the bottom. The blocks naturally flow in descending order of creation rather than ascending. The scratch pad always opens at the top of the page. Over time, blocks thus end up "decaying" toward the bottom, with the most relevant at the top.

It just fits better with how my brain works.

I also +1 the sentiment given elsewhere in this thread to bias toward ignoring the vast majority of these feature requests and preserve the simplicitly of what you've built. That includes mine!

jonatanheyman · 2 years ago
Happy you like it :).

I get the idea of the "inverted order". I wonder if it would be enough to make it configurable so that C-Enter inserts a new block before the current one + Heynote sets the cursor at the beginning of the buffer at startup (instead of last which is the current behavior)?

al_borland · 2 years ago
Another option might be to have the default scroll position at the bottom, to act more like a terminal or chat app. Scroll up to see the history, rather than scrolling down to see the latest.

(Sorry if this is how it already works, I’m on my phone right now, so I can’t download it, but I’m very interested in the block idea. I like that concept a lot for a scratch pad. I’m definitely saving this for later.)

jsdalton · 2 years ago
Yeah I was thinking similar. And/or a separate shortcut key that opens a new block at the very top of the page (regardless of where the current cursor is positioned).
dwilding · 2 years ago
Your app is awesome, it's just so satisfying to use. Really fantastic job!

My two cents on block insertion: Personally, I would love if Cmd+Enter inserts a new block at the very top

For inserting a new block in sequence, I feel like Cmd+Shift+Enter (splitting the current block) might already be enough - but I obviously haven't used heynote for long enough to have a very informed opinion on this :)

Maybe there's some way to make the behavior configurable?

smusamashah · 2 years ago
Having an option to set either behaviour the default would be a better choice here.
drBonkers · 2 years ago
That would be plenty for me!
chatmasta · 2 years ago
I also like this. But I don't like the distraction of seeing all the blocks below my cursor move every time I make a new line.

The perfect UX would be to add a new buffer at the top, but with enough padding to fill the window so that you can't see the movement of previous blocks while you're typing.

(Maybe this is already kinda how it works - I haven't downloaded the app yet, but I'm excited to try it, because it looks great!)

oezi · 2 years ago
I wrote a small Ruby TUI which works like this called Rodo (Ruby Todos). Pressing CTRL+t will get you a new Todo list (it's just markdown) at the top of a file.

https://github.com/coezbek/rodo

radley · 2 years ago
>I don't like the distraction of seeing all the blocks below my cursor move every time I make a new line.

Uhm... They don't move. They stay the same distance, relative to your line. As you add more lines, they'll disappear below the fold.

hjadal · 2 years ago
I agree that this addition would be very helpful as it is already how I take notes in a markdown document.
amadeuspagel · 2 years ago
I made a notes app that's kind of like that. Notes get added to the top and when you edit a note it gets "bumped" to the top again: https://thinktype.app/
SpaghettiCthulu · 2 years ago
TIL using the .app TLD makes your website categorically an app
vy007vikas · 2 years ago
+1. This would be great. I could then use this for daily logging as well.
breakfastduck · 2 years ago
please do this inverted order
bomewish · 2 years ago
I would probably pay for this if:

- vi bindings

- show me where the file is so I can move it around, sync it across machines, back it up, etc.

- the inverse order stuff

It's really really good. thank you.

dceddia · 2 years ago
This looks awesome! I love the blocks idea. I’m gonna download and give it a try.

I see lots of comments about Electron (per usual here haha) and I just thought I’d shout out Tauri if you hadn’t run across it. It’s basically Electron-but-in-Rust and uses the system webview instead of Chromium, so bundle size and memory usage is reduced a bunch.

I took a look at the code and it looks like you haven’t got a ton of Electron-side code so if you felt like playing with Rust it might not be too hard to swap. I have a video editing app that I started building with Electron and then switched to Tauri midway and it’s been pretty nice.

I hope it’s clear this isn’t a request and please feel free to disregard this comment entirely :)

jonatanheyman · 2 years ago
Yeah, I looked at Tauri in the beginning of the project. What made me go with Electron was the maturity and large user base. And it has actually been a bliss to work with Electron (my expectations after having worked with other cross-platform tools for mobile were extremely low), so I haven't regretted my choice. I've dealt with very few bugs. I love that there is a large ecosystem, and that it was easy to automate building (as well as auto-updating) for multiple platforms.
dceddia · 2 years ago
That makes a lot of sense. I miss a bit of that from Electron. Its auto-updater is nicer, and while I haven't had a ton of cross-browser issues there've been a couple that I had to fix with transpiling or avoiding some newer CSS stuff. Shipping everything with one browser engine lends a lot toward peace of mind.

I wish there was a way to build a stripped-down Electron, like a configurator where you could uncheck things you don't need. Printing support? WebGPU? WebRTC? Video playback? PDF reader? Straight to jail. It would be lovely. I'd love to see what would happen to the bundle size.

OccamsMirror · 2 years ago
My issue with Tauri is that it used WebKitGtk2 on Linux. Which is pretty poor from a performance perspective and missing feature support compared to WebKit on MacOS or Webview2 on Windows.
esafak · 2 years ago
I read that the Rust part was unergonomic. Do you find Tauri productive?
dceddia · 2 years ago
Yeah, it works pretty well for me. Rust definitely took some getting used to (I was new to it when I started).

There's a lot of functionality you can access from JS without needing to get into Rust, but on the Rust side Tauri has this notion of "commands" for calling Rust from the UI.

You can write a Rust function and annotate it with #[tauri::command], and register it, and then you can call it from the JS side with invoke('your_command_name', args). Those commands can be async too, so you can do blocking work on the Rust side and the UI won't freeze.

You can inject State variables into those commands, which get injected at call time and are effectively global to the Rust side. I would say the State stuff is a bit unergonomic in that you run up against needing to share them between threads, so everything inside them needs to be Arc<Mutex<>> and writing those wrappers was boilerplatey.

I wish the JS <-> Rust calling overhead were lower. It serializes everything to JSON and back, so I try to avoid too many calls, and try to avoid sending lots of data between them.

evnc · 2 years ago
I love this! Simple and solid execution. I've been wanting to build something similar for some time now, might fork and play around with it. Thank you for open sourcing it!

I've started using Obsidian with a new note for each day and separating "blocks" with a Markdown horizontal rule (`---`) to achieve something similar, but this is much cleaner.

The strength of such an approach is making capture extremely easy -- new block, start writing, no thinking about where this goes and how to fit it into pre-existing structure. I find that if I'm trying to do that, then by the time I find where my idea goes, I've lost the idea.

The downside, of course, is finding things again. The ability to tag or title a block and search by tag or title would be great. More ambitiously, it would be cool to experiment with incorporating LLMs and embeddings to automatically tag, summarize, categorize, cluster etc. your blocks.

There's a lot of different directions one could take this, but I'll echo the sentiment of others to refrain from adding too many features and losing the original appeal of simplicity. :)

Also: How do you handle performance when the buffer gets very large?

mkl · 2 years ago
It's not open source, as it uses the Commons Clause which severely limits what can be done with it (the name is misleading).
prartichoke · 2 years ago
As far as a quick google search got me, it seems pretty open with the only caveat being you can't sell or monetize it... how is that not open source?
jonatanheyman · 2 years ago
I didn't put too much consideration into picking a license. If someone has compelling arguments for why I should license it differently, I would absolutely consider it.
jonatanheyman · 2 years ago
Performance is mostly handled by CodeMirror (https://codemirror.net/), the underlying editor that Heynote is built upon. It seems to handle quite large buffers well. Where I have seen some minor performance issues is when working with very large blocks in certain language modes.
niels_bom · 2 years ago
I use Obsidian for my programming notes, troubleshooting logs, thinking on “paper”, writing and checking assumptions. It’s very powerful and quite performant. AMA.
maineldc · 2 years ago
I just downloaded and installed and I am really impressed. I liked the concept of math blocks though it took me a few seconds to figure out how to change a new block into a math block. This note at the top wasn't clear to me:

⌘ + L Change block language

The phrase block language didn't trigger my "change the type of block" thinking. I might slightly rephrase like:

⌘ + L Change block language (Math, Markdown, etc.)

Otherwise, I think this is a great "scratches an itch" type project. Congrats!

jonatanheyman · 2 years ago
Good suggestion, I'll change that!
zestyping · 2 years ago
"Change block type" makes more sense then "Change block language". "Language" sounds like it could mean English, French, etc. whereas "block type" is unambiguous.
samstave · 2 years ago
All blocks should be collapsable - I was playing with it and had to enter a comment marker in some to be able to get the collapse arrow in the bar, like # in a python block, however the behavior for a python block collapsing vs another - is that the python block collapses to ' ... ' Whereas, other blocks maintain the firt row as a header, so if I label another block NOTES and collapse it, I can still see the header.

So a collapse button on every block would be nice.

I love this. Thank you.

silvestrov · 2 years ago
It would be nice with some documentation of what the Math mode supports, e.g. syntax, units, functions.

It can be difficult to figure out why some lines are interpreted ok and while others fail.

How to convert between fahrenheit and celsius?

porridgeraisin · 2 years ago
Love this. This is exactly what I need. I have been using a WhatsApp group with just me, for this purpose, until now.

Feature requests: - arch package

- would really like the results of the math to be in buffer.txt and in Ctrl+a and copy.

- changing font and color theme(I like the Nord one right now though!) Please keep it minimally colored as it is now so that changing color is just a simple matter of configuring a handful of colors as opposed to custom css. That would make it too complicated.

- support for images and media in markdown blocks would be nice to whatever extent possible. I would love it if you could copy the way vscode markdown works. Ctrl+v an image in the editor and it inserts the markdown for it and saves the image to a file. Markdown preview would be nice but I understand if you think that's out of scope.

- timestamp for blocks. especially would be nice if you could store createdAt updatedAt in the line with the infinity symbols in buffer.txt to make it easily extractable using grep and cut.

- saw that you mentioned downthread that you're working on reloading the file so that we can back it up with git or whatever. Would love that!

- is mobile possible? Through Cordova or something

Thanks for making this!

jonatanheyman · 2 years ago
> would really like the results of the math to be in buffer.txt and in Ctrl+a and copy.

Adding the results to lines that are copied from Math blocks should be doable, and I like that idea! I agree that it would also be nice with the results in buffer.txt, but because of implementation details it's harder to implement I think.

> changing font and color theme

At the moment, I'm leaning towards keeping the number of configurable settings down and not add have font color theme settings.

> timestamp for blocks. especially would be nice if you could store createdAt updatedAt in the line with the infinity symbols in buffer.txt to make it easily extractable using grep and cut.

yes, this is on the TODO

> saw that you mentioned downthread that you're working on reloading the file so that we can back it up with git or whatever. Would love that!

Yes, this too :)

> is mobile possible? Through Cordova or something

Probably not :/

bachmeier · 2 years ago
Changing the font is accessibility, not customization. I downloaded the app, opened it up, and the font was too small for it to be practical for me to use. I know it doesn't take much to fix, because I did a Ctrl-Shift-I, changed the font from 12px to 18px, and problem solved. It's not something I'm going to do over and over.
porridgeraisin · 2 years ago
> At the moment, I'm leaning towards keeping the number of configurable settings down and not add have font color theme settings.

Alright, if you ever lean the other way a tad bit, please allow configuration of fonts, I can try to contribute that feature next week. I don't mind fixed colors nearly as much.

>> is mobile possible? Through Cordova or something

> Probably not :/

Understandable. Check my comment (sibling to my parent comment) for a suggestion for the PWA you mentioned though!

porridgeraisin · 2 years ago
Adding to it:

Saw you mentioned below that you were planning to add a pwa + local storage version. In that case you can disregard my mobile request, and replace it with a download button on mobile so we can sync it to our desktop through git or drive or something.

silvestrov · 2 years ago
Font and color could be implemented by letting us add some CSS to the html page (as it is made using Electron).

This would enable using fancy CSS for some notes.

rglover · 2 years ago
This is really, really good. Just earned a permanent spot on my dock in short order.

One request (which I would happily pay for): make it so that you can run the code blocks and generate an output. I routinely crack open the browser console to test out some JS and it would be great to be able to do this right alongside my other notes.

lockyc · 2 years ago
have you tried RunJS? https://runjs.app/
rglover · 2 years ago
I haven't, thank you for sharing.
promiseofbeans · 2 years ago
You might be able to hook into the new Deno jupyter notebook feature for this
rebeccaskinner · 2 years ago
This reminds me a lot of org-mode(https://orgmode.org/). Do you have plans to add other org-like features, like evaluating code blocks? I don't personally see myself moving away from org-mode, but it would be nice to have something to recommend to people who are reluctant to use emacs, even if it's only for a single application.
jonatanheyman · 2 years ago
Oh, I haven't seen orgmode before, so I don't know what its features are. I'm not planning to add evaluation of code blocks (apart from Math blocks that is) due to the complexity it would add.
turboponyy · 2 years ago
I'm very surprised you haven't heard of org mode - your product is essentially a reimplementation.
beepbooptheory · 2 years ago
This is so much like org mode (or rather, a small subset of org mode) its fascinating and cool to me you had never even heard of it! Great minds...

Make sure to also look at org roam, it is more specifically why I won't personally have a need for Heynote any time soon, but it could maybe be inspiring for you going forward.

https://www.orgroam.com/

bradrn · 2 years ago
> Oh, I haven't seen orgmode before, so I don't know what its features are.

Essentially, it’s an environment for writing+outlining+task tracking+time management. It’s incredibly useful — you should definitely try it since you’ve used Emacs.