[go: up one dir, main page]

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

[gtd_helper plugin] GTD workflow support in vimflowy. #300

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

shadowfax92
Copy link
Contributor

Features:

  • Create a node anywhere with "GTD" text in it and started adding your gtd
    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

@WuTheFWasThat WuTheFWasThat changed the title [gtd_helper plugin] GTD workflow support in vimflowly. [gtd_helper plugin] GTD workflow support in vimflowy. Nov 18, 2018
}

private async getGtdNode() {
this.gtdNodeRow = await this.getChildWithText(this.api.session.document.root.row, 'gtd');
Copy link
Owner

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)

Copy link
Contributor Author

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?

Copy link
Owner
@WuTheFWasThat WuTheFWasThat Nov 18, 2018

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

Copy link
Contributor Author

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?

Copy link
Owner

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 function public 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.

Copy link
Owner

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.
WuTheFWasThat
WuTheFWasThat previously approved these changes Nov 18, 2018
Copy link
Owner
@WuTheFWasThat WuTheFWasThat left a 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);
Copy link
Owner

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');
Copy link
Owner

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 function public 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');
Copy link
Owner

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!

@shadowfax92
Copy link
Contributor Author

@WuTheFWasThat Sure, I'll submit once it's bit more polished! :) Will try those apis

@8utl3r
Copy link
8utl3r commented Aug 15, 2019

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?

@shadowfax92
Copy link
Contributor Author

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?
@8utl3r sorry, kind of yeah :( If you want, try merging this branch into your repo (https://github.com/shadowfax92/vimflowy/tree/plugin_gtd).

@8utl3r
Copy link
8utl3r commented Aug 15, 2019

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. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants