mirror of
https://github.com/openai/codex.git
synced 2026-04-24 06:35:50 +00:00
no review tasks
This commit is contained in:
@@ -41,6 +41,9 @@ pub struct TaskSummary {
|
||||
/// Human-friendly environment label (when available)
|
||||
pub environment_label: Option<String>,
|
||||
pub summary: DiffSummary,
|
||||
/// True when the backend reports this task as a code review.
|
||||
#[serde(default)]
|
||||
pub is_review: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
|
||||
@@ -535,6 +535,10 @@ fn map_task_list_item_to_summary(src: backend::TaskListItem) -> TaskSummary {
|
||||
environment_id: None,
|
||||
environment_label: env_label_from_status_display(src.task_status_display.as_ref()),
|
||||
summary: diff_summary_from_status_display(src.task_status_display.as_ref()),
|
||||
is_review: src
|
||||
.pull_requests
|
||||
.as_ref()
|
||||
.map_or(false, |prs| !prs.is_empty()),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ impl CloudBackend for MockClient {
|
||||
lines_added: a,
|
||||
lines_removed: d,
|
||||
},
|
||||
is_review: false,
|
||||
});
|
||||
}
|
||||
Ok(out)
|
||||
|
||||
@@ -115,7 +115,9 @@ pub async fn load_tasks(
|
||||
) -> anyhow::Result<Vec<TaskSummary>> {
|
||||
// In later milestones, add a small debounce, spinner, and error display.
|
||||
let tasks = tokio::time::timeout(Duration::from_secs(5), backend.list_tasks(env)).await??;
|
||||
Ok(tasks)
|
||||
// Hide review-only tasks from the main list.
|
||||
let filtered: Vec<TaskSummary> = tasks.into_iter().filter(|t| !t.is_review).collect();
|
||||
Ok(filtered)
|
||||
}
|
||||
|
||||
pub struct DiffOverlay {
|
||||
@@ -216,6 +218,7 @@ mod tests {
|
||||
environment_id: env.map(|s| s.to_string()),
|
||||
environment_label: None,
|
||||
summary: codex_cloud_tasks_client::DiffSummary::default(),
|
||||
is_review: false,
|
||||
});
|
||||
}
|
||||
Ok(out)
|
||||
|
||||
Reference in New Issue
Block a user