gabriel / musehub public
feat patch dev
AI Agent gabriel · 127 days ago · May 9, 2026 · Diff

feat: SSR diff page with Cohen-annotated hunk headers

Replace client-side diff.ts rendering with full server-side rendering. diff_page now fetches both snapshot manifests, batch-reads object content, runs difflib.unified_diff + annotate_hunk_action, and passes annotated file diffs to the template. No loading spinner on first paint.

- _build_file_diffs: batches object reads, annotates hunks with [change: *] labels - diff.html: renders stats bar + file cards + diff table rows server-side - Added df3-dl-hunk row type and df3-ln-hunk/trunc styles - 9 TDD tests (test_diff_page_ssr.py) all green

sha256:672ab421d152e0e187a6d0a6411d2c2d4aadcb3e52ef5018e33ddc5b8ef6f32d sha
+48 ~2 symbols
sha256:480c7f3e6462d02ac1424989c0232e9a244158a7974788a689228a58c2d0a408 snapshot
+48
symbols added
~2
symbols modified
0
dead code introduced
Semantic Changes 50 symbols
~ tests/test_diff_page_ssr.py .py 41 symbols added
+ _NEW_CONTENT variable variable _NEW_CONTENT L66–66
+ _OID_NEW variable variable _OID_NEW L63–63
+ _OID_OLD variable variable _OID_OLD L62–62
+ _OLD_CONTENT variable variable _OLD_CONTENT L65–65
+ _OWNER variable variable _OWNER L52–52
+ _SHA_COMMIT variable variable _SHA_COMMIT L56–56
+ _SHA_PARENT variable variable _SHA_PARENT L55–55
+ _SLUG variable variable _SLUG L53–53
+ _SNAP_COMMIT variable variable _SNAP_COMMIT L59–59
+ _SNAP_PARENT variable variable _SNAP_PARENT L58–58
+ _make_manifests function function _make_manifests L147–165
+ _patch_manifests function function _patch_manifests L181–190
+ _seed_commit_pair function async_function _seed_commit_pair L90–118
+ _seed_repo function async_function _seed_repo L72–87
+ _seed_root_commit function async_function _seed_root_commit L121–141
+ _storage_backend function function _storage_backend L168–175
+ AsyncClient import import AsyncClient L44–44
+ AsyncMock import import AsyncMock L41–41
+ AsyncSession import import AsyncSession L45–45
+ MagicMock import import MagicMock L41–41
+ MusehubBranch import import MusehubBranch L48–48
+ MusehubCommit import import MusehubCommit L48–48
+ MusehubRepo import import MusehubRepo L48–48
+ annotations import import annotations L37–37
+ compute_branch_id import import compute_branch_id L47–47
+ compute_identity_id import import compute_identity_id L47–47
+ compute_repo_id import import compute_repo_id L47–47
+ datetime import import datetime L40–40
+ patch import import patch L41–41
+ pytest import import pytest L43–43
+ secrets import import secrets L39–39
+ timezone import import timezone L40–40
+ test_diff_page_added_file_shows_plus_lines function async_function test_diff_page_added_file_shows_plus_lines L237–258
+ test_diff_page_modified_file_shows_add_and_del_lines function async_function test_diff_page_modified_file_shows_add_and_del_lines L306–323
+ test_diff_page_modified_file_shows_cohen_hunk_header function async_function test_diff_page_modified_file_shows_cohen_hunk_header L285–302
+ test_diff_page_no_changes_shows_empty_state function async_function test_diff_page_no_changes_shows_empty_state L353–373
+ test_diff_page_removed_file_shows_minus_lines function async_function test_diff_page_removed_file_shows_minus_lines L262–281
+ test_diff_page_renders_stats_bar function async_function test_diff_page_renders_stats_bar L217–233
+ test_diff_page_renders_without_loading_spinner function async_function test_diff_page_renders_without_loading_spinner L197–213
+ test_diff_page_returns_200_for_unknown_commit function async_function test_diff_page_returns_200_for_unknown_commit L377–389
+ test_diff_page_root_commit_no_parent_shows_added_file function async_function test_diff_page_root_commit_no_parent_shows_added_file L327–349
~ musehub/api/routes/musehub/ui_commits.py .py 3 symbols added, 1 symbol modified
+ _MAX_DIFF_FILES variable variable _MAX_DIFF_FILES L403–403
+ _MAX_DIFF_LINES variable variable _MAX_DIFF_LINES L404–404
+ _build_file_diffs function async_function _build_file_diffs L406–486
~ musehub/templates/musehub/pages/diff.html .html 1 symbol added, 1 symbol modified
+ ', '-') }} section div#df3-file-{{ path | replace('/', '-') | replace('.', '-') }} L118–160
~ src/scss/components/_diff.scss .scss 3 symbols added
+ df3-dl-hunk rule .df3-dl-hunk L184–184
+ df3-ln-hunk rule .df3-ln-hunk L210–210
+ df3-ln-trunc rule .df3-ln-trunc L211–211
← Older Oldest on dev
All commits
Newer → Latest on dev

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:672ab421d152e0e187a6d0a6411d2c2d4aadcb3e52ef5018e33ddc5b8ef6f32d --body "your comment"