aboutsummaryrefslogtreecommitdiff
path: root/src/app/api.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/app/api.rs')
-rw-r--r--src/app/api.rs82
1 files changed, 54 insertions, 28 deletions
diff --git a/src/app/api.rs b/src/app/api.rs
index b07c1267..364097dc 100644
--- a/src/app/api.rs
+++ b/src/app/api.rs
@@ -333,6 +333,7 @@ impl App {
if let Some(label) = params.label {
if let Some(workspace) = self.state.workspaces.get_mut(index) {
workspace.set_custom_name(label);
+ crate::logging::workspace_renamed(&workspace.id);
}
}
let workspace = self.workspace_info(index);
@@ -428,6 +429,7 @@ impl App {
.unwrap();
};
ws.set_custom_name(params.label.clone());
+ crate::logging::workspace_renamed(&ws.id);
self.schedule_session_save();
self.emit_event(crate::api::schema::EventEnvelope {
event: crate::api::schema::EventKind::WorkspaceRenamed,
@@ -604,6 +606,10 @@ impl App {
match result {
Ok(tab_idx) => {
if let Some(label) = label {
+ let workspace_id = self.state.workspaces[ws_idx].id.clone();
+ let tab_id = self
+ .public_tab_id(ws_idx, tab_idx)
+ .unwrap_or_else(|| format!("{}:{}", workspace_id, tab_idx + 1));
if let Some(tab) = self
.state
.workspaces
@@ -611,6 +617,7 @@ impl App {
.and_then(|ws| ws.tabs.get_mut(tab_idx))
{
tab.set_custom_name(label);
+ crate::logging::tab_renamed(&workspace_id, &tab_id);
}
}
if focus {
@@ -682,6 +689,10 @@ impl App {
})
.unwrap();
};
+ let workspace_id = self.state.workspaces[ws_idx].id.clone();
+ let tab_id = self
+ .public_tab_id(ws_idx, tab_idx)
+ .unwrap_or_else(|| format!("{}:{}", workspace_id, tab_idx + 1));
let Some(tab) = self
.state
.workspaces
@@ -698,6 +709,7 @@ impl App {
.unwrap();
};
tab.set_custom_name(params.label.clone());
+ crate::logging::tab_renamed(&workspace_id, &tab_id);
self.schedule_session_save();
self.emit_event(crate::api::schema::EventEnvelope {
event: crate::api::schema::EventKind::TabRenamed,
@@ -1237,6 +1249,7 @@ impl App {
});
match path {
Ok(path) => {
+ crate::logging::integration_action("install", "pi", "ok");
vec![format!("installed pi integration to {}", path.display())]
}
Err(response) => return response,
@@ -1254,16 +1267,19 @@ impl App {
.unwrap()
});
match installed {
- Ok(installed) => vec![
- format!(
- "installed claude integration hook to {}",
- installed.hook_path.display()
- ),
- format!(
- "ensured claude settings at {}",
- installed.settings_path.display()
- ),
- ],
+ Ok(installed) => {
+ crate::logging::integration_action("install", "claude", "ok");
+ vec![
+ format!(
+ "installed claude integration hook to {}",
+ installed.hook_path.display()
+ ),
+ format!(
+ "ensured claude settings at {}",
+ installed.settings_path.display()
+ ),
+ ]
+ }
Err(response) => return response,
}
}
@@ -1279,20 +1295,23 @@ impl App {
.unwrap()
});
match installed {
- Ok(installed) => vec![
- format!(
- "installed codex integration hook to {}",
- installed.hook_path.display()
- ),
- format!(
- "ensured codex hooks at {}",
- installed.hooks_path.display()
- ),
- format!(
- "ensured codex config at {}",
- installed.config_path.display()
- ),
- ],
+ Ok(installed) => {
+ crate::logging::integration_action("install", "codex", "ok");
+ vec![
+ format!(
+ "installed codex integration hook to {}",
+ installed.hook_path.display()
+ ),
+ format!(
+ "ensured codex hooks at {}",
+ installed.hooks_path.display()
+ ),
+ format!(
+ "ensured codex config at {}",
+ installed.config_path.display()
+ ),
+ ]
+ }
Err(response) => return response,
}
}
@@ -1308,10 +1327,13 @@ impl App {
.unwrap()
});
match installed {
- Ok(installed) => vec![format!(
- "installed opencode integration plugin to {}",
- installed.plugin_path.display()
- )],
+ Ok(installed) => {
+ crate::logging::integration_action("install", "opencode", "ok");
+ vec![format!(
+ "installed opencode integration plugin to {}",
+ installed.plugin_path.display()
+ )]
+ }
Err(response) => return response,
}
}
@@ -1341,6 +1363,7 @@ impl App {
});
match result {
Ok(result) => {
+ crate::logging::integration_action("uninstall", "pi", "ok");
if result.removed_extension {
vec![format!(
"removed pi integration extension at {}",
@@ -1369,6 +1392,7 @@ impl App {
});
match result {
Ok(result) => {
+ crate::logging::integration_action("uninstall", "claude", "ok");
let mut messages = Vec::new();
if result.removed_hook_file {
messages.push(format!(
@@ -1410,6 +1434,7 @@ impl App {
});
match result {
Ok(result) => {
+ crate::logging::integration_action("uninstall", "codex", "ok");
let mut messages = Vec::new();
if result.removed_hook_file {
messages.push(format!(
@@ -1455,6 +1480,7 @@ impl App {
});
match result {
Ok(result) => {
+ crate::logging::integration_action("uninstall", "opencode", "ok");
if result.removed_plugin {
vec![format!(
"removed opencode integration plugin at {}",