fix(musehub#198): anchor merged-proposal Files Changed panel to merge commit lineage
Root cause: proposal_detail_page resolved the file-diff snapshot IDs via live MusehubBranch name lookups. Once a proposal's source branch is deleted (routine post-merge cleanup), that lookup returns None, the 'new' manifest is empty, and get_snapshot_diff misreports the entire base manifest as removed with a denominator of 0 ('X of 0') -- looking like the merge wiped the repo.
Fix: for a merged proposal, anchor the diff to proposal.merge_commit_id's own recorded lineage (merge commit's snapshot vs its parent's snapshot) instead of re-resolving branch names -- same pattern ui_commits.py's diff_page already uses for ordinary commits, immune to branch deletion. Falls back to the original live-branch lookup for open/unmerged proposals.
Tests: new TestFilesChangedPanelAfterMerge in tests/test_musehub_ui_proposal_ssr.py -- confirmed RED before the fix (real HTTP GET on a merged proposal with deleted source branch asserts '1 of 3' in body, failed pre-fix) and GREEN after. Full regression sweep across proposal/merge/repo/wire-fetch suites: 236 passed, no regressions.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Semantic Changes
6 symbols
Files Changed
~2
1075 in snapshot
0 comments
muse hub commit comment sha256:553c8ce398144d0b061f6686995491c66bbcbe7884935ac6c407601026442af1 --body "your comment"
No comments yet. Be the first to start the discussion.