feat(title-bar): add folder-actions menu and branch dropdown with git operations

This commit is contained in:
xintaofei
2026-04-22 00:23:27 +08:00
parent 08fb508736
commit f3bdf94723
19 changed files with 1511 additions and 46 deletions

View File

@@ -450,6 +450,23 @@ pub async fn git_rebase(
Ok(Json(result))
}
#[derive(Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct GitDeleteBranchParams {
pub path: String,
pub branch_name: String,
pub force: bool,
}
pub async fn git_delete_branch(
Json(params): Json<GitDeleteBranchParams>,
) -> Result<Json<String>, AppCommandError> {
let result =
folder_commands::git_delete_branch(params.path, params.branch_name, params.force)
.await?;
Ok(Json(result))
}
#[derive(Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct GitDeleteRemoteBranchParams {

View File

@@ -243,6 +243,7 @@ pub fn build_router(state: Arc<AppState>, token: String, static_dir: std::path::
.route("/git_fetch", post(handlers::git::git_fetch))
.route("/git_commit", post(handlers::git::git_commit))
.route("/git_fetch_remote", post(handlers::git::git_fetch_remote))
.route("/git_delete_branch", post(handlers::git::git_delete_branch))
.route(
"/git_delete_remote_branch",
post(handlers::git::git_delete_remote_branch),