Skip to content

MergeNB playground on docusaurus website - #225

Merged
Avni2000 merged 14 commits into
mainfrom
MergeNB-playground-on-docusaurus-website
Apr 13, 2026
Merged

Avni2000 merged 14 commits into
mainfrom
MergeNB-playground-on-docusaurus-website

Conversation

@Avni2000

@Avni2000 Avni2000 commented Apr 13, 2026 •

Copy link
Copy Markdown
Owner

Motivation

Create a simple way for users to see what MergeNB looks like without having to install anything.

Solution

We grabbed all of the components from conflictResolver.tsx (+ some style/build system work) and displayed it on the main page. The monorepo structure came in handy.

Summary by CodeRabbit

  • New Features

    • Introduced an interactive MergeNB Playground page for resolving notebook conflicts in real-time.
  • Enhancements

    • Improved rendering of markdown and code content with better formatting options.
    • Enhanced styling system with scoped CSS support for better embedding compatibility.
    • Updated documentation branding and homepage to reflect MergeNB identity.
  • Bug Fixes

    • Tightened null check logic in conflict resolution for improved accuracy.

Adds /playground with a 3-way notebook merge demo using the existing
ConflictResolver component and test-fixture notebooks. Dynamic imports
inside BrowserOnly avoid SSR issues with browser-only dependencies.
Also adds an ipynb webpack loader and a homepage button linking to the
playground.
- properly passes dark styles down
- docusaurus css was bleeding into <pre> and <code>
  - adds a conditionally scoped CSS block that resets it on the playground.
- properly scope font importing
- add CSS containment to scoped playground root
- fix layout height mismatch and fix double scroll
- code cells had content pushed to the left; we re-add indentation
- bring back syntax highlighting for static resolved cells
- in general, incrementally better scopes styles.
@coderabbitai

coderabbitai Bot commented Apr 13, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This PR introduces a new interactive playground for the MergeNB website, refactors cell content rendering to support markdown and static syntax-highlighted code paths, adds comprehensive styling and dependency infrastructure, and makes minor fixes to the VSCode extension resolver and test utilities.

Changes

Cohort / File(s) Summary
Website Metadata & Configuration
README.md, apps/website/docusaurus.config.ts, apps/website/tsconfig.json, apps/website/package.json, apps/website/src/ipynb.d.ts
Updated site title, tagline, and branding; added Webpack plugin for .ipynb file loading and JSON5 resolution; expanded dependencies (CodeMirror, JupyterLab, virtualization, markdown); added TypeScript ambient module for .ipynb imports; configured TypeScript include paths.
Website Homepage & Playground Pages
apps/website/src/pages/index.tsx, apps/website/src/pages/playground.tsx
Changed homepage CTA from tutorial link to playground link and replaced features section with rendered README; added new interactive playground page with async module loading, demo notebook fixtures, conflict computation, and dark-mode styling injection.
Cell Content Rendering & Styling
packages/web/client/src/components/CellContent.tsx, packages/web/client/src/components/MergeRow.tsx, packages/web/client/src/styles.ts
Exported MarkdownContent and StaticHighlightedCode components with added className prop; updated MergeRow to conditionally render markdown or static highlighted code for resolved cells; extended injectStyles to support scoped styling with contain and isolation, Google Fonts injection, and host-framework style resets.
VSCode Extension & Test Integration
apps/vscode-extension/resolver.ts, test-fixtures/shared/integrationUtils.ts
Tightened null check in applySemanticResolutions to explicitly check for null/undefined; updated test helper getResolvedContentValue to read data-raw-source attribute from resolved cell container.

Sequence Diagram(s)

sequenceDiagram
    participant Browser as Browser/Client
    participant ModuleLoader as Module Loader
    participant ConflictAnalyzer as Conflict Analyzer
    participant StyleInjector as Style Injector
    participant Renderer as ConflictResolver Renderer

    Browser->>ModuleLoader: Load ConflictResolver, helpers, styles
    ModuleLoader-->>Browser: Modules loaded
    Browser->>ModuleLoader: Dynamically load demo notebooks
    ModuleLoader-->>Browser: Notebooks loaded
    Browser->>ConflictAnalyzer: Normalize notebooks via getNotebook()
    ConflictAnalyzer-->>Browser: Normalized notebooks
    Browser->>ConflictAnalyzer: Compute cell mappings & semantic conflicts
    ConflictAnalyzer-->>Browser: Conflict data
    Browser->>StyleInjector: Inject dark-mode styles to playground root
    StyleInjector-->>Browser: Styles applied
    Browser->>Renderer: Render ConflictResolver with notebook data
    Renderer-->>Browser: Playground UI displayed
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

  • PR #214: Modifies markdown cell rendering paths and style handling, overlapping with updates to CellContent.tsx and markdown-specific rendering logic.
  • PR #223: Updates the same UI resolution flow in MergeRow.tsx, styles, and test helper getResolvedContentValue, with direct code-level overlap.
  • PR #215: Modifies VSCode extension resolver logic in apps/vscode-extension/resolver.ts around semantic resolution handling.

Poem

🐰 A playground springs to life, with notebooks dancing,
Markdown shines bright, no longer dead code prancing,
Styles now scoped with grace, and conflicts resolved,
The web unfolds its beauty—a tale well-evolved! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 23.08% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly describes the main feature addition: a playground interface for MergeNB embedded on the Docusaurus website, which aligns with the PR's primary objective to provide a live demo.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch MergeNB-playground-on-docusaurus-website

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 and usage tips.

@Avni2000
Avni2000 force-pushed the MergeNB-playground-on-docusaurus-website branch from 60620d5 to 9aebf95 Compare April 13, 2026 20:18
Repository owner deleted a comment from coderabbitai Bot Apr 13, 2026
Repository owner deleted a comment from coderabbitai Bot Apr 13, 2026
- CAUTION: lowers test coverage
- correct take-all logic -- they should skip conflicts that have already been resolved by the user
- source mismatches
- edit vs save-edit button structure gives 2 classes for playwright to more easily use.
@Avni2000
Avni2000 force-pushed the MergeNB-playground-on-docusaurus-website branch from 2d2fb58 to 7bb4003 Compare April 13, 2026 21:02
@Avni2000

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Apr 13, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/website/docusaurus.config.ts (1)

82-83: ⚠️ Potential issue | 🟡 Minor

Update placeholder URLs to MergeNB repository.

The editUrl values and GitHub navbar link still reference facebook/docusaurus from the template. These should point to the MergeNB repository for accurate documentation contribution links.

🔗 Suggested updates
         editUrl:
-            'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
+            'https://github.com/Avni2000/MergeNB/tree/main/apps/website/',

And for the navbar GitHub link:

         {
-          href: 'https://github.com/facebook/docusaurus',
+          href: 'https://github.com/Avni2000/MergeNB',
           label: 'GitHub',

Also applies to: 93-94, 128-129

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/website/docusaurus.config.ts` around lines 82 - 83, Replace the
placeholder GitHub URLs pointing to the Docusaurus template with the MergeNB
repository URLs: update the editUrl entries (symbol: editUrl) to the MergeNB
repo path and also update the navbar GitHub link (symbol: navbar.items where the
GitHub href is defined) so all documentation edit links and the navbar GitHub
button point to the MergeNB GitHub repository rather than facebook/docusaurus.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/website/src/pages/index.tsx`:
- Line 6: The file imports HomepageFeatures but it is unused; remove the unused
import statement for HomepageFeatures from the top of
apps/website/src/pages/index.tsx (the import line referencing HomepageFeatures)
so the file only imports symbols that are actually used by the MDX-rendered
README content.

In `@apps/website/src/pages/playground.tsx`:
- Around line 86-87: The onResolve and onCancel handlers in the playground page
are currently no-ops; update the callbacks for the component using onResolve and
onCancel to provide user feedback (e.g., show a success toast or confirmation
modal when onResolve is triggered and a cancellation/toast when onCancel is
triggered). Locate the handlers attached to onResolve and onCancel in the
playground component, call the app's existing toast/modal utility (or create a
simple toast helper) to display a brief message like "Resolution applied" on
resolve and "Resolution cancelled" on cancel, and ensure any relevant state
updates or closing logic (e.g., closing a dialog) are executed after showing the
notification.
- Line 65: The code currently forces a 'dark' theme via injectStyles('dark',
'.mergenb-playground-root') and passing 'dark' to ConflictResolver; change this
to read the user's current Docusaurus color mode (use useColorMode or
useColorScheme hook) and use that value instead of the hardcoded 'dark' when
calling injectStyles and when supplying the theme prop to ConflictResolver, and
ensure injectStyles runs when colorMode changes (either by moving it outside the
effect or adding colorMode as a dependency) so the playground respects the
user's prefers-color-scheme setting.

In `@packages/web/client/src/components/CellContent.tsx`:
- Line 30: The '.cm-activeLine' rule in CellContent.tsx uses a hardcoded white
RGBA which is too subtle on light themes; change the rule to use a CSS variable
(e.g. var(--active-line-bg, rgba(255,255,255,0.05))) and then define/update that
variable per theme in your styles module (styles.ts) or theme provider (set
--active-line-bg to a dark translucent color for light themes and a light
translucent color for dark themes), ensuring a sensible fallback value is
provided.

In `@test-fixtures/shared/integrationUtils.ts`:
- Around line 89-95: Remove the workaround that reads the raw source from
data-raw-source and instead validate rendered content: delete the lines that
create parentCell, rawSource and the early return using
getAttribute('data-raw-source'), and replace them with reading the rendered
content from the locator (use parentCell.textContent or innerText via
scope.locator('.resolved-cell') and await .textContent()), then normalize
whitespace/newlines (trim and collapse consecutive whitespace) before assertions
so tests still tolerate markdown formatting differences while verifying the
displayed output.

---

Outside diff comments:
In `@apps/website/docusaurus.config.ts`:
- Around line 82-83: Replace the placeholder GitHub URLs pointing to the
Docusaurus template with the MergeNB repository URLs: update the editUrl entries
(symbol: editUrl) to the MergeNB repo path and also update the navbar GitHub
link (symbol: navbar.items where the GitHub href is defined) so all
documentation edit links and the navbar GitHub button point to the MergeNB
GitHub repository rather than facebook/docusaurus.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 47e708c3-6932-4077-859c-8e4f5726633f

📥 Commits

Reviewing files that changed from the base of the PR and between 2048f0f and f6388e3.

⛔ Files ignored due to path filters (1)
  • apps/website/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (12)
  • README.md
  • apps/vscode-extension/resolver.ts
  • apps/website/docusaurus.config.ts
  • apps/website/package.json
  • apps/website/src/ipynb.d.ts
  • apps/website/src/pages/index.tsx
  • apps/website/src/pages/playground.tsx
  • apps/website/tsconfig.json
  • packages/web/client/src/components/CellContent.tsx
  • packages/web/client/src/components/MergeRow.tsx
  • packages/web/client/src/styles.ts
  • test-fixtures/shared/integrationUtils.ts

Comment thread apps/website/src/pages/index.tsx Resolved
Comment thread apps/website/src/pages/playground.tsx Resolved
Comment thread apps/website/src/pages/playground.tsx Resolved
@Avni2000
Avni2000 merged commit d382dcd into main Apr 13, 2026
5 checks passed
@Avni2000
Avni2000 deleted the MergeNB-playground-on-docusaurus-website branch April 13, 2026 21:33
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