Skip to content

chore(web): mermaid followups#1373

Merged
whoisthey merged 3 commits into
mainfrom
whoisthey/mermaid-followups
Jun 26, 2026
Merged

chore(web): mermaid followups#1373
whoisthey merged 3 commits into
mainfrom
whoisthey/mermaid-followups

Conversation

@whoisthey

@whoisthey whoisthey commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Addressing items noticed in the while after intro of mermaid diagrams:

  • scroll-to behaviour from diagram button could over/undershoot right-panel diagram
  • default diagram zoom-fitting behaviour left some overly wide diagrams looking blown out

Resolution:

  • use instant scroll to avoid over/undershoot due to display recalc, also matching behaviour with code reference onClick
  • make default diagram zoom-fitting keep x/y fit within container, more pleasant default views (see screenshot below)
Screenshot 2026-06-26 at 4 39 44 PM

Summary by CodeRabbit

  • Bug Fixes
    • Mermaid diagrams now use consistent width/height “contain” sizing in both panel and fullscreen, preventing horizontal overflow and container layout issues.
    • Panel auto-sizing remains enabled, but the diagram scale is constrained so it can’t grow beyond the available space.
    • When a diagram is revealed, it now jumps into view instantly (instead of smooth scrolling) for more responsive navigation.

@github-actions

This comment has been minimized.

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 58f10cc0-c972-452a-a53b-db4319efd684

📥 Commits

Reviewing files that changed from the base of the PR and between d73749e and 040c8bb.

📒 Files selected for processing (1)
  • CHANGELOG.md
✅ Files skipped from review due to trivial changes (1)
  • CHANGELOG.md

Walkthrough

This PR changes Mermaid diagram fitting in chat threads to use contain-fit scaling in panel and fullscreen modes, and switches diagram reveal scrolling to instant behavior.

Changes

Chat diagram behavior

Layer / File(s) Summary
Contain-fit diagram scaling
packages/web/src/ee/features/chat/components/chatThread/mermaidDiagram.tsx, CHANGELOG.md
computeFit removes the horizontal enlargement path, updates its description, and always applies contain-fit scaling before the auto-height branch; the changelog notes the same behavior change.
Instant reveal scrolling
packages/web/src/ee/features/chat/components/chatThread/referencedSourcesListView.tsx
Revealed diagrams now scroll into view with behavior: 'instant' instead of behavior: 'smooth'.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • sourcebot-dev/sourcebot#1035: Changes the same referencedSourcesListView.tsx scrolling path for selected content, so it is directly adjacent to the reveal behavior updated here.
  • sourcebot-dev/sourcebot#1036: Also adjusts referencedSourcesListView.tsx scroll handling for diagram/reference reveal positioning.
  • sourcebot-dev/sourcebot#1369: Modifies the Mermaid chat-thread diagram behavior in the same area as this PR’s mermaidDiagram.tsx scaling change.

Suggested reviewers

  • brendan-kellam
🚥 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 is related to the main change set and correctly points to the mermaid follow-up work.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch whoisthey/mermaid-followups

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.

@whoisthey whoisthey requested a review from brendan-kellam June 26, 2026 23:45
brendan-kellam
brendan-kellam previously approved these changes Jun 26, 2026
@whoisthey whoisthey enabled auto-merge (squash) June 26, 2026 23:50
@whoisthey whoisthey disabled auto-merge June 26, 2026 23:59
@whoisthey whoisthey merged commit 2d28a00 into main Jun 26, 2026
9 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.

2 participants