NicolasPetton / Projectify

Project management for TiddlyWiki
https://projectify.wiki
MIT License
140 stars 47 forks source link

Dedicated shadow tiddler for titles #25

Closed MeneDev closed 3 years ago

MeneDev commented 3 years ago

Hi, I really like projectify so far! I was thinking about using it with streams, however streams auto-generates titles. It's not a big deal to override projectify's shadow tiddlers, but it's a small change in two relatively large files and the change is likely to collide with future updates.

For example, this is how I changed my $:/plugins/nico/projectify/ui/todo/TodoItem

\define drag-handle()
  <$draggable
    tag="span"
    class="py-drag-handle"
    tiddler={{!!title}}>
      {{$:/plugins/nico/projectify/images/drag-handle}}
  </$draggable>
\end

\define save-actions()
  <$action-sendmessage $message="tm-auto-save-wiki"/>
\end

<div class={{{ [all[current]tag[done]then[py-todo py-completed]else[py-todo]] }}}>
  <$list filter="[<dragHandle>!is[blank]]" variable="ignore">
    <<drag-handle>>
  </$list>

  <$checkbox tag="done" actions=<<save-actions>>>
    {{||$:/plugins/nico/projectify/ui/buttons/Checkbox}}
    <$reveal type="nomatch" state="!!priority" text="">
      {{||$:/plugins/nico/projectify/ui/buttons/TodoPriority}}
    </$reveal>
    <$link to={{!!title}}>
    <$reveal type="match" state="!!stream-type" text="">
        <$view field="title"/>
    </$reveal>
    <$reveal type="nomatch" state="!!stream-type" text="">
        <$view field="text"/>
    </$reveal>
    </$link>
    <$list filter=<<py-has-todos>> variable="ignore">
      {{||$:/plugins/nico/projectify/images/pie}}
    </$list>
  </$checkbox>

  {{||$:/plugins/nico/projectify/ui/todo/TodoActions}}
</div>

Thus it would be nice to have a template tiddler for the tilte only to ease integration with other tools.

NicolasPetton commented 3 years ago

@MeneDev thanks for the suggestion.

What other tiddler did you change in Projectify for this to work?

saqimtiaz commented 3 years ago

@MeneDev I would be curious to see what the integration looks like if you could post a demo.

It would be nice to add keyboard shortcut support directly to Projectify. I'm pretty busy for the near future but might do a PR for it at some point if @NicolasPetton doesn't beat me to it.

NicolasPetton commented 3 years ago

@saqimtiaz I'd definitely love to have keyboard shortcuts in Projectify! I spend most of my time within Emacs, so that's something I really miss in Projectify currently.

MeneDev commented 3 years ago

I also changed $:/plugins/nico/projectify/ui/buttons/Scheduled

<$button
  popup="$:/state/projectify/scheduled-dropdown"
  tooltip="Today's todos"
  aria-label="Today's todos"
  class={{{ [[desktop-only ]addsuffix<tv-config-toolbar-class>] }}}
  selectedClass="tc-selected"
>
  <$list filter="[<tv-config-toolbar-icons>match[yes]]">
    <span class="py-pill-container">
      {{$:/plugins/nico/projectify/images/calendar}}
      <$list filter=<<py-has-todos-due-today-or-overdue>>>
        <div class="py-pill"></div>
      </$list>
    </span>
  </$list>
  <$list filter="[<tv-config-toolbar-text>match[yes]]">
    <span class="tc-btn-text">Today's todos</span>
  </$list>
</$button>

<$reveal state="$:/state/projectify/scheduled-dropdown" type="popup" position="below" animate="no" retain="yes">
  <div class="tc-drop-down py-scheduled-drop-down">
    <h4>Today & Overdue</h4>
    <$list
      filter=<<py-todos-due-today-or-overdue>>
      emptyMessage="""<div class="clear">🌞 All clear!</div>""">
    <$link to={{!!title}}>
    <$reveal type="match" state="!!stream-type" text="">
        <$view field="title"/>
    </$reveal>
    <$reveal type="nomatch" state="!!stream-type" text="">
        <$view field="text"/>
    </$reveal>
    </$link>
</$list>
  </div>
</$reveal>

I don't have a demo, I just add a todo tag and that's all for now. I't also need something like a "tag propagation" for streams to keep the project relation, but that's another story.

saqimtiaz commented 3 years ago

I't also need something like a "tag propagation" for streams to keep the project relation, but that's another story.

I've got something like that in mind @MeneDev

@NicolasPetton I'm expecting Jan + Feb to be really busy but could hopefully make a PR for it after that, if it is still relevant at that time.

NicolasPetton commented 3 years ago

@NicolasPetton I'm expecting Jan + Feb to be really busy but could hopefully make a PR for it after that, if it is still relevant at that time.

That'd be awesome, thanks a lot! Could we have a quick discussion about the keyboard shortcuts before you start working on this?

NicolasPetton commented 3 years ago

@MeneDev could you try the latest commit on master (61a96fa)? I've added an indirection for rendering todo items with the tiddler $:/plugins/nico/projectify/ui/todo/TodoCaption.

saqimtiaz commented 3 years ago

@NicolasPetton yep, I'll get in touch before I dive in. If you have any thoughts on what you want keyboard shortcuts for, feel free to document that in the meantime. My direct inspiration is Todoist and the affordance for moving between list items and indenting/unindenting.

NicolasPetton commented 3 years ago

My direct inspiration is Todoist and the affordance for moving between list items and indenting/unindenting.

You know Todoist better than I do, so I'll let you go ahead with your ideas. Just note that there's no "indenting" in Projectify (however there is a concept of sub-projects).

MeneDev commented 3 years ago

That was quick, awesome! I'll check it out tomorrow (13h or more I guess).

saqimtiaz commented 3 years ago

@NicolasPetton my apologies, I am tired and not being specific. By indenting I do indeed mean: "Make a subproject/task of the task above". I'll see how that best maps on to Projectify.

MeneDev commented 3 years ago

Just tried it and can confirm that it works like a charm!