Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for multiple note buffers #265

Merged
merged 65 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
bc0a6fb
Add metadata to the beginning of the serialized buffer.
heyman Jul 15, 2024
00ec8d5
Fix broken tests
heyman Jul 15, 2024
e465696
Add test for saving and restoring cursor positions
heyman Jul 15, 2024
3bf7108
Fix race condition that could cause the editor to not scroll the curs…
heyman Jul 15, 2024
af9c930
Add test that checks that existing keys are kept in buffer files' met…
heyman Jul 16, 2024
8f2d48d
Throw error if major format version is greater than the currently sup…
heyman Jul 17, 2024
67c43df
Fix tests
heyman Jul 17, 2024
7d7f680
Add a way to display error dialogs
heyman Jul 24, 2024
a9ea489
WIP: Implement support for multiple notes
heyman Jul 24, 2024
76b1165
Place scrollbar for Language selector and Note selector within the li…
heyman Jul 24, 2024
fcbf55e
Better error message
heyman Jul 25, 2024
5f68290
Pixel push
heyman Jul 25, 2024
8d6dd45
WIP: Create new node dialog
heyman Jul 25, 2024
0a18360
WIP: Implement ability to create new notes.
heyman Jul 26, 2024
2dcd257
Sort notes in notes selector by how recent they were opened
heyman Jul 27, 2024
9ce1587
Use fuzzysearch to filter notes in NoteSelector
heyman Jul 27, 2024
509e603
Use fuzzysort to filter languages
heyman Jul 27, 2024
c2ce86d
Change to non-deprecated syntax for ::v-deep selectors
heyman Jul 27, 2024
2d8a7ff
Add ability to open/close folders in New Note dialog
heyman Aug 4, 2024
e8f8abc
Dark mode styling of New Note dialog
heyman Aug 4, 2024
93ac05d
Propagate settings changes to all cached Editor instances (and not ju…
heyman Aug 4, 2024
c635812
Minor color tweak in dark mode
heyman Aug 4, 2024
a5440b4
Don't close/close folder when New folder button is clicked
heyman Aug 4, 2024
fcec9ec
Implement support for editing notes' metadata, and ability to move no…
heyman Sep 4, 2024
f647d9c
Fix error when NoteSelector has zero results
heyman Sep 7, 2024
7bbe1f8
Fix issue with changing theme and other editor settings not propagati…
heyman Sep 10, 2024
aefe44f
WIP: Multiple notes support
heyman Sep 10, 2024
6772a45
Implement functionality for deleting notes
heyman Sep 10, 2024
b5db020
Add Changelog to docs
heyman Sep 11, 2024
5564c05
Move Changelog into separate file
heyman Sep 11, 2024
122558e
Add link to Changelog in the docs
heyman Sep 11, 2024
53cfcdb
Use relative URL for changelog link
heyman Sep 11, 2024
dd8f1ae
Remove C-p and C-n key bindings from Emacs mode
heyman Sep 12, 2024
1102b89
Remove debug log
heyman Sep 12, 2024
03dd4d2
Remove unused import
heyman Oct 3, 2024
bd93ecc
Bump version to 2.0.0-alpha
heyman Oct 6, 2024
2081b85
Build app and upload artifacts when commit message contains #build
heyman Oct 6, 2024
9b6a884
Change which Mac file is put into build artifact
heyman Oct 6, 2024
a99a9ff
Fix artifact file name
heyman Oct 7, 2024
47d8da1
Don't trigger buffer:change event when file is removed
heyman Oct 28, 2024
5cf766b
#build
heyman Oct 28, 2024
d11e90d
Check all open buffer files for changes when window gets focus
heyman Oct 29, 2024
6433158
Update docs and changelog
heyman Oct 29, 2024
cff192c
Add link to changelog and minor formatting change
heyman Oct 29, 2024
60e9ec7
Fix typo
heyman Oct 29, 2024
c153e95
Add note about breaking change (default scratch file path changed) to…
heyman Oct 29, 2024
43e5613
Show error message if failing to unserialize note data (e.g. if a not…
heyman Oct 29, 2024
94eb33c
Remove debug logging
heyman Oct 29, 2024
0a963dd
Use FileLibrary.load() method to make sure tracking of current buffer…
heyman Oct 29, 2024
0c84e11
Add attributes to prevent auto completion (for web app version)
heyman Oct 29, 2024
d06c83b
Fix issue where Escape key wouldn't work in Note selector when there …
heyman Oct 29, 2024
e242dc5
Add support for mutiple notes to web app
heyman Oct 29, 2024
87246e2
Add code comment
heyman Oct 29, 2024
1db631e
Web app: Migrate existing localStorage single buffer to buffer library
heyman Oct 29, 2024
8ab16ea
Add __TESTS__ variable to web app when the tests are running
heyman Oct 29, 2024
2f6ba8c
Fix UI bug in web app
heyman Oct 29, 2024
4223937
Fix issue of Enter keystroke within New Note dialog being picked up b…
heyman Dec 4, 2024
cf389c7
Add tests for creating new Note buffers
heyman Dec 4, 2024
418f2fc
Add support for creating new empty note buffers
heyman Dec 4, 2024
13292ab
Add "Create new..." item to the note selector dialog
heyman Dec 5, 2024
8f743cc
Bump version to 2.0.0-alpha.2
heyman Dec 5, 2024
3906c14
Fix so that clicking on "Create new" item in notes selector works
heyman Dec 6, 2024
0ecec06
Pixel push
heyman Dec 6, 2024
62ee0e0
Change terminology Note -> Buffer
heyman Dec 6, 2024
203f966
Set window title to name of current buffer
heyman Dec 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 26 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: push
jobs:
publish:
runs-on: ${{ matrix.os }}
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
if: ${{ startsWith(github.ref, 'refs/tags/v') || contains(github.event.head_commit.message, '#build') }}
permissions:
contents: write

Expand Down Expand Up @@ -50,8 +50,8 @@ jobs:

# If the commit is tagged with a version (e.g. "v1.0.0"),
# release the app after building
release: true
#release: ${{ startsWith(github.ref, 'refs/tags/v') }}
#release: true
release: ${{ startsWith(github.ref, 'refs/tags/v') }}
env:
# macOS notarization API key
APPLE_API_KEY: ~/private_keys/AuthKey.p8
Expand All @@ -61,3 +61,26 @@ jobs:
#- name: Print notarization-error.log
# run: cat notarization-error.log

- name: Upload Linux artifact
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: actions/upload-artifact@v3
with:
name: heynote-linux-${{ github.sha }}
path: release/*/Heynote_*.AppImage
retention-days: 30

- name: Upload Mac artifact
if: ${{ matrix.os == 'macos-latest' }}
uses: actions/upload-artifact@v3
with:
name: heynote-mac-arm64-${{ github.sha }}
path: release/*/Heynote_*_arm64.dmg
retention-days: 30

- name: Upload Windows artifact
if: ${{ matrix.os == 'windows-latest' }}
uses: actions/upload-artifact@v3
with:
name: heynote-windows-${{ github.sha }}
path: release/*/Heynote_*.exe
retention-days: 30
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

- Website: [heynote.com](https://heynote.com)
- Documentation: [heynote.com](https://heynote.com/docs/)
- Changelog: [heynote.com](https://heynote.com/docs/changelog/)

Heynote is a dedicated scratchpad for developers. It functions as a large persistent text buffer where you can write down anything you like. Works great for that Slack message you don't want to accidentally send, a JSON response from an API you're working with, notes from a meeting, your daily to-do list, etc.

Expand Down
1 change: 1 addition & 0 deletions assets/icons/arrow-right-black.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/arrow-right-grey.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/arrow-right-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/caret-down-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/caret-down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/caret-right-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/caret-right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
89 changes: 89 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Changelog

Here are the most notable changes in each release. For a more detailed list of changes, see the [Github Releases page](https://github.com/heyman/heynote/releases).

## 2.0.0-beta (not yet released)

### IMPORTANT (breaking change)

The default path of the scratch file has changed. If you are running a previous version of Heynote with the buffer file synchronized across multiple machines using a file synching service such as Dropbox or OneDrive, you should make sure to upgrade all machines to Heynote 2.0 at the same time (closing Heynote before) in order for the file to stay synched, since the file path for the buffer file has changed. See below for more info.

### Support for multiple note buffers.

Apart from the default Scratch note, you can now create and switch between multiple notes. By pressing `Ctrl/Cmd+S` you can create a new note from the current block (the current block will be moved into the new note). New notes are saved to the note library which is basically a directory (with sub dirs) on the disk with a `.txt` file for each note. You switch between Notes by pressing `Ctrl/Cmd+P`.

The first time you start the new version of Heynote, your existing buffer file will be migrated to the new note library. If you're using the default buffer location, that means that the existing Scratch note file will be moved from `%APP_DIR%/buffer.txt` to `%APP_DIR%/notes/scratch.txt`. If you are using a custom buffer location the existing scratch file will be moved from `%CUSTOM_DIR%/buffer.txt` to `%CUSTOM_DIR%/scratch.txt`.

### Other changes

- The file format for the buffer files has been updated to include some JSON metadata at the top of the file.
- The cursor(s) location is saved between sessions.
- Improvements when using a file syncing service (e.g. Dropbox, OneDrive) to sync the note library between machines.
- The setting for changing the color theme is now located in the program settings, instead of in the status bar.

## 1.8.0

- Performance optimizations
- Add default redo cmd that works on all Platforms. Mod+Shift+Z
- Fix bug causing editing to break for empty blocks in some cases
- Add setting for configuring the default block language
- Vue language support
- Dart Syntax
- Fix error on startup for large buffers

## 1.7.1

- Update to latest version of Electron. Fixes crash on MacOS 15 Developer Preview

## 1.7.0

- Fix "white flash" effect when resizing window in dark mode
- Add prev variable to Math blocks that holds the previous value
- Add settings button to status bar
- Add version number to settings dialog
- Persist window location when opening the app
- Copy whole current line(s) when selection(s) are empty
- Fix block corruption when deleting block content using deleteLine command
- Add PowerShell and Diff language modes
- "Always on top" setting which makes Heynote stay on top of other programs

## 1.6.0

- Added support for having Heynote in the Mac Menu Bar / Tray icon
- Ability to specify file system location of Heynote's buffer file. The buffer will automatically be reloaded if changed on disk, so this should make it possible to have the buffer automatically synced between machines using a file-syncing service such as Dropbox.
- Custom font and font size support.
- More key-binding for creating new blocks
- Syntax hightlighting support for new languages:
* Swift
* Kotlin
* Groovy
- Auto-close brackets functionality that can be turned on in settings
- Ability to change how calculations are formatted in Math blocks. See the [Docs](https://heynote.com/docs/#user-content-changing-how-the-results-of-math-blocks-are-formatted) for info on how to do this.
- There's now a Heynote webapp at [app.heynote.com](https://app.heynote.com). It's still work-in-progress, but should be usable. The buffer is stored in localStorage.
- Multiple bug fixes and minor improvement.


## 1.5.0

- Add support for the following languages
* TypeScript
* JSX
* TSX
* TOML
* C#
* Clojure
* Erlang
* Golang
* Lezer
* Ruby
* Shell
* YAML
- Various bug fixes and improvements

## 1.4.1

- Fixed issue that would sometimes cause auto formatting to freeze the app for long periods.

## 1.4.0

- Added ability to set a global hotkey for showing/hiding Heynote.
34 changes: 26 additions & 8 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Heynote Documentation

Heynote is a dedicated scratchpad for developers. It functions as a large persistent text buffer where you can write down anything you like. Works great for that Slack message you don't want to accidentally send, a JSON response from an API you're working with, notes from a meeting, your daily to-do list, etc.
[Changelog](/docs/changelog/)

Heynote is a dedicated scratchpad for developers. It functions as a large persistent text buffer where you can write down anything you like. Works great for that Slack message you don't want to accidentally send, a JSON response from an API you're working with, notes from a meeting, your daily to-do list, etc.

The Heynote buffer is divided into blocks, and each block can have its own Language set (e.g. JavaScript, JSON, Markdown, etc.). This gives you syntax highlighting and lets you auto-format that JSON response.

Expand Down Expand Up @@ -36,6 +38,8 @@ Available for Mac, Windows, and Linux.
⌥ + Shift + Enter Add new block at the start of the buffer
⌘ + ⌥ + Enter Split the current block at cursor position
⌘ + L Change block language
⌘ + S Create a new note from the current block
⌘ + P Open note selector
⌘ + Down Goto next block
⌘ + Up Goto previous block
⌘ + A Select all text in a note block. Press again to select the whole buffer
Expand All @@ -52,6 +56,8 @@ Ctrl + Shift + Enter Add new block at the end of the buffer
Alt + Shift + Enter Add new block at the start of the buffer
Ctrl + Alt + Enter Split the current block at cursor position
Ctrl + L Change block language
Ctrl + S Create a new note from the current block
Ctrl + P Open note selector
Ctrl + Down Goto next block
Ctrl + Up Goto previous block
Ctrl + A Select all text in a note block. Press again to select the whole buffer
Expand Down Expand Up @@ -95,16 +101,27 @@ format(x) = x.toLocaleString();
format(x) = x.toLocaleString('en-GB');
```


See the [Math.js format()](https://mathjs.org/docs/reference/functions/format.html) function for more info on what's supported.

## The buffer file

The default paths for the buffer data for the respective operating systems are:
## The notes library (only for Heynote 2.0, not yet released)

The notes library is a directory (with sub dirs) on the disk with a `.txt` file for each note. It's created the first time you start Heynote, with the default note file `scratch.txt` in it. The default location for the library is:

- Mac: `~/Library/Application Support/Heynote/notes/`
- Windows: `%APPDATA%\Heynote\notes\`
- Linux: `~/.config/Heynote/notes/`

You can change the path of the notes library in the settings. Heynote expects reasonably fast disk access to the notes library, so it's not recommended to use a network drive, though file syncing services like Dropbox, OneDrive, etc. should work (see below).

### Synchronizing the notes library

Heynote is built to support synchronizing the notes library (or buffer file in the case of Heynote 1.x) through file-syncing services like Dropbox, OneDrive, etc. However, note that the synchronization logic is quite simple, so editing the same note on two different machines at the same time might lead to conflicts and unexpected results.

When using a file synching service that support "offloading" of files in the cloud (removing them from the disk), it's recommended to mark the notes library as "always available offline".

As always, backup things that are important.

- Mac: `~/Library/Application Support/Heynote/buffer.txt`
- Windows: `%APPDATA%\Heynote\buffer.txt`
- Linux: `~/.config/Heynote/buffer.txt`

## Linux

Expand All @@ -118,7 +135,7 @@ libnss3
libnspr4
```

#### Wayland
### Wayland

Due to [an issue in Electron](https://github.com/electron/electron/issues/38288), the global hotkey will not work in all applications running under Wayland. In KDE it is possible to work around this limitation by adding this Kwin script:

Expand All @@ -144,3 +161,4 @@ registerShortcut('toggleHeynote', 'Toggle Heynote', 'Ctrl+Shift+H', toggleHeynot
See the [KWin scripting tutorial](https://develop.kde.org/docs/plasma/kwin/) for instructions on how to install the script.

Remember to enable the script in the KDE System Settings. It may also be necessary to go into the KDE System Settings and bind the "Toggle Heynote" key manually.

3 changes: 1 addition & 2 deletions electron/initial-content.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import os from "os";
import { keyHelpStr } from "../shared-utils/key-helper";

export const eraseInitialContent = !!process.env.ERASE_INITIAL_CONTENT

export const initialContent = `
{"formatVersion":"1.0.0","name":"Scratch"}
∞∞∞markdown
Welcome to Heynote! 👋

Expand Down
Loading
Loading