haydenull / logseq-plugin-agenda

A calendar, task manager and daily planner plugin for logseq
https://agenda.haydenhayden.com
MIT License
844 stars 44 forks source link

Scheduling for tasks outside Journal / custom queries / Default todo tag #158

Open alexjp opened 1 year ago

alexjp commented 1 year ago

Hi,

Thank you for this amazing plugin!

Could I ask just three requests?

1: Could the way to set the todo day start/end (scheduling) be done using the default logseq /schedule and /deadline, instead of the custom Agenda plugin format or with both? I find the Agenda plugin dialog to schedule the event helpfull, but it creates its own format for scheduling. I have a few queries that need the default logseq scheduling/deadline marks.

2: Is the "custom calendar" the way to set custom queries? I create a custom calendar, but then nothing happens and it isn't visible anywhere. ( the use case would be to use those same queries I have )

3: Is it possible to use a custom tag to tasks created through the agenda? context: I use default as "TODO" for quick capture of tasks, but I use "LATER" for scheduled tasks.

Hope I explained everything correctly. Thank you!

t-hex commented 1 year ago

Custom queries would be very nice to work like a todo list feed. I am usually putting everything into a Journal page and use just references to pages or tags to relate blocks to different contexts. So currently all todo items end up in plugin's default journal project. Having custom projects with ability to tell the plugin what query to use to fetch all items would give amazing flexibility on configuring custom task categories.

Maybe to exclude those tasks from journal project (and appear only in specific project), some kind of ignore query could be used or treat it as any other project and customize the query for journal project as well (e.g. tasks children to [[Daily Log]] only).

haydenull commented 1 year ago

Hi,

Thank you for this amazing plugin!

Could I ask just three requests?

1: Could the way to set the todo day start/end (scheduling) be done using the default logseq /schedule and /deadline, instead of the custom Agenda plugin format or with both? I find the Agenda plugin dialog to schedule the event helpfull, but it creates its own format for scheduling. I have a few queries that need the default logseq scheduling/deadline marks.

2: Is the "custom calendar" the way to set custom queries? I create a custom calendar, but then nothing happens and it isn't visible anywhere. ( the use case would be to use those same queries I have )

3: Is it possible to use a custom tag to tasks created through the agenda? context: I use default as "TODO" for quick capture of tasks, but I use "LATER" for scheduled tasks.

Hope I explained everything correctly. Thank you!

  1. The reason for using a custom format is that logseq does not currently support date ranges very well. (schedule + deadline was not designed for this purpose either). When logseq supports date ranges, the plugin will be adapted quickly. But you do have the ability to use custom calendar to define date ranges using schedule and deadline.

  2. Yes.

    image image

    Click the debug button, the plugin will print the query results to the console.

  3. Currently it cannot be specified, an option may be added later.

haydenull commented 1 year ago

Custom queries would be very nice to work like a todo list feed. I am usually putting everything into a Journal page and use just references to pages or tags to relate blocks to different contexts. So currently all todo items end up in plugin's default journal project. Having custom projects with ability to tell the plugin what query to use to fetch all items would give amazing flexibility on configuring custom task categories.

Maybe to exclude those tasks from journal project (and appear only in specific project), some kind of ignore query could be used or treat it as any other project and customize the query for journal project as well (e.g. tasks children to [[Daily Log]] only).

As far as I know, query is able to distinguish whether a block is on a journal or a regular page.

You can define your own query for each custom calendar to achieve your needs.

In fact, agenda's default capabilities can meet your requirements, and I usually use it that way. Use the project property to specify the project of the task. This is the document.

image

alexjp commented 1 year ago

@haydenull thanks for the reply and explanation !

I did managed to make something as a test trial... a custom calendar with a scheduled and deadline showing through multiple days because of a query.

Thanks for the help, I will try to port all my queries and put different colors to them, will be awesome if it works! :)

Btw, when I "create a custom calendar" , a question about "Control By Agenda" ... I can't seem to select yes, only NO ( clicking yes and then ok gives this error:

index.html:1 Uncaught (in promise) Error: true is not ISeqable
    at $APP.$cljs$core$seq$$ (core.cljs:1255:7)
    at $cljs$core$seq_reduce$cljs$0core$0IFn$0_invoke$0arity$03$$ (core.cljs:2500:28)
    at $APP.$cljs$core$reduce$$.$cljs$core$IFn$_invoke$arity$3$ (core.cljs:2538:1)
    at $cljs$core$transduce$$.$cljs$core$IFn$_invoke$arity$4$ (core.cljs:2614:1)
    at $APP.$cljs$core$into$$.$cljs$core$IFn$_invoke$arity$3$ (core.cljs:5274:30)
    at $logseq$graph_parser$text$extract_refs_from_mldoc_ast$$ (text.cljs:126:8)
    at core.cljs:4762:5
    at core.cljs:4762:5
    at $JSCompiler_StaticMethods_sval$$ (core.cljs:3452:10)
    at $APP.$JSCompiler_prototypeAlias$$.$cljs$core$ISeqable$_seq$arity$1$ (core.cljs:3520:5)
    at $APP.$cljs$core$seq$$ (core.cljs:1238:15)
    at $cljs$core$bounded_count$$ (core.cljs:3799:21)
    at $APP.$cljs$core$apply$$.$cljs$core$IFn$_invoke$arity$2$ (core.cljs:3965:29)
    at $APP.$cljs$core$mapcat$$.$cljs$core$IFn$_invoke$arity$variadic$ (core.cljs:5188:1)
    at $logseq$graph_parser$block$get_page_ref_names_from_properties$$ (block.cljs:173:28)
    at $logseq$graph_parser$block$get_page_refs_from_properties$$ (block.cljs:422:21)
    at $frontend$handler$page$build_page_tx$$ (editor.cljs:636:3)
    at $frontend$handler$page$create_BANG_$cljs$0core$0IFn$0_invoke$0arity$02$$ (page.cljs:172:21)
    at Gr.<anonymous> (api.cljs:541:21)
    at Gr.Tt (lsplugin.core.js:2:57483)
    at Gr.<anonymous> (lsplugin.core.js:2:92742)
    at a.emit (lsplugin.core.js:2:26980)
    at Gt.<anonymous> (lsplugin.core.js:2:87606)
    at lsplugin.core.js:2:61379
    at Array.forEach (<anonymous>)
    at Gt.listener (lsplugin.core.js:2:61364)

)

haydenull commented 1 year ago

@alexjp Control By Agenda is a field reserved for compatibility with older versions, but is no longer recommended. You can simply select No. This option will be removed in the next version.

alexjp commented 1 year ago

@haydenull OK, so i will not mind that option !

Thanks for all your help and the plugin! I was able to show with custom calendars and custom queries of what I wanted to see in the calendar.

I will try to adapt my workflow, because it seems those custom calendars don't show in the dashboard and other places.

Btw final question, if logseq does indeed get proper date ranges, are you planning for the Agenda plugin to update previous tasks created with the Agenda plugin format to that new format ?

bepolymathe commented 1 year ago
  1. The reason for using a custom format is that logseq does not currently support date ranges very well. (schedule + deadline was not designed for this purpose either). When logseq supports date ranges, the plugin will be adapted quickly. But you do have the ability to use custom calendar to define date ranges using schedule and deadline.

@alexjp

This is the reason why I think that it is necessary to use the projects to make timeblocking on the periods ("write X" "read Y"). I think it’s design for that. For todos to be made from a certain date, I use the journal and tag to the project page. For the deadline the tag #milestones is perfect !

mcopik commented 1 year ago

Custom queries would be very nice to work like a todo list feed. I am usually putting everything into a Journal page and use just references to pages or tags to relate blocks to different contexts. So currently all todo items end up in plugin's default journal project. Having custom projects with ability to tell the plugin what query to use to fetch all items would give amazing flexibility on configuring custom task categories. Maybe to exclude those tasks from journal project (and appear only in specific project), some kind of ignore query could be used or treat it as any other project and customize the query for journal project as well (e.g. tasks children to [[Daily Log]] only).

I am facing the same issue as @t-hex. I have one block that contains a daily plan with all tasks, their times, and priorities (let's call it "time block"). This is the block that I want the agenda to visualize in the calendar as journal entries, and these are tasks that I want to see sorted and outlined in the sidebar. However, I keep many of my meeting and research notes on the daily journal page under a different block (let's call this "daily log "). These are linked to actual project pages and often contain TODO notes that are processed later.

The problem is as follows: all "daily log" TODOs show up on my agenda, including the sidebar, because they are, by default, assigned the data of the journal entry. Then I get a long sidebar with all past TODOs, and the daily timeline in the sidebar is no longer useful. Besides manually moving all my meeting notes from the journal to the dedicated project page (which kind of defeats the purpose of Logseq's journal with bidirectional linking), I tried the following options:

A custom query should work as long as events are placed in both calendar and the sidebar and their original posting date is kept.