diff options
| author | soryu <soryu@soryu.co> | 2026-02-17 19:40:53 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-17 19:40:53 +0000 |
| commit | 720ebdac2f64ce18e1de68d070cd3fe46f44547c (patch) | |
| tree | 58b0be6c0c137e23730dde5434469ef33a2a0525 | |
| parent | 482bed06b470a12347461ee2254ea1ad41f36aaf (diff) | |
| download | soryu-720ebdac2f64ce18e1de68d070cd3fe46f44547c.tar.gz soryu-720ebdac2f64ce18e1de68d070cd3fe46f44547c.zip | |
feat: soryu-co/soryu - makima: Fix PR creation to update base branch and prevent merge conflicts (#71)
| -rw-r--r-- | makima/frontend/src/components/contracts/ContractList.tsx | 4 | ||||
| -rw-r--r-- | makima/frontend/src/routes/contracts.tsx | 2 | ||||
| -rw-r--r-- | makima/src/daemon/worktree/manager.rs | 26 | ||||
| -rw-r--r-- | makima/src/orchestration/directive.rs | 1 |
4 files changed, 28 insertions, 5 deletions
diff --git a/makima/frontend/src/components/contracts/ContractList.tsx b/makima/frontend/src/components/contracts/ContractList.tsx index 98f8ff6..4388283 100644 --- a/makima/frontend/src/components/contracts/ContractList.tsx +++ b/makima/frontend/src/components/contracts/ContractList.tsx @@ -64,7 +64,7 @@ export function ContractList({ } return ( - <div className="panel h-full flex flex-col"> + <div className="panel h-full flex flex-col min-h-0"> {/* Header */} <div className="p-4 border-b border-dashed border-[rgba(117,170,252,0.35)]"> <div className="flex items-center justify-between mb-3"> @@ -101,7 +101,7 @@ export function ContractList({ </div> {/* Contract list */} - <div className="flex-1 overflow-y-auto"> + <div className="flex-1 min-h-0 overflow-y-auto"> {filteredContracts.length === 0 ? ( <div className="p-4 text-center"> <p className="font-mono text-sm text-[#555]"> diff --git a/makima/frontend/src/routes/contracts.tsx b/makima/frontend/src/routes/contracts.tsx index 7046f66..b85d667 100644 --- a/makima/frontend/src/routes/contracts.tsx +++ b/makima/frontend/src/routes/contracts.tsx @@ -522,7 +522,7 @@ function ContractsPageContent() { ); return ( - <div className="relative z-10 min-h-screen flex flex-col bg-[#0a1628]"> + <div className="relative z-10 h-screen flex flex-col overflow-hidden bg-[#0a1628]"> <Masthead showNav /> <main className="flex-1 flex overflow-hidden" style={{ height: "calc(100vh - 80px)" }}> {/* Left: Contract list */} diff --git a/makima/src/daemon/worktree/manager.rs b/makima/src/daemon/worktree/manager.rs index 5df9a73..c27bcf6 100644 --- a/makima/src/daemon/worktree/manager.rs +++ b/makima/src/daemon/worktree/manager.rs @@ -484,7 +484,29 @@ impl WorktreeManager { "Creating worktree with new branch" ); - // Create the worktree with a new branch based on the local base_branch + // Prefer origin/{base_branch} to get latest remote state + let origin_ref = format!("origin/{}", base_branch); + let has_origin_ref = Command::new("git") + .args(["rev-parse", "--verify", &format!("refs/remotes/{}", origin_ref)]) + .current_dir(source_repo) + .output() + .await + .map(|o| o.status.success()) + .unwrap_or(false); + + let start_point = if has_origin_ref { + origin_ref.as_str() + } else { + base_branch + }; + + tracing::info!( + task_id = %task_id, + start_point = %start_point, + "Using start point for new worktree branch" + ); + + // Create the worktree with a new branch based on the start point let output = Command::new("git") .args([ "worktree", @@ -493,7 +515,7 @@ impl WorktreeManager { &branch_name, ]) .arg(&worktree_path) - .arg(base_branch) + .arg(start_point) .current_dir(source_repo) .output() .await?; diff --git a/makima/src/orchestration/directive.rs b/makima/src/orchestration/directive.rs index 21053f3..a6bb85b 100644 --- a/makima/src/orchestration/directive.rs +++ b/makima/src/orchestration/directive.rs @@ -1414,6 +1414,7 @@ Run these commands: git fetch origin git checkout {directive_branch} git pull origin {directive_branch} +git merge origin/{base_branch} --no-edit {merge_commands} git push origin {directive_branch} ``` |
