feat(files): render diff fences and theme mermaid diagrams - #8543
Conversation
…mpare two documents
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
There was a problem hiding this comment.
All reported issues were addressed across 11 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
|
|
@cubic-dev-ai review this PR |
@TheodoreSpeaks I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
3 issues found across 11 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/sim/components/diff/diff-view.tsx">
<violation number="1" location="apps/sim/components/diff/diff-view.tsx:161">
P2: Clicking any collapsed run expands every collapsed run in the same hunk because `expanded` is keyed only by `hunkIndex`. Track each run separately so expanding one run does not reveal unrelated context or remove the other expanders.</violation>
</file>
<file name="apps/sim/lib/diff/unified.ts">
<violation number="1" location="apps/sim/lib/diff/unified.ts:84">
P2: No-`@@` diffs drop changes whose first body line starts with `--- ` or `+++ ` because header recognition remains active after both file headers. Track whether the `---` and `+++` headers have been consumed before interpreting subsequent rows.</violation>
<violation number="2" location="apps/sim/lib/diff/unified.ts:91">
P2: Single-file renames show the old filename in the diff card header instead of the changed `+++` filename. Assign `path` when processing the non-source `+++` header, retaining an old-path fallback only for `/dev/null` deletions.</violation>
</file>
…s one run at a time
|
@cubic-dev-ai review this PR |
@TheodoreSpeaks I have started the AI code review. It will take a few minutes to complete. |
Summary
```difffences in markdown files render as line diffs: tinted add/remove rows, word-level highlights, line numbers when hunk headers carry them, and long unchanged runs collapsed behind an expander---/+++headers can name a workspace file (sim:file/<id>) or knowledge base document (sim:knowledge/<kbId>/<docId>); the card header shows its icon, name, and a link---and+++name two different documents, the diff renders as two side-by-side excerpt cards with each document's claim highlightedbasetheme; flowcharts look like workflow blocks and edges (rounded cards, 1.5px edges, no arrowheads) and labels are pinned to the font they are measured with so they no longer clipType of Change
Testing
Tested manually in markdown files with file, knowledge base, two-document, and git diffs plus flowchart, sequence, and pie diagrams.
bun run lint,bun run check:audits, block registry and tool-registry boundary checks, and diff parser unit tests pass.Checklist