heyman / heynote

A dedicated scratchpad for developers
https://heynote.com
Other
3.87k stars 194 forks source link

Feature request: shortcut to hide previous blocks #152

Open pomdtr opened 8 months ago

pomdtr commented 8 months ago

Have you searched existing Github issues to see if someone has already requested this feature?

Yes

Is your feature request related to a problem? Please describe.

I often want to have a scratchpad-like view, by hiding all previous blocks

Describe the solution you'd like

Same shortcut as in the terminal: cmd+k would to clear the screen

As a in a terminal, nothing would be deleted. Instead the app would just put the current block at the top of viewport (by just scrolling up)

Describe alternatives you've considered Scrolling manually with the mouse works, but as soon as I type previous blocks are shown again.

heyman commented 8 months ago

Yes, as you've noticed, this feature interferes with Heynote's feature of having a margin of ~5 rows above/below the active which makes it a bit tricky to implement.

A potential solution would be to temporarily disable EditorView.scrollMargins for top, but then the question becomes when to turn it on again? Perhaps when the cursor position changes to a new line, and when the cursor change was not triggered by a change to the buffer content (e.g the user presses the up/down key or changes cursor position with the mouse).

pomdtr commented 8 months ago

A better solution might be to allow to zoom in / zoom out on a specific block (workflowy-style) with a shortcut. As you've said the proposed feature does not really play well with heynote design.

https://stream.new/v/WVSEwIB3g01p01SEVnMAh6w53doMtTDKZvTlyYEaxlpfQ

heyman commented 8 months ago

The zoom-in/out - while cool - is not going to happen because it doesn't fit implementation-wise with Heynote using one large Codemirror buffer.

I do believe my other proposed solution could work though.