Add plan mode and plan view with per-session agent context (#210)
* feat: add plan/build mode switching and Plan view tab Add PlanView view and integrate plan tab into main layout Introduce plan_enter and plan_exit tools with icons and status strings Persist per-session agent selections in context to reduce UI flicker during mode switches * feat: enchanced plan discovery checks in header and plan view * fix(ui): align PlanView and Header with sessionDirectory logic Remove dependency on context store in header and compute sessionDirectory from session or currentDirectory Compute display and repo paths using sessionDirectory for PlanView and update path resolution Poll plan content every 3 seconds to reflect changes without heavy retries * feat(ui): improve header tab switching and add copy buttons for plan Switch header tab navigation to central UI store and auto-switch when plan is unavailable Show checkmark icon after copying file contents or path with auto-hide timeout Extend plan view path resolution to prefer session directory when present
This commit is contained in:
committed by
GitHub
parent
75f781f940
commit
f4da45a8ad
@@ -294,11 +294,53 @@ async fn handle_question_asked(
|
||||
.unwrap_or(true);
|
||||
|
||||
if should_notify {
|
||||
let (title, body) = properties
|
||||
.get("questions")
|
||||
.and_then(Value::as_array)
|
||||
.and_then(|questions| questions.first())
|
||||
.and_then(Value::as_object)
|
||||
.map(|first| {
|
||||
let header = first
|
||||
.get("header")
|
||||
.and_then(Value::as_str)
|
||||
.unwrap_or("")
|
||||
.trim();
|
||||
let question = first
|
||||
.get("question")
|
||||
.and_then(Value::as_str)
|
||||
.unwrap_or("")
|
||||
.trim();
|
||||
|
||||
let title = if header.to_ascii_lowercase().contains("plan mode") {
|
||||
"Switch to plan mode".to_string()
|
||||
} else if header.to_ascii_lowercase().contains("build agent") {
|
||||
"Switch to build mode".to_string()
|
||||
} else if !header.is_empty() {
|
||||
header.to_string()
|
||||
} else {
|
||||
"Input needed".to_string()
|
||||
};
|
||||
|
||||
let body = if !question.is_empty() {
|
||||
question.to_string()
|
||||
} else {
|
||||
"Agent is waiting for your response".to_string()
|
||||
};
|
||||
|
||||
(title, body)
|
||||
})
|
||||
.unwrap_or_else(|| {
|
||||
(
|
||||
"Input needed".to_string(),
|
||||
"Agent is waiting for your response".to_string(),
|
||||
)
|
||||
});
|
||||
|
||||
let _ = app
|
||||
.notification()
|
||||
.builder()
|
||||
.title("Input needed")
|
||||
.body("Agent is waiting for your response")
|
||||
.title(title)
|
||||
.body(body)
|
||||
.sound("Glass")
|
||||
.show();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user