Implement a variety of small refactors - #291
Conversation
- Merge StaticHighlightedCode and StaticDiffContent into one CellSource component (they differed only in whether diff marks were computed) - Remove the markdown fence highlight machinery (async per-language loading cache and the duplicated DOM-builder render path that existed only for it); markdown code fences now render unhighlighted - Replace the 32-entry rendermime registry LRU (plus eviction/disposal) with one lazy registry: session credentials come from window.location and never change within a page - Stop threading the registry through CellOutputs/RenderMimeOutput props
…ght upgrade - Drop the markdown <textarea> editor branch; CodeMirror handles all cell types (markdown simply gets no language extension), removing a duplicated blur-autosave handler and the textarea-specific styles - Extract the shared blur handler and the twice-duplicated reorder indicator - Make the off-viewport lightweight mode upgrade-only: rows never swap back to plain text, so scrolling can't replace DOM under an in-progress text selection - Inline the trivial renderViewportModal wrapper - Remove the now-dead has-syntax-highlight style selector
…d stale deps highlightCode walks the tree linearly and computeDiffMarks builds ranges front-to-back, so both inputs to buildLineSegments are already in document order. Skipping unstyled tokens also lets adjacent plain text collapse into a single segment instead of one span boundary per lexer token.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR consolidates static cell rendering, introduces shared warning and guarded-action flows, refactors conflict-row controls and editing behavior, centralizes history navigation, and changes render-mime registry creation to a session-scoped singleton. ChangesCell rendering and output integration
Conflict-resolution interactions
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant ConflictResolver
participant WarningModal
participant resolverStore
participant MergeRow
ConflictResolver->>WarningModal: request confirmation for guarded action
WarningModal-->>ConflictResolver: confirm or cancel
ConflictResolver->>resolverStore: apply resolution or navigate history
resolverStore-->>MergeRow: update conflict and resolution state
MergeRow-->>ConflictResolver: render updated row controls
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/web/client/src/components/WarningModal.tsx`:
- Around line 36-58: Update the WarningModal component to behave as an
accessible modal dialog: add alertdialog semantics with aria-modal, focus the
dialog or confirm button on mount, trap Tab navigation within the modal actions,
restore the previously focused element on unmount, and invoke onCancel for
Escape. Keep the existing confirmation and cancellation behavior unchanged.
🪄 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 Plus
Run ID: dec5ae20-ff56-4353-ae41-b4fd08e9b062
📒 Files selected for processing (6)
packages/web/client/src/components/CellContent.tsxpackages/web/client/src/components/ConflictResolver.tsxpackages/web/client/src/components/MergeRow.tsxpackages/web/client/src/components/WarningModal.tsxpackages/web/client/src/store/resolverStore.tspackages/web/client/src/styles.ts
|



This PR attempts to reuse components more, and deduplicate code as much as possible. This does not touch core functionality
Summary by CodeRabbit