-
Notifications
You must be signed in to change notification settings - Fork 112
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
[gtd_helper plugin] GTD workflow support in vimflowy. #300
base: master
Are you sure you want to change the base?
Conversation
} | ||
|
||
private async getGtdNode() { | ||
this.gtdNodeRow = await this.getChildWithText(this.api.session.document.root.row, 'gtd'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting - would it be more efficient/convenient to explicitly mark the gtd nodes and persist them? there's storage meant for plugin use, this.api.setData(key, value)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah thought of storing gtdNodeRow and also all the clonedRows. But, if user ends up either deleting it or moving it somewhere might fail. quick question, does moving a node to another tree cause rowId to update?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the operation "[dd] delete -> [p] paste" doesn't change the row ID. "[y] yank" makes a new row ID though. so both semantics are possible, from the user's perspective. usually keeping the same ID is the right behavior
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, then for the first version I'll keep this logic. Will figure out a better way to cache the rowIds rather than refetching all the time.
Was also thinking using listener for any line edit and automatically recompute GTD tree. "renderLine?" or something should be the one right? Or is there a better way to do it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i dont think there's an editLine listener. 2 options:
- in document.ts, just add something like
this.emit('setLine', { ... some_info })
in the functionpublic async setLine(row: Row, line: Line)
. renderLineTokenHook
might be an ok/slightly hacky replacement, since any edited line should re-render. the hooks are like listeners, except that they can return a modified input, so your hook would just return the original input.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another option is to explicitly mark the GTD tags, e.g. "gt" in normal mode would mean "get this done today!". would be a bigger change though!
…imflowly. Create a node anywhere with "GTD" text in it and started adding your gtd tags. Adding tags like #today, #next, #soon gets automatically cloned in GTD node with their topics on calling the trigger keyboard shortcut.
d6f17ed
to
cd744e6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feel free to submit it in its current state, if you'd prefer, but maybe add something to the description warning it's still experimental or something. (you can also hold off on it if you're more comfortable with that and would prefer to wait until it's more ready)
'generate-gtd-tasks', | ||
'Generates GTD tasks for the document', | ||
async ({ session }) => { | ||
await this.processGtdAction(session); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after this, I believe you want to call
await this.api.updatedDataForRender(this.gtdNodeRow);
to make it render!
} | ||
|
||
private async getGtdNode() { | ||
this.gtdNodeRow = await this.getChildWithText(this.api.session.document.root.row, 'gtd'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i dont think there's an editLine listener. 2 options:
- in document.ts, just add something like
this.emit('setLine', { ... some_info })
in the functionpublic async setLine(row: Row, line: Line)
. renderLineTokenHook
might be an ok/slightly hacky replacement, since any edited line should re-render. the hooks are like listeners, except that they can return a modified input, so your hook would just return the original input.
} | ||
|
||
private async getGtdNode() { | ||
this.gtdNodeRow = await this.getChildWithText(this.api.session.document.root.row, 'gtd'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another option is to explicitly mark the GTD tags, e.g. "gt" in normal mode would mean "get this done today!". would be a bigger change though!
@WuTheFWasThat Sure, I'll submit once it's bit more polished! :) Will try those apis |
I'd like to add this plugin to my own Vimflowy instance but I'm not quite sure how :/ It's not available in the plugins page. Is this plugin abandoned? |
|
No worries and thank you! I just thought the implementation seemed perfect as a power feature in vimflowy. Essentially boils down to "auto clone under target node". If I could figure out how that works whole new worlds open up. Tags would become very useful. :) |
Features:
tags. ("#next", "#today", "#soon").
Adding tags like #today, #next, #soon gets automatically cloned in GTD
node with their topics on calling the trigger keyboard shortcut (default: ctrl+t).
Demo - https://drive.google.com/open?id=19JawZCatG9zfMo5FbIisMqmtxElOSqOf