diff --git a/frontend/packages/dashboard/src/call.js b/frontend/packages/dashboard/src/call.js index a332d20e..e79e5928 100644 --- a/frontend/packages/dashboard/src/call.js +++ b/frontend/packages/dashboard/src/call.js @@ -354,10 +354,10 @@ export function renderApprovals() { '↳ view diff'); diffBtn.addEventListener('click', () => openDiffPanel(a)); drill.append(diffBtn); - if (forgeBase && a.sha_short) { + if (forgeBase && a.sha_full) { drill.append(el('a', { class: 'panel-trigger', target: '_blank', rel: 'noopener', - href: `${forgeBase}/agent-configs/${a.agent}/commit/${a.sha_short}`, + href: `${forgeBase}/agent-configs/${a.agent}/commit/${a.sha_full}`, title: 'this proposal commit on the hive forge', }, '↳ commit on forge ↗')); } diff --git a/hive-c0re/src/dashboard/state_snapshot.rs b/hive-c0re/src/dashboard/state_snapshot.rs index 18470db2..fb807474 100644 --- a/hive-c0re/src/dashboard/state_snapshot.rs +++ b/hive-c0re/src/dashboard/state_snapshot.rs @@ -234,7 +234,15 @@ struct ApprovalView { agent: String, kind: &'static str, /// First 12 chars of the `commit_ref`, for `ApplyCommit` only. + /// Display-only (the short chip on the card). sha_short: Option, + /// Full commit sha, for `ApplyCommit` only. The frontend builds the + /// "commit on forge" link from this rather than `sha_short`: forgejo + /// 404s an abbreviated sha for the proposal commit (it lives on a + /// `proposal/` tag ref, which forgejo won't disambiguate a short + /// hash against), but resolves the full 40-char sha by direct lookup. + #[serde(skip_serializing_if = "Option::is_none")] + sha_full: Option, /// Raw unified diff text, for `ApplyCommit` only. The client splits /// on `\n` and per-line classifies (`+` / `-` / `@@` / `--- ` / `+++ ` /// → diff-add / diff-del / diff-hunk / diff-file). Shipping raw @@ -584,6 +592,7 @@ async fn build_approval_views(approvals: Vec) -> Vec { agent: a.agent.clone(), kind: "apply_commit", sha_short: Some(sha), + sha_full: Some(displayed.to_owned()), diff: Some(diff), description: a.description, pr_number: None, @@ -596,6 +605,7 @@ async fn build_approval_views(approvals: Vec) -> Vec { agent: a.agent, kind: "spawn", sha_short: None, + sha_full: None, diff: None, description: a.description, pr_number: None, @@ -607,6 +617,7 @@ async fn build_approval_views(approvals: Vec) -> Vec { agent: a.agent, kind: "init_config", sha_short: None, + sha_full: None, diff: None, description: a.description, pr_number: None, @@ -618,6 +629,7 @@ async fn build_approval_views(approvals: Vec) -> Vec { agent: a.agent, kind: "update_meta_inputs", sha_short: None, + sha_full: None, diff: None, description: a.description, pr_number: None, @@ -629,6 +641,7 @@ async fn build_approval_views(approvals: Vec) -> Vec { agent: a.agent, kind: "schedule_prompt", sha_short: None, + sha_full: None, diff: None, description: a.description, pr_number: None, @@ -651,6 +664,7 @@ async fn build_approval_views(approvals: Vec) -> Vec { agent: a.agent, kind: "merge_config_pr", sha_short: sha, + sha_full: None, diff: None, description: a.description, pr_number,