Skip to content

Conversation

rossedfort
Copy link
Contributor

@rossedfort rossedfort commented Sep 18, 2025

Description & motivation 💭

Remove monaco-editor and use codemirror instead for nexus desccription

Screenshots (if applicable) 📸

Screen.Recording.2025-09-18.at.11.22.30.AM.mov

Design Considerations 🎨

Testing 🧪

How was this tested 👻

  • Manual testing
  • E2E tests added
  • Unit tests added

Steps for others to test: 🚶🏽‍♂️🚶🏽‍♀️

  • Test description is still saved when creating a Nexus Endpoint
  • Test summary and details are still saved when starting a Workflow

Checklists

Draft Checklist

Merge Checklist

Issue(s) closed

Docs

Any docs updates needed?

@rossedfort rossedfort requested a review from a team as a code owner September 18, 2025 17:23
@rossedfort rossedfort requested review from laurakwhit and removed request for a team September 18, 2025 17:23
Copy link

vercel bot commented Sep 18, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
holocene Ready Ready Preview Comment Sep 18, 2025 8:49pm

const createEditorView = () => {
return new EditorView({
parent: editorElement,
Copy link
Collaborator

Choose a reason for hiding this comment

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

You could make this function pure if you passed editorElement in instead of depending on the state being declared already.

return new EditorView({
parent: editorElement,
state: EditorState.create({
doc: content,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here but unsure if EditorState updates content, but you could purify the func by passing this in as well, the rest seem to be options

if (transaction.docChanged) {
content = editorView.state.doc.toString();
}
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

Lol I got to here and it seems less feasible but I'm curious when this function ends up getting called in the lifecycle of codemirror.

Probably ignore the comments above.

await tick();
editorView = createEditorView();
}
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

If you made an editor component and used it in the if statement wouldn't this happen automagically without you having to manage and use await tick? Also the onMount would naturally move to the new editor component.

<section class={twMerge('h-full w-full', className)}>
<iframe
bind:this={iframe}
onload={resizeIframe}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we care if the window size is changed and need to update this? Should we use a resizeObserver (or whatever the window version is) on this to keep things properly laid out?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question, this was existing code I copied over from src/lib/holocene/monaco/markdown.svelte, so I didn't want to touch it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems to work fine

Screen.Recording.2025-09-18.at.1.04.08.PM.mov

Copy link
Contributor

@andrewzamojc andrewzamojc left a comment

Choose a reason for hiding this comment

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

The implementation is looking good. I left a couple suggestions for the component, and a request for a storybook story so I can use the preview link to try the component :)

Copy link
Contributor

@andrewzamojc andrewzamojc left a comment

Choose a reason for hiding this comment

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

LGTM

@rossedfort rossedfort merged commit a6ec261 into main Sep 22, 2025
15 checks passed
@rossedfort rossedfort deleted the DT-3299-remove-monaco-editor branch September 22, 2025 16:18
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.

3 participants