[apps] Add is_enabled to app info. (#11417)

- [x] Add is_enabled to app info and the response of `app/list`.
- [x] Update TUI to have Enable/Disable button on the app detail page.
This commit is contained in:
Matthew Zeng
2026-02-12 16:30:52 -08:00
committed by GitHub
parent 8d97b5c246
commit c37560069a
22 changed files with 1106 additions and 113 deletions

View File

@@ -267,12 +267,12 @@ pub(crate) fn find_app_mentions(
}
let mut slug_counts: HashMap<String, usize> = HashMap::new();
for app in apps {
for app in apps.iter().filter(|app| app.is_enabled) {
let slug = connector_mention_slug(app);
*slug_counts.entry(slug).or_insert(0) += 1;
}
for app in apps {
for app in apps.iter().filter(|app| app.is_enabled) {
let slug = connector_mention_slug(app);
let slug_count = slug_counts.get(&slug).copied().unwrap_or(0);
if mentions.names.contains(&slug)
@@ -285,7 +285,7 @@ pub(crate) fn find_app_mentions(
}
apps.iter()
.filter(|app| selected_ids.contains(&app.id))
.filter(|app| app.is_enabled && selected_ids.contains(&app.id))
.cloned()
.collect()
}