|
|
@@ -499,12 +499,20 @@ namespace ClankerSaddle {
|
|
|
open_sink.add(view);
|
|
|
}
|
|
|
}
|
|
|
- var display_map = yield task_display_map(tasks, goal.id);
|
|
|
+ var goal_task_rows = new Vector<TaskEntity>();
|
|
|
foreach (var task in yield tasks.list_tasks_for_goal(goal.id)) {
|
|
|
if (task.kind == TASK_KIND_GOAL_RUN) {
|
|
|
pub.run_task_id = task.id;
|
|
|
- continue;
|
|
|
+ } else {
|
|
|
+ goal_task_rows.add(task);
|
|
|
}
|
|
|
+ }
|
|
|
+ // The rows consume TaskService.display_map_for directly
|
|
|
+ // (the same computed display the queue and the dashboard
|
|
|
+ // read) plus the batch yeehaw presence set.
|
|
|
+ var display_map = yield tasks.display_map_for(goal_task_rows.to_immutable_buffer());
|
|
|
+ var yeehaw_ids = yield tasks.yeehaw_task_ids();
|
|
|
+ foreach (var task in goal_task_rows) {
|
|
|
var view = new GoalTaskView() {
|
|
|
id = task.id,
|
|
|
title = task.title,
|
|
|
@@ -530,8 +538,8 @@ namespace ClankerSaddle {
|
|
|
}
|
|
|
view.capabilities = task_caps.to_array();
|
|
|
var display = display_map.get_or_default(task.id.to_string());
|
|
|
- view.display = display != null ? ((!)display).display : task.status;
|
|
|
- view.yeehaw = display != null && ((!)display).yeehaw;
|
|
|
+ view.display = display != null ? ((!)display).status : task.status;
|
|
|
+ view.yeehaw = yeehaw_ids.has(task.id.to_string());
|
|
|
goal_tasks.add(view);
|
|
|
switch (task.status) {
|
|
|
case STATUS_DRAFT:
|
|
|
@@ -759,32 +767,6 @@ namespace ClankerSaddle {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * The goal tasks' display states + yeehaw badges in one map —
|
|
|
- * the task page's computed display (`display_of_detail`) with
|
|
|
- * the queue batch lookups.
|
|
|
- */
|
|
|
-private static async Dictionary<string, GoalTaskDisplay> task_display_map(
|
|
|
- TaskService tasks, int64 goal_id) throws GLib.Error {
|
|
|
- var map = new Dictionary<string, GoalTaskDisplay>();
|
|
|
- var listed = new Vector<TaskEntity>();
|
|
|
- foreach (var task in yield tasks.list_tasks_for_goal(goal_id)) {
|
|
|
- if (task.kind != TASK_KIND_GOAL_RUN) {
|
|
|
- listed.add(task);
|
|
|
- }
|
|
|
- }
|
|
|
- var display_map = yield tasks.display_map_for(listed.to_immutable_buffer());
|
|
|
- var yeehaw_ids = yield tasks.yeehaw_task_ids();
|
|
|
- foreach (var task in listed) {
|
|
|
- var display = display_map.get_or_default(task.id.to_string());
|
|
|
- map.set(task.id.to_string(), new GoalTaskDisplay() {
|
|
|
- display = display != null ? ((!)display).status : task.status,
|
|
|
- yeehaw = yeehaw_ids.has(task.id.to_string())
|
|
|
- });
|
|
|
- }
|
|
|
- return map;
|
|
|
- }
|
|
|
-
|
|
|
/** A flattened, clipped activity line (the current-activity display). */
|
|
|
private static string clip_line(string text, int limit) {
|
|
|
string flat = text.replace("\n", " ⏎ ").strip();
|
|
|
@@ -792,12 +774,6 @@ private static async Dictionary<string, GoalTaskDisplay> task_display_map(
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /** Display + badge pair for a goal task row. */
|
|
|
- public class GoalTaskDisplay : Object {
|
|
|
- public string display { get; set; default = ""; }
|
|
|
- public bool yeehaw { get; set; }
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* Entrypoint for /goals: the goals dashboard — every goal (newest
|
|
|
* first) with lifecycle badges, branch, priority and task counts,
|