nuttyartist / notes

Fast and beautiful note-taking app written in C++. Write down your thoughts.
https://notes-foss.com
Mozilla Public License 2.0
3.75k stars 329 forks source link

GraphicView editor - a powerful editor like OneNote #562

Open nuttyartist opened 1 year ago

nuttyartist commented 1 year ago

GraphicView editor - a powerful editor like OneNote

Example in OneNote:

test

I'm not sure how we'll represent the state of the editor using just plain text if we want to support arbitrary folders, since we need to save the position, sizes, of the different objects, and some objects don't have usual text representation (drawing?). But maybe there's a way.

zjeffer commented 1 year ago

I'm not sure how we'll represent the state of the editor using just plain text if we want to support arbitrary folders, since we need to save the position, sizes, of the different objects, and some objects don't have usual text representation (drawing?). But maybe there's a way.

Maybe use .json files? They could look something like this:


{
    "notes": {
        // random uuid:
        "e8b7c6a0-8c9b-11e8-9eb6-529269fb1459": {
            "content": "This is a note",
            "position": {
                "x": 0,
                "y": 0
            },
            "size": {
                "width": 100,
                "height": 30
            }
        },
        // random uuid:
        "e8b7c6a0-8c9b-11e8-9eb6-529269fb1459": {
            "content": "This is another note",
            "position": {
                "x": 100,
                "y": 100
            },
            "size": {
                "width": 100,
                "height": 40
            }
        }
    }
}

They don't even have to have the .json file extension, we could give it our own extension so double clicking would open the "note" in Notes.

nuttyartist commented 1 year ago

Hmm, that's a possibility.

Are .json files as syncable (not sure how to describe it) as plain .txt files? I mean, what is it that makes the storage type syncable? Is it the fact that each note is a separate file rather than one file as a database? If so, we can probably go with some of our own file type.

zjeffer commented 1 year ago

I would say json files are more syncable: say you put all notes from a GraphicView in a single json file, you only need to sync the invididual notes themselves, not the entire file. We could maybe add a "timestamp" object to every note that represents when it was last modified, and if another device has the same json file with a note uuid that has an older timestamp, we only have to update that one note.

I'm more in favour of individual json files that you can place anywhere rather than a binary format that isn't readable outside of the notes application.

movrajr commented 1 year ago

My two cents: instead of turning Notes into OneNote, I'd focus on Notes' defining features. Fast, lightweight, simplicity, locally stored, offline, and cross-platform.

I use OneNote and Notes simultaneously. OneNote for long term notes, freeform notes, images and photos, and web snippets. Notes for stream-of-thought notes, quick notes without OneNote's bulky UI, and to-do lists. (And Notepad for ephemeral notes, and Sublime Text for opening and editing technical text files.) The lack of freeform editing in Notes I consider a feature. No risk of text floating away, but neatly aligned.

After I lost a very important note due to https://github.com/nuttyartist/notes/issues/199 (I checked inside the database; it's absolutely gone) I was almost ready to ditch Notes and use OneNote exclusively. What makes me come back to Notes are those defining features. After that I consider improving the essentials of note taking (that notes are in fact taken and don't disappear) to be more useful than floating, drawing or adding multimedia. Features like note history https://github.com/nuttyartist/notes/issues/319 and an automatically rotating database backup set.

nuttyartist commented 1 year ago

The lack of freeform editing in Notes I consider a feature. No risk of text floating away, but neatly aligned.

Very well written. Great constructive criticism. I just had a shower talk with myself yesterday where I reached the same conclusion haha. I think i'm ditching oneNote style for something more structured a la Notion (but not nearly as bloated/powerful as their database plus milion other features). I'll do a mockup some day soon and I'd love to have your input. I think it could have both simplicity and some powerful features.

(that notes are in fact taken and don't disappear)

): Very sad about that, I'm sorry!

movrajr commented 1 year ago

Thanks for taking it well. I was worried it came across as rude and as hijacking the topic. But I thought, I have to speak up now, because if this feature is implemented it would make Notes less useful for me and I would probably just use OneNote exclusively.

After losing that note I started making dated backups of the note database and copying the important notes into OneNote, which is not a bad practice per se, but could be automated for the benefit of all Notes users.

nuttyartist commented 1 year ago

Thanks for taking it well. I was worried it came across as rude and as hijacking the topic. But I thought, I have to speak up now, because if this feature is implemented it would make Notes less useful for me and I would probably just use OneNote exclusively.

After losing that note I started making dated backups of the note database and copying the important notes into OneNote, which is not a bad practice per se, but could be automated for the benefit of all Notes users.

Since throughout the years I've been using VERY experimental versions of Notes on my machine I set up an automatic backup every 5 min to my cloud provider. It's a good practice. Eeven though now the databse should be stable for you, I'd still recommend it. We'll eventually switch from a database to a simple folders with plaintext structure, much more open, stable, sync friendly, etc...

Thanks for taking it well. I was worried it came across as rude and as hijacking the topic. But I thought, I have to speak up now, because if this feature is implemented it would make Notes less useful for me and I would probably just use OneNote exclusively.

I highly value the opinion of my users. Any opinion. And your arguments seems to be well constructed. And I think i'd have reached a very similar conclusion. So, thanks. I'll keep you posted to get more feedback from you! Maybe you can join our Discord channel https://discord.gg/9FTcGan7G

Darthagnon commented 1 year ago

What about storing metadata like note size/position/tags/arbitrary in markdown frontmatter? This can then be ignored (or rendered out-of-the-way, e.g. see how nppMarkdownPanel does it) by the UI and completely portable with the related notes. Possibly more useful if the plan is to move away from a database and towards plaintext files/*.md

nuttyartist commented 1 year ago

That's exactly my plan! I'm dropping the OneNote style tho. I'm wotrking right now on a proof-of-concept for the new editor. It'll use Markdown but will probably store some metadata in plaintext as well.

Can you give some examples that nppMarkdownPanel usses metadata? I couldn't find easily.

Darthagnon commented 1 year ago

Example:

notepad++_R6HMJix0gq

Hugo webpage written in markdown, with metadata in a preamble designated as frontmatter by TOML/YAML standards of +++ or --- - MarkdownPanel recognises and separates out this metadata in a code block (but in Notes it could also be hidden under a collapsible chevron or somesuch GUI element).

Hugo webpage metadata, including tags/title/author/arbitrary, are specified as, e.g.:

---
title: Bienvenido a la Casal de Cultura
date: 2023-05-14T16:21:46+01:00
lastmod: 2023-05-14T16:21:46+01:00
author: Darthagnon
avatar: /img/authors/ensenyat.jpg
# authorlink: https://author.site
cover: /img/bienvenido_grande_compressed.jpg
images:
  - /img/bienvenido_grande_compressed.jpg
# categories:
#  - category1
tags:
  - tag1
  - tag2
nolastmod: true
draft: false
---