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

Enhancement: More functional tag UI #166

Closed
Maboroshy opened this Issue May 11, 2016 · 44 comments

Comments

Projects
None yet
2 participants
@Maboroshy
Contributor

Maboroshy commented May 11, 2016

Since I started to use the app full-time my first quest was putting in and tagging all my notes. The app supports nested tags which is great and surprisingly rare feature in note apps. But tagging lot of notes wasn't really pleasant experience.

I've tagged first note with the handy "Add tag" button at the bottom. But using it for existing tag I had to type it again, no auto-completion. Ok, I've tried to drag'n'drop. Note on tag, tag on note... no drag'n'drop.

With nothing left I started tag notes with context menu which is like:

  1. Right-click on note;
  2. Find tag in folded menu;
  3. Left click on tag;
  4. Confirm it at pop-up;
  5. Click "ok" another pop-up which tells that note is finally tagged.

It's 5 actions versus 2 with drag'n'drop: left-click and drag a note on tag (or tag on note)... more like 1 really. Good there's multi-selection or that'd be thousands of clicks. A little easier but mostly the same for tag organizing.

Decided to know how much left in the middle of process. Can't do. No entry for untagged notes.

My proposals for tag UI are:

  1. Drag'n'drop everywhere: notes to tag, tags to note, tags to tag. Maybe notes to folders if there will be list of folders;
  2. Less confirmations. Tagging won't destroy anything. Maybe some statusbar message like "press ctrl-z to cancel tagging" but not much more;
  3. "Untagged" entry at the tag pane;
  4. An option for notes getting higher level tags with the nested tag;
  5. Auto-completion for "Add tag" buttons;
  6. "Add tag" buttons visible with tag pane off.

Also using notes on my android phone which knows nothing about tags it'd be very useful to have an option adding assigned tags to the note file name. Like "[tag1] [ tag2] Note name.md". Or an ability to script it with that new engine which is in the oven.

By the way the speed of development of the app is awesome. Need to compile a lot, but each version brings new needed features.

@pbek pbek added the enhancement label May 11, 2016

@pbek

This comment has been minimized.

Owner

pbek commented May 11, 2016

Thank you for your kind words and your suggestions! :)

@Maboroshy

This comment has been minimized.

Contributor

Maboroshy commented May 12, 2016

Can I get the note tag with the new scripting function?

@pbek

This comment has been minimized.

Owner

pbek commented May 12, 2016

not yet, what do you need? the names of all tags of the current note?

@pbek

This comment has been minimized.

Owner

pbek commented May 12, 2016

and what would you expect to do with it?

@Maboroshy

This comment has been minimized.

Contributor

Maboroshy commented May 12, 2016

"[tag1] [tag2] Note name.md" note files.

@pbek

This comment has been minimized.

Owner

pbek commented May 12, 2016

So you want to intercept the automatic renaming of a note file when the headline of the note is changed and choose a different name?

@Maboroshy

This comment has been minimized.

Contributor

Maboroshy commented May 12, 2016

Not sure. Don't really know how file name is generated in the app. If it's the headline comes first and file name generated based on it I think there can be two ways:

  1. The interception thing but I think it's quite deep in the app mechanics.
  2. I can just append tags to the headline and file will be renamed by app accordingly.

But I don't use owncloud so I don't really need or want headlines. And you've put this new feature to detach file names from headlines that means that somewhere you have 2 vars - "headline" and "file name". That brings third variant:
3) Take the "file name" var, store it's content to temporary var "note name" and then rename note to ([tag 1] "note name").

The problem is 1 & 2 are kinda depend on the "attached" headline and 3 depends on "detached" headline. No universal solution unless attached headline works tho-way which I really doubt it does.
So not ok for the in-app but ok for "no full feature guaranteed" script.

Also i think that it'd be good to have the ability to get and change all note variables like file name, headline, tags, creation time, folder name, etc. This way one can for example make the script to tag notes with note creation date for some kind of diary. And this date tags will nest themselves to the "diary" tag.
Or to put the note to another folder based on date. Like if I'd use the app for GTD stuff (which I do but in more simplified manner) I could make a note in "waiting" folder for a task and tag it "todo: 12.05.2016". And after 12.05.2016 it'd go to folder "overdue" or would be tagged with "overdue" tag.

I can go on and on really but it's easy for me to imagine things and harder for you to code them.

@pbek

This comment has been minimized.

Owner

pbek commented May 12, 2016

Oh, my, my.... Maybe you should start to work on QOwnNotes yourself directly. :)

@Maboroshy

This comment has been minimized.

Contributor

Maboroshy commented May 12, 2016

My personal biggest code is the 10 line bash script which controls my laptop fan. :)

@pbek

This comment has been minimized.

Owner

pbek commented May 12, 2016

That's something to build upon! :)

@Maboroshy

This comment has been minimized.

Contributor

Maboroshy commented May 12, 2016

I just thought that ideally there should be 3 vars for note name: headline, file name and in-list name so that headline or file name would not necessary change in-app note name.

And there's a navigation pane so the app parses headlines. That means if I could parse note text against some regex I could move note lines to different section of the note. That means an ability to script dynamic visually structured todo.txt format todo lists.

@pbek

This comment has been minimized.

Owner

pbek commented May 12, 2016

I think I can't follow you right now. Are we still talking about tags? And how do you want to script dynamic visually structured todo.txt format todo lists? When do you want to move note lines to different locations? If it's about copy / paste, you could already do that with the new hook introduced in v16.05.11.

@Maboroshy

This comment has been minimized.

Contributor

Maboroshy commented May 12, 2016

Looks like it's too late on my clock and I don't make sense anymore. :) I'll work the scripts out and see what they can do.

@pbek

This comment has been minimized.

Owner

pbek commented May 12, 2016

Do your worst and report back! :)

@Maboroshy

This comment has been minimized.

Contributor

Maboroshy commented May 13, 2016

Tried to combine two examples but screwed up somewhere. I know it's something stupid but my brain already got two kernel panics in the process.

Here is my code:

import QtQml 2.0

/**
 * This script will add double spaces before single line breaks on note save so markdown will render them as line breaks instead of continuous text
 */
QtObject {
    /**
     * This function is called when a note gets stored to disk
     * 
     * @param noteText string the note text
     */
    function onNoteStored(noteText) {
        // replace [line break] with [double space + line break] excluding lines with existing double spaces and double line breaks
        return noteText.replace(new RegExp(/(?<!(\n))(?!(\n\n))(?<!  )\n/g),"  \n");
    }
}
@pbek

This comment has been minimized.

Owner

pbek commented May 14, 2016

There are multiple issues.

  • function onNoteStored(fileName, noteText) takes two parameters, you have to declare your function that way
  • the function has no return value, I couldn't imagine a way to modify notes that are currently worked on... they would get altered while someone writes to them, that would be messy
  • you can test your reg exp with http://www.regexpal.com
@pbek

This comment has been minimized.

Owner

pbek commented May 14, 2016

You could of course modify your note via clipboard with the help of function insertingFromMimeDataHook(text, html) like in example https://github.com/pbek/QOwnNotes/blob/develop/doc/scripting/note-text-from-5pm-mail.qml

@Maboroshy

This comment has been minimized.

Contributor

Maboroshy commented May 14, 2016

Need to learn some QML syntax. That function things is not quite intuitive for a newbie. Looks quite steep for me. How do you debug this stuff? Shell at least give me some errors.

My regexp is well tested. I found https://regex101.com better than regexpal for debugging, it can show affected line breaks.

One thing I don't understand. I mean I can use "save hook" to run external script which will make the replacement, but is there no way to do something like this with QML?
I can understand that many writes at the very same time can be a mess, but maybe I can put delay that will make it right, like with the external script. As far as I understand "note save interval" option the app won't save again at least 1 second after previous save anyway.

@pbek

This comment has been minimized.

Owner

pbek commented May 15, 2016

QML syntax

you just need to "know" JavaScript, forget about QML for now ;)

debugging

you could use console.warn() if you want to debug in a QOwnNote release (debug logging is disabled there)
see: https://github.com/pbek/QOwnNotes/tree/develop/doc/scripting
I am looking for a better solution to make the log available, it's not easy...

writing

if you write to your current note's file QOwnNotes will show you a dialog that the note was changed externally, you don't want that. a delay would make no difference... even if you would write directly to the text edit in QOwnNotes it would drive you nuts what the cursor jumps while you are typing...

@Maboroshy

This comment has been minimized.

Contributor

Maboroshy commented May 15, 2016

Maybe I've chosen the wrong method for my task. It's more pmh_grammar.leg stuff and it's
LineBreak = " " NormalEndline. I should have locally patched it instead or ... I'll make new issue about an alternative. :)
I'll try some other thing for scripting then.

@pbek

This comment has been minimized.

Owner

pbek commented May 15, 2016

Don't forget to tell us what you want to achieve. ;)

@Maboroshy

This comment has been minimized.

Contributor

Maboroshy commented May 15, 2016

Getting moon from the sky as usual ;)

@pbek

This comment has been minimized.

Owner

pbek commented May 15, 2016

Along with the rest of the universe... nothing less... :)

@pbek

This comment has been minimized.

Owner

pbek commented May 15, 2016

But I'm currently working on your "note file name changing" script hook! ;)

@pbek

This comment has been minimized.

Owner

pbek commented May 15, 2016

Relevant for you in today's release:

  • tags and notes can now be exposed to the QML scripting engine
  • beside the note name, the file name and the note text you can also get a
    list of all assigned tag names for notes or a list of assigned tag objects
    • see examples
      for a full list of all note properties and functions
  • you can get the current note with script.currentNote() from QML
  • function onNoteStored(note) now gets a note object as parameter instead of
    just the file name and the note text
  • there now is a new scripting hook function handleNoteTextFileNameHook(note)
    that is called when a note gets stored to disk (if Allow note file name to
    be different from headline
    is enabled in the settings)
    (for Issue #166)

I made most of this release just for you ;)

@pbek

This comment has been minimized.

Owner

pbek commented May 15, 2016

@Maboroshy

This comment has been minimized.

Contributor

Maboroshy commented May 15, 2016

Very cool. In my turn I've started putting in all info about using the app with android phones into single github issue. I'll put in all what's needed to use as more features as possible and also all the obstacles still there. Adding tags will get it close to full feature.
I'm going to get the base for an article you could publish on the app site. Hope it will attract more users who like me need more than plain text android integration.
I'll post an issue as soon as text will be ready.

@pbek

This comment has been minimized.

Owner

pbek commented May 15, 2016

Nice. Which android app are you now finally using?

@pbek

This comment has been minimized.

Owner

pbek commented May 16, 2016

you will like those features from 16.05.13:

  • you now can now reload the scripting engine with Ctrl +
    + S
    • you need to do that when you modify a script
    • you can also do that with a button in the scripting settings
      • it will be done automatically when you set a script file, delete a
        script or store the settings
  • you can now open a dialog to view past status messages and the log output
    from your scripts (for Issue #166)
    • use the new script command script.log() to log to that dialog
@pbek

This comment has been minimized.

Owner

pbek commented May 16, 2016

16.05.13 is now released

@Maboroshy

This comment has been minimized.

Contributor

Maboroshy commented May 16, 2016

I'm still on MarkdownX but found Writeily Pro as another option. I'll write a little about them too.
Compiling new version now. I got less and less excuses for not learning this QML/Java syntax scripts use.

@pbek

This comment has been minimized.

Owner

pbek commented May 16, 2016

Learning how to code is never a wrong thing. ;)

@pbek

This comment has been minimized.

Owner

pbek commented May 29, 2016

in version 16.05.24

  • added tag name auto-completion when adding a tag to the current note
@pbek

This comment has been minimized.

Owner

pbek commented May 29, 2016

in version 16.05.24

  • there now is a new item in the tag list that allows you to view all untagged notes
@pbek

This comment has been minimized.

Owner

pbek commented May 29, 2016

Version 16.05.24 is now released, could you please be so kind and test the new features?

@Maboroshy

This comment has been minimized.

Contributor

Maboroshy commented May 31, 2016

It works. Looks the app considers this new entry as tag so it has such context items as edit and delete which doesn't work. But for script hook it's not a tag which is correct behaviour to me.

@pbek

This comment has been minimized.

Owner

pbek commented May 31, 2016

thank you for testing

Looks the app considers this new entry as tag so it has such context items as edit and delete which doesn't work.

can you please explain that sentence to me

@Maboroshy

This comment has been minimized.

Contributor

Maboroshy commented May 31, 2016

I mean that if you right-click "untagged" entry there are such context menu items as rename, delete and move tag which do nothing. It's a cosmetic issue which doesn't affect real usage.

@pbek

This comment has been minimized.

Owner

pbek commented May 31, 2016

Thanks for the mention, I'll see if I can fix that.

@pbek

This comment has been minimized.

Owner

pbek commented Jun 1, 2016

will be fixed in version 16.06.0...

@pbek

This comment has been minimized.

Owner

pbek commented Jun 1, 2016

and:

  • instead of the notification dialog after bulk tagging notes now a status message will be shown
@pbek

This comment has been minimized.

Owner

pbek commented Jun 1, 2016

An option for notes getting higher level tags with the nested tag

can you please explain what you are meaning?

@Maboroshy

This comment has been minimized.

Contributor

Maboroshy commented Jun 1, 2016

Lets say we have a nested tag:

QOwnNotes (0)
┣ Tagging (2)
┗ Scripting (1)

We have notes tagged with Tagging and Scripting subtags but if we'd choose QOwnNotes we'd see no notes because none of them tagged by this specific tag. Its the same for the other big green note app some of us used before finding the lightness and elegance of QOwnNotes.

But it's not just some other tag, we've made it nested for the reason, right? And for me the reason is that Tagging and Scripting are part of my knowledge about QOwnNotes. So if I want to review QOwnNotes I should select "QOwnNotes" tag and see all notes about it including Tagging and Scripting.

I still wonder if anybody using tags which have subtags by themselves. I did that on a very rare occasions.

I guess the default is like this because how would you get the notes tagged specifically by QOwnNotes the other way.

My first thought: first click is the same and bring "without subtags" list and second click on an already selected tag would bring "with subtags" list, ideally with the number of notes changing accordingly. There can be an option to make vice versa.

But this behaviour can be not very intuitive and become a feature nobody really knows about.

@pbek

This comment has been minimized.

Owner

pbek commented Jun 1, 2016

As you were saying, I'm not sure how many would benefit from that plus It's complex to develop, will have a lot of side-effects and is not intuitive... I also have seen other applications who are treating each tag individually like QOwnNote does. I think I'll stick with the tags as they are... Thank you for your explanation!

As for the drag and drop features, I already experimented with that and I very disliked it. First selecting of items doesn't work like it use to and then you can accidentally drag items around... very annoying in my eyes... so I will drop that thought as well for now... thank you for your ideas!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment