forked from janek/mostr
1
0
Fork 0

refactor: rename stateless tasks to activities

This commit is contained in:
xeruf 2024-10-11 22:06:18 +02:00
parent d744fb8457
commit c27ccb8282
3 changed files with 6 additions and 6 deletions

View File

@ -65,8 +65,8 @@ where
/// Build a task with informational output and optional labeled kind
pub(crate) fn build_task(name: &str, tags: Vec<Tag>, kind: Option<(&str, Kind)>) -> EventBuilder {
info!("Created {}task \"{name}\" with tags [{}]",
kind.map(|k| k.0).unwrap_or_default(),
info!("Created {} \"{name}\" with tags [{}]",
kind.map(|k| k.0).unwrap_or("task"),
tags.iter().map(format_tag).join(", "));
EventBuilder::new(kind.map(|k| k.1).unwrap_or(TASK_KIND), name, tags)
}

View File

@ -134,7 +134,7 @@ impl Task {
self.state().unwrap_or_else(|| self.default_state())
}
/// Returns None for a stateless task.
/// Returns None for activities.
pub(crate) fn state_label(&self) -> Option<ColoredString> {
self.state()
.or_else(|| Some(self.default_state()).filter(|_| self.is_task()))

View File

@ -68,7 +68,7 @@ pub(crate) struct TasksRelay {
view: Vec<EventId>,
search_depth: usize,
view_depth: usize,
pub(crate) recurse_stateless_tasks: bool,
pub(crate) recurse_activities: bool,
/// Currently active tags
tags: BTreeSet<Tag>,
@ -169,7 +169,7 @@ impl TasksRelay {
state: Default::default(),
search_depth: 4,
view_depth: 0,
recurse_stateless_tasks: true,
recurse_activities: true,
sender,
overflow: Default::default(),
@ -1092,7 +1092,7 @@ impl TasksRelay {
}
let (input, tags) = extract_tags(note.trim());
self.submit(
build_task(input, tags, Some(("stateless ", Kind::TextNote)))
build_task(input, tags, Some(("activity", Kind::TextNote)))
.add_tags(self.parent_tag())
.add_tags(self.tags.iter().cloned())
);