Skip to content

Remove source editor and use from solid-ui - #218

Open
SharonStrats wants to merge 2 commits into
stagingfrom
move-editor
Open

Remove source editor and use from solid-ui#218
SharonStrats wants to merge 2 commits into
stagingfrom
move-editor

Conversation

@SharonStrats

@SharonStrats SharonStrats commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Remove the source editor and use the one from solid-ui.

Blocking: this needs to go in first SolidOS/solid-ui#852

@SharonStrats
SharonStrats requested review from bourgeoa and a lite review from Copilot August 5, 2026 22:11
@SharonStrats SharonStrats self-assigned this Aug 5, 2026
@SharonStrats SharonStrats added the enhancement New feature or request label Aug 5, 2026
@SharonStrats SharonStrats moved this to In review in SolidOS NLNet UI Aug 5, 2026

Copilot AI 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.

Pull request overview

This PR removes the in-repo CodeMirror-based source editor implementation and switches SourceEditorCard to use the CodeEditor provided by solid-ui, reducing direct editor implementation and dependency surface in this package.

Changes:

  • Replaced dynamic import/instantiation of the local SourceEditor with solid-ui’s CodeEditor in SourceEditorCard.
  • Removed the local SourceEditor implementation and its dedicated unit test.
  • Dropped direct CodeMirror-related dependencies from package.json and updated the lockfile accordingly; bumped package version.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/sourceEditor.test.js Removes tests for the deleted local SourceEditor.
src/components/source-editor-card/SourceEditorCard.ts Switches editor initialization from local SourceEditor to solid-ui CodeEditor.
src/components/source-editor-card/SourceEditor.ts Removes the local CodeMirror-based editor implementation.
package.json Bumps version and removes direct CodeMirror-related dependencies.
package-lock.json Removes CodeMirror-related transitive packages (but needs version alignment with package.json).
Suppressed comments (1)

src/components/source-editor-card/SourceEditorCard.ts:130

  • Switching from the local SourceEditor to solid-ui's CodeEditor changes the editor initialization behavior (module import path, constructor, initialize signature, dirty callback wiring), but the current unit tests don’t assert that this initialization runs successfully or that the dirty callback updates fileExplorerContext.edit.updateDirtyState. Consider adding a test that mocks solid-ui's CodeEditor and verifies initialize(...) is called with the expected args and that invoking the provided dirty callback updates the dirty state.
      const { CodeEditor } = await import('solid-ui')
      this._originalContent = sourceContext.originalContent
      this._originalContentType = sourceContext.editorMetadata.contentType
      this._editor = new CodeEditor()
      const { content, contentType } = await this._getViewContent()
      await this._editor.initialize(sourcePaneEditor, content, contentType, 'dark', dirty => {
        this.updateDirtyState(dirty)
      })

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/components/source-editor-card/SourceEditorCard.ts Outdated
…istry@3.1.2-2 solid-ui@3.1.3-15) (latest: rdflib@2.4.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

3 participants