docs: unify property columns documentation

This commit is contained in:
xeruf 2024-08-18 21:54:05 +03:00
parent 19d0fbb8fc
commit 2255abc1b8
4 changed files with 33 additions and 37 deletions

View File

@ -105,8 +105,9 @@ To stop time-tracking completely, simply move to the root of all tasks.
Dot or slash can be repeated to move to parent tasks before acting. Dot or slash can be repeated to move to parent tasks before acting.
- `:[IND][PROP]` - add property column PROP at IND or end, if it already exists remove property column PROP or IND (1-indexed) - `:[IND][PROP]` - add property column PROP at IND or end, if it already exists remove property column PROP or IND (
- `::[PROP]` - Sort by property PROP (multiple space-separated values allowed) 1-indexed), empty: list properties
- `::[PROP]` - sort by property PROP (multiple space-separated values allowed)
- `([TIME]` - list tracked times or insert timetracking with the specified offset - `([TIME]` - list tracked times or insert timetracking with the specified offset
such as `-1d`, `-15 minutes`, `yesterday 17:20`, `in 2 fortnights` such as `-1d`, `-15 minutes`, `yesterday 17:20`, `in 2 fortnights`
- `)[TIME]` - stop timetracking with optional offset - also convenience helper to move to root - `)[TIME]` - stop timetracking with optional offset - also convenience helper to move to root
@ -132,27 +133,6 @@ Property Filters:
Status descriptions can be used for example for Kanban columns or review flows. Status descriptions can be used for example for Kanban columns or review flows.
An active tag or status filter will also set that attribute for newly created tasks. An active tag or status filter will also set that attribute for newly created tasks.
### Available Columns
- `id`
- `parentid`
- `name`
- `state` - indicator of current progress
- `status` - pure task status
- `hashtags` - list of hashtags set for the task
- `tags` - values of all nostr tags associated with the event, except event tags
- `desc` - last note on the task
- `description` - accumulated notes on the task
- `path` - name including parent tasks
- `rpath` - name including parent tasks up to active task
- `time` - time tracked on this task
- `rtime` - time tracked on this tasks and all recursive subtasks
- `progress` - recursive subtask completion in percent
- `subtasks` - how many direct subtasks are complete
- TBI `depends`
For debugging: `props`, `alltags`, `descriptions`
### Notes ### Notes
- TBI = To Be Implemented - TBI = To Be Implemented
@ -209,6 +189,8 @@ The following features are not ready to be implemented
because they need conceptualization. because they need conceptualization.
Suggestions welcome! Suggestions welcome!
- Do not track time on Closed task?
- Allow adding new parent via description?
- Special commands: help, exit, tutorial, change log level - Special commands: help, exit, tutorial, change log level
- Duplicate task (subtasks? timetracking?) - Duplicate task (subtasks? timetracking?)
- What if I want to postpone a procedure, i.e. make it pending, or move it across kanban, does this make sense? - What if I want to postpone a procedure, i.e. make it pending, or move it across kanban, does this make sense?

View File

@ -15,21 +15,32 @@ pub const KINDS: [u16; 9] = [
PROCEDURE_KIND, PROCEDURE_KIND,
1630, 1631, 1632, 1633]; 1630, 1631, 1632, 1633];
pub const PROPERTY_COLUMNS: &str = "Available properties: /// Helper for available properties.
- `id` /// TODO: use formatting - bold / heading / italics - and generate from code
- `parentid` pub const PROPERTY_COLUMNS: &str =
- `name` "# Available Properties
- `state` Immutable:
- `hashtags` - `id` - unique task id
- `parentid` - unique task id of the parent, if any
- `name` - initial name of the task
- `created` - task creation timestamp
- `author` - name of the task creator
Task:
- `status` - pure task status
- `hashtags` - list of hashtags set for the task
- `tags` - values of all nostr tags associated with the event, except event tags - `tags` - values of all nostr tags associated with the event, except event tags
- `desc` - last note on the task - `desc` - last note on the task
- `description` - accumulated notes on the task - `description` - accumulated notes on the task
- `path` - name including parent tasks
- `rpath` - name including parent tasks up to active task
- `time` - time tracked on this task by you - `time` - time tracked on this task by you
Utilities:
- `state` - indicator of current progress
- `rtime` - time tracked on this tasks and its subtree by everyone - `rtime` - time tracked on this tasks and its subtree by everyone
- `progress` - recursive subtask completion in percent - `progress` - recursive subtask completion in percent
- `subtasks` - how many direct subtasks are complete"; - `subtasks` - how many direct subtasks are complete
- `path` - name including parent tasks
- `rpath` - name including parent tasks up to active task
- TBI `depends` - list all tasks this task depends on before it becomes actionable
Debugging: `pubkey`, `props`, `alltags`, `descriptions`";
pub(crate) fn build_tracking<I>(id: I) -> EventBuilder pub(crate) fn build_tracking<I>(id: I) -> EventBuilder
where where

View File

@ -139,10 +139,14 @@ impl Task {
pub(crate) fn get(&self, property: &str) -> Option<String> { pub(crate) fn get(&self, property: &str) -> Option<String> {
match property { match property {
// Static
"id" => Some(self.event.id.to_string()), "id" => Some(self.event.id.to_string()),
"parentid" => self.parent_id().map(|i| i.to_string()), "parentid" => self.parent_id().map(|i| i.to_string()),
"status" => Some(self.state_or_default().get_label()),
"name" => Some(self.event.content.clone()), "name" => Some(self.event.content.clone()),
"pubkey" => Some(self.event.pubkey.to_string()),
"created" => Some(local_datetimestamp(&self.event.created_at)),
// Dynamic
"status" => Some(self.state_or_default().get_label()),
"desc" => self.descriptions().last().cloned(), "desc" => self.descriptions().last().cloned(),
"description" => Some(self.descriptions().join(" ")), "description" => Some(self.descriptions().join(" ")),
"hashtags" => self.filter_tags(|tag| { is_hashtag(tag) }), "hashtags" => self.filter_tags(|tag| { is_hashtag(tag) }),
@ -160,8 +164,6 @@ impl Task {
"{:?}", "{:?}",
self.descriptions().collect_vec() self.descriptions().collect_vec()
)), )),
"pubkey" => Some(self.event.pubkey.to_string()),
"created" => Some(local_datetimestamp(&self.event.created_at)),
_ => { _ => {
warn!("Unknown task property {}", property); warn!("Unknown task property {}", property);
None None

View File

@ -473,8 +473,9 @@ impl Tasks {
state.get_colored_label() state.get_colored_label()
}.to_string() }.to_string()
} }
"author" => self.get_author(&task.event.pubkey),
"progress" => prog_string.clone(), "progress" => prog_string.clone(),
"author" => self.get_author(&task.event.pubkey),
"path" => self.get_task_path(Some(task.event.id)), "path" => self.get_task_path(Some(task.event.id)),
"rpath" => self.relative_path(task.event.id), "rpath" => self.relative_path(task.event.id),
// TODO format strings configurable // TODO format strings configurable
@ -719,7 +720,7 @@ impl Tasks {
let stripped = str.trim().trim_start_matches('+').trim_start_matches("in "); let stripped = str.trim().trim_start_matches('+').trim_start_matches("in ");
if let Ok(num) = stripped.parse::<i64>() { if let Ok(num) = stripped.parse::<i64>() {
self.track_at(Timestamp::from(Timestamp::now().as_u64().saturating_add_signed(num * 60))); self.track_at(Timestamp::from(Timestamp::now().as_u64().saturating_add_signed(num * 60)));
return true return true;
} }
match interim::parse_date_string(stripped, Local::now(), interim::Dialect::Us) { match interim::parse_date_string(stripped, Local::now(), interim::Dialect::Us) {
Ok(date) => Some(date.to_utc()), Ok(date) => Some(date.to_utc()),