Repository navigation
MergeNB playground on docusaurus website - #225
Conversation
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.
…ut changing docusaurus website
- 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.
📝 WalkthroughWalkthroughThis 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
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
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
60620d5 to
9aebf95
Compare
- 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.
2d2fb58 to
7bb4003
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
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 | 🟡 MinorUpdate placeholder URLs to MergeNB repository.
The
editUrlvalues and GitHub navbar link still referencefacebook/docusaurusfrom 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
⛔ Files ignored due to path filters (1)
apps/website/package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (12)
README.mdapps/vscode-extension/resolver.tsapps/website/docusaurus.config.tsapps/website/package.jsonapps/website/src/ipynb.d.tsapps/website/src/pages/index.tsxapps/website/src/pages/playground.tsxapps/website/tsconfig.jsonpackages/web/client/src/components/CellContent.tsxpackages/web/client/src/components/MergeRow.tsxpackages/web/client/src/styles.tstest-fixtures/shared/integrationUtils.ts
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
Enhancements
Bug Fixes