refactor(branch-dropdown): drop worktree parent-branch merge shortcut

Remove the parent-branch button shown beside the branch selector along
with its supporting API, command, service, model, and i18n strings.
Add migration m20260423 to drop the now-unused folder.parent_branch
column.
This commit is contained in:
xintaofei
2026-04-23 14:02:46 +08:00
parent 377ae6d8e6
commit 50c5b12d53
23 changed files with 38 additions and 128 deletions

View File

@@ -19,6 +19,7 @@ use tauri::Manager;
use crate::app_error::AppCommandError;
#[cfg(feature = "tauri-runtime")]
use crate::db::error::DbError;
#[cfg(feature = "tauri-runtime")]
use crate::db::service::folder_service;
use crate::db::AppDatabase;
use crate::models::GitCredentials;
@@ -479,40 +480,6 @@ pub async fn add_folder_to_history(
folder_service::add_folder(&db.conn, &path).await
}
pub(crate) async fn set_folder_parent_branch_core(
conn: &sea_orm::DatabaseConnection,
path: &str,
parent_branch: Option<String>,
) -> Result<(), AppCommandError> {
use crate::db::entities::folder;
use sea_orm::{ColumnTrait, EntityTrait, QueryFilter};
let row = folder::Entity::find()
.filter(folder::Column::Path.eq(path))
.filter(folder::Column::DeletedAt.is_null())
.one(conn)
.await
.map_err(|e| {
AppCommandError::database_error("Failed to query folder").with_detail(e.to_string())
})?;
if let Some(folder_model) = row {
folder_service::set_folder_parent_branch(conn, folder_model.id, parent_branch)
.await
.map_err(AppCommandError::from)?;
}
Ok(())
}
#[cfg(feature = "tauri-runtime")]
#[cfg_attr(feature = "tauri-runtime", tauri::command)]
pub async fn set_folder_parent_branch(
db: tauri::State<'_, AppDatabase>,
path: String,
parent_branch: Option<String>,
) -> Result<(), AppCommandError> {
set_folder_parent_branch_core(&db.conn, &path, parent_branch).await
}
#[cfg(feature = "tauri-runtime")]
#[cfg_attr(feature = "tauri-runtime", tauri::command)]
pub async fn remove_folder_from_history(