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

Dashboard: put tasks under heading **only if it exists** #551

Open
dwertheimer opened this issue Apr 4, 2024 · 4 comments
Open

Dashboard: put tasks under heading **only if it exists** #551

dwertheimer opened this issue Apr 4, 2024 · 4 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@dwertheimer
Copy link
Collaborator

I am *super grateful for the "place tasks under heading" setting in Dashboard, which correctly puts items under "Tasks" in my daily note after my template has set up that heading. Works great. The challenge is that when I move items to a future date (e.g. +1d), it creates that heading, which on the surface is fine, but actually I would prefer that the task live alongside all the other NotePlan tasks floating at the top of future notes so that when I get to that day and run my automated script which inserts a template and looks for orphan tasks, it moves the orphans under the heading in the template "Tasks".

So I'm thinking that there are two ways to approach this:

  1. use the heading on today's date or previous, but any future calendar date, the bare task is just moved in noteplan-standard method.
  2. insert under the heading only if that heading exists in the note. don't ever create the heading.

I think #2 is easiest and most clear to communicate in the settings, but I leave it to you.

@jgclark
Copy link
Collaborator

jgclark commented Apr 4, 2024

So ... you do want the heading ... just not yet.
Alternatively, then, let's not add yet more complexity to Dashboard, but fix things in Templating land.
And/or write a Tidy function to combine duplicate headings (perhaps with an option to combine a particular duplicate heading).

@jgclark
Copy link
Collaborator

jgclark commented Sep 25, 2024

Pinging you on this one again, now that Mike is back on the team: as I think this would be good to deal with in Templating. (Which fixes similar future issues in other plugins.)

@jgclark
Copy link
Collaborator

jgclark commented Oct 9, 2024

@mikeerickson grateful for your thoughts on this.

@jgclark jgclark removed their assignment Oct 9, 2024
@jgclark jgclark added enhancement New feature or request question Further information is requested labels Oct 9, 2024
@dwertheimer
Copy link
Collaborator Author

@jgclark it doesn't really feel like a templating thing to me.
Feels like something we should add to this helper as a final optional parameter:

export function insertContentUnderHeading(destNote: CoreNoteFields, headingToFind: string, parasAsText: string, headingLevel: number = 2,**onlyIfExists=false**) {

and use this to insert the content in the note if the heading exists.
I can't think of a situation where I would want Dashboard to create the heading for me if it does not exist. So for me, this should be the default behavior...if a heading exists, items are placed underneath that heading, and if not, they are placed at the top of note (the default NotePlan behavior).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants