(
state: State<'_, AppState>,
request: ResetModeSkillSelectionRequest,
)
| 702 | |
| 703 | #[tauri::command] |
| 704 | pub async fn reset_mode_skill_selection( |
| 705 | state: State<'_, AppState>, |
| 706 | request: ResetModeSkillSelectionRequest, |
| 707 | ) -> Result<String, String> { |
| 708 | clear_user_mode_skill_overrides(&request.mode_id) |
| 709 | .await |
| 710 | .map_err(|e| format!("Failed to reset user skill overrides: {}", e))?; |
| 711 | |
| 712 | if let Some((remote_root, entry)) = |
| 713 | resolve_remote_workspace(&state, request.workspace_path.as_deref()).await? |
| 714 | { |
| 715 | clear_project_mode_skill_selection_remote(&state, &remote_root, &entry, &request.mode_id) |
| 716 | .await?; |
| 717 | } else if let Some(workspace_root) = |
| 718 | workspace_root_from_input(request.workspace_path.as_deref()) |
| 719 | { |
| 720 | clear_project_mode_skill_selection_local(&request.mode_id, &workspace_root).await?; |
| 721 | } |
| 722 | |
| 723 | if let Err(e) = bitfun_core::service::config::reload_global_config().await { |
| 724 | log::warn!( |
| 725 | "Failed to reload global config after resetting skill selection: mode_id={}, error={}", |
| 726 | request.mode_id, |
| 727 | e |
| 728 | ); |
| 729 | } |
| 730 | |
| 731 | Ok(format!( |
| 732 | "Mode '{}' skill selection reset successfully", |
| 733 | request.mode_id |
| 734 | )) |
| 735 | } |
| 736 | |
| 737 | #[tauri::command] |
| 738 | pub async fn validate_skill_path(path: String) -> Result<SkillValidationResult, String> { |
nothing calls this directly
no test coverage detected