Skip to content

Connect fork-point and branch headers to their anchor message - #238

Merged
cboos merged 2 commits into
mainfrom
dev/fork-branch-connector
Jun 24, 2026
Merged

cboos merged 2 commits into
mainfrom
dev/fork-branch-connector

Conversation

@cboos

@cboos cboos commented Jun 24, 2026 •

Copy link
Copy Markdown
Collaborator

A visual follow-up to #233 (fork points whose node is an unrendered system message). Now that such a fork node renders as a landmark, the fork-point box — and the branch headers generally — read as detached floating elements with a gap above. This ties both to their anchor with a dashed top-border "connector" and a closed gap, while the .children indent still shows subordination.

Change (CSS only)

  • .fork-point (session_nav_styles.css): top margin 8px → -1.2em (the negative margin cancels the .message card's 1em bottom margin, so the box sticks up under the message it hangs off), border-top: 1px dashed var(--fork-point-color), border-radius: 0 0 8px 8px (square top so the dashed edge reads as a connector tab).
  • .branch-header (message_styles.css): bottom margin 1em → 0 (sticks the header to its own branch content below), matching border-top: 1px dashed var(--branch-point-color).

No template / Python / JS change; border-top is added to two existing rules, no new selectors. Affects all fork points and branch headers (every within-session rewind fork), intentionally. The fork-point box is still rendered inside .children, so it continues to fold away with its subtree.

Testing

CSS is inlined into the HTML output, so the 8 test_snapshot_html snapshots regenerated (updated serially with -n0 per the CONTRIBUTING xdist-race warning). The .ambr churn is limited to these two rules + their comments across the inlined copies — no message-HTML body changed. just ci green (unit + TUI + browser + snapshots, ruff, pyright, ty); the browser fold-invariant test stays green.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Style
    • Updated the branch header visuals with a dashed top connector and adjusted vertical spacing so headers visually “stack” directly onto their branch content.
    • Refined corner rounding for the branch header’s fold bar to preserve the connected rail geometry.
    • Reworked fork-point rendering to act as a hanging connector within the preceding node’s children, including a dashed top-border connector and bottom-only corner rounding.

The fork-point box rendered with an 8px top gap below the message it
hangs off (now visible as a landmark after #233), reading as a detached
floating element. The branch headers floated similarly above their own
content. Tie both to their anchors with a dashed top-border "connector"
and a closed gap, while the .children indent still shows subordination:

- .fork-point: top margin 8px → -1.2em (cancels the card's 1em bottom
  margin so it sticks up under the message above), border-top dashed,
  square top corners so the dashed edge reads as a connector tab.
- .branch-header: bottom margin 1em → 0 (sticks to its branch content
  below), matching dashed top border.

Snapshots regenerated (CSS is inlined into the HTML output); the diff is
limited to these two rules.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 24, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 24f03a90-a7f8-40db-b648-1bdb7f811625

📥 Commits

Reviewing files that changed from the base of the PR and between 25c07ec and 4d44872.

📒 Files selected for processing (2)
  • claude_code_log/html/templates/components/message_styles.css
  • test/__snapshots__/test_snapshot_html.ambr
🚧 Files skipped from review as they are similar to previous changes (2)
  • claude_code_log/html/templates/components/message_styles.css
  • test/snapshots/test_snapshot_html.ambr

📝 Walkthrough

Walkthrough

Updates branch-header and fork-point CSS to add dashed top-border connectors, adjust spacing, and change fork-point corner rounding. Matching HTML snapshot fixtures were updated for the new rendered styles.

Changes

Branch and fork connectors

Layer / File(s) Summary
Branch header connector
claude_code_log/html/templates/components/message_styles.css, test/__snapshots__/test_snapshot_html.ambr
.branch-header adds a dashed top border connector and removes the previous bottom spacing; snapshot entries were updated to match.
Fork point connector
claude_code_log/html/templates/components/session_nav_styles.css, test/__snapshots__/test_snapshot_html.ambr
.fork-point changes to the hanging .children layout with a dashed top border, negative top margin, and bottom-corner-only rounding; snapshot entries were updated to match.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • daaain/claude-code-log#89: Both PRs modify claude_code_log/html/templates/components/message_styles.css around fold-bar and header styling, and both update test/__snapshots__/test_snapshot_html.ambr.

Poem

Hop, hop, the borders line up neat 🐇
Dashed connectors tap to the beat
Branches and forks now meet above
With snug little curves and CSS love
Thumpity-thump, the snapshots sing!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main CSS visual change: connecting fork-point and branch headers to their associated message.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev/fork-branch-connector

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

For visual consistency: the fork-point has a squared top (where it
connects up to the message above), so the branch header — which sticks
to its own content below — should have a squared bottom (where it
connects down). Round the top, square the bottom on .branch-header, and
square its own fold-bar's bottom corners too (the fold-bar sits at the
card's bottom edge, so its rounded corners would otherwise undo it).

Snapshots regenerated (inlined CSS); diff limited to these rules.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cboos
cboos merged commit 37ba049 into main Jun 24, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant