Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
They are not needed since technically merge conflict stuff is no longer actually an annotation
ai went a lil ham there...
27e5aba to
b9faf43
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a dedicated “unresolved merge conflict” diff primitive on top of the existing diffs renderer, including parsing conflict markers into a structured diff, rendering conflict-aware UI rows, and providing utilities + docs/SSR support to resolve conflicts while preserving syntax highlighting.
Changes:
- Introduces merge-conflict parsing and resolution utilities (
getMergeConflictLineTypes,parseMergeConflictDiffFromFile,resolveMergeConflict) with test coverage. - Adds
UnresolvedFile(vanilla + React) andUnresolvedFileHunksRendererto render conflict markers/sections with built-in action controls and optional custom utilities via slots. - Extends renderer infrastructure (line decorations, custom
<pre>properties) and updates docs + SSR preloading (preloadUnresolvedFile) to demo/hydrate the new UI.
Reviewed changes
Copilot reviewed 41 out of 41 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/diffs/test/resolveMergeConflict.test.ts | Adds tests for applying merge-conflict resolutions to raw contents. |
| packages/diffs/test/parseMergeConflictDiffFromFile.test.ts | Adds tests ensuring conflict files are split into current/incoming views + diff metadata/actions. |
| packages/diffs/test/getMergeConflictLineTypes.test.ts | Adds tests for marker/body classification, nested handling, and region extraction. |
| packages/diffs/src/utils/setWrapperNodeProps.ts | Adds support for custom <pre> attributes during DOM application. |
| packages/diffs/src/utils/resolveMergeConflict.ts | New utility to apply a merge-conflict resolution payload to file contents. |
| packages/diffs/src/utils/parseMergeConflictDiffFromFile.ts | New utility to convert conflict-marked file contents into a synthetic diff + action metadata. |
| packages/diffs/src/utils/hast_utils.ts | Extends gutter item creation to accept additional properties. |
| packages/diffs/src/utils/getMergeConflictLineTypes.ts | New parser for conflict markers/stages + region extraction. |
| packages/diffs/src/utils/getMergeConflictActionSlotName.ts | New helper to generate stable slot names for action rows. |
| packages/diffs/src/utils/createPreElement.ts | Adds custom <pre> properties for SSR/HAST-rendered output. |
| packages/diffs/src/utils/arePrePropertiesEqual.ts | Updates equality check to include custom <pre> properties. |
| packages/diffs/src/utils/areMergeConflictActionsEqual.ts | Adds equality helper for merge-conflict action metadata caching. |
| packages/diffs/src/types.ts | Introduces merge-conflict types, CustomPreProperties, and BaseDiffOptionsWithDefaults. |
| packages/diffs/src/style.css | Adds conflict-marker/section styling and action-row UI styling. |
| packages/diffs/src/ssr/preloadDiffs.ts | Adds SSR preload APIs for unresolved merge-conflict files and refactors common rendering flow. |
| packages/diffs/src/renderers/UnresolvedFileHunksRenderer.ts | New renderer that decorates conflict lines and injects action rows/slots. |
| packages/diffs/src/renderers/DiffHunksRenderer.ts | Adds line decoration hooks + custom pre properties support to enable conflict rendering overlays. |
| packages/diffs/src/react/utils/useUnresolvedFileInstance.ts | New hook to manage UnresolvedFile instance + sequential conflict resolutions in React. |
| packages/diffs/src/react/utils/useFileDiffInstance.ts | Minor refactor to reduce repeated ref reads. |
| packages/diffs/src/react/utils/renderDiffChildren.tsx | Adds rendering of merge-conflict utility slot children in React. |
| packages/diffs/src/react/index.ts | Exports React UnresolvedFile. |
| packages/diffs/src/react/constants.ts | Adds styling constant for merge-conflict slot wrappers. |
| packages/diffs/src/react/UnresolvedFile.tsx | New React component wrapper for unresolved merge-conflict rendering. |
| packages/diffs/src/managers/InteractionManager.ts | Adds click targeting + dispatch for merge-conflict action buttons and accounts for action rows in layout logic. |
| packages/diffs/src/index.ts | Exports vanilla UnresolvedFile and resolveMergeConflict. |
| packages/diffs/src/components/UnresolvedFile.ts | New vanilla component handling uncontrolled/controlled conflict resolution flows and optional custom action rendering. |
| packages/diffs/src/components/FileDiff.ts | Refactors renderer construction for extensibility and allows custom separator renderers to return undefined. |
| apps/docs/app/page.tsx | Adds a merge-conflict demo section to the homepage. |
| apps/docs/app/docs/page.tsx | Integrates merge-conflict demo + adds docs/examples for new APIs. |
| apps/docs/app/docs/VanillaAPI/content.mdx | Documents UnresolvedFile in vanilla API docs. |
| apps/docs/app/docs/VanillaAPI/constants.ts | Adds vanilla unresolved-file example snippet. |
| apps/docs/app/docs/VanillaAPI/ComponentTabs.tsx | Adds an “UnresolvedFile” tab in vanilla API example UI. |
| apps/docs/app/docs/Utilities/content.mdx | Documents resolveMergeConflict utility usage. |
| apps/docs/app/docs/Utilities/constants.ts | Adds resolveMergeConflict example snippet. |
| apps/docs/app/docs/SSR/content.mdx | Documents preloadUnresolvedFile. |
| apps/docs/app/docs/SSR/constants.ts | Adds SSR preload unresolved-file example snippet. |
| apps/docs/app/docs/ReactAPI/content.mdx | Documents React UnresolvedFile and its uncontrolled behavior. |
| apps/docs/app/docs/ReactAPI/constants.ts | Adds React unresolved-file example snippet. |
| apps/docs/app/docs/ReactAPI/ComponentTabs.tsx | Adds an “UnresolvedFile” tab in React API example UI. |
| apps/docs/app/diff-examples/MergeConflict/constants.ts | Adds merge-conflict demo fixture/options. |
| apps/docs/app/diff-examples/MergeConflict/MergeConflict.tsx | Adds client-side demo UI for resetting/toggling theme while testing the conflict renderer. |
Comments suppressed due to low confidence (1)
packages/diffs/src/style.css:38
- The "Available CSS Color Overrides" list now mentions
--diffs-fg-conflict-marker-override, but the stylesheet also introduces several new conflict-related override variables (e.g.--diffs-bg-conflict-marker-override,--diffs-bg-conflict-current-override, etc.) that aren't documented in this list. To keep the inline docs accurate/discoverable, consider adding the rest of the conflict override vars that are actually supported below.
/*
// Available CSS Color Overrides
--diffs-bg-buffer-override
--diffs-bg-hover-override
--diffs-bg-context-override
--diffs-bg-separator-override
--diffs-fg-number-override
--diffs-fg-number-addition-override
--diffs-fg-number-deletion-override
--diffs-fg-conflict-marker-override
--diffs-deletion-color-override
--diffs-addition-color-override
--diffs-modified-color-override
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merge conflict built on top of diff primitive…
VSCODE (note the syntax highlighting failure)

Pierre (note the correct highlighting)
