Light and dark theme support for the text editor - #435
Open
kumaradityaraj wants to merge 2 commits into
Open
kumaradityaraj wants to merge 2 commits into
kumaradityaraj wants to merge 2 commits into
Conversation
Signed-off-by: Kumar Aditya Raj <sedulous.0007@gmail.com>
✅ Deploy Preview for openworkflow-editor ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved moderate issues affect initial Storybook synchronization, global Monaco theme behavior, and default-theme compatibility.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds light, dark, and system color-mode support to the Monaco-based text editor.
Changes:
- Adds color-mode resolution and Monaco theme application.
- Updates Storybook integration, tests, and Monaco mocks.
- Preserves configurable theme behavior through the new prop.
File summaries
| File | Summary | Findings |
|---|---|---|
packages/text-editor/tests/text-editor/TextEditor.test.tsx |
Tests theme behavior. | None. |
packages/text-editor/tests/__mocks__/monaco-editor.ts |
Mocks Monaco theme changes. | None. |
packages/text-editor/stories/features/TextEditor.tsx |
Forwards colorMode. |
None. |
packages/text-editor/src/types/colorMode.ts |
Defines color-mode types. | None. |
packages/text-editor/src/TextEditor.tsx |
Applies themes and exposes colorMode. |
Moderate (3 votes): Monaco themes are global across editor instances. Moderate (3 votes): omitted colorMode changes the previous default on dark systems. Nit (3 votes): document the prop in the README. Nit (1 vote): re-export the public color-mode type. |
packages/text-editor/src/hooks/useResolvedColorMode.ts |
Resolves explicit and system modes. | Nit (3 votes): add coverage for system preference resolution, updates, cleanup, and invalid values. |
packages/text-editor/.storybook/preview.tsx |
Synchronizes Storybook color-mode controls. | Moderate (2 votes): an initial persisted or URL-selected global mode may not apply until the toolbar changes. |
Review details
Suppressed comments (1)
packages/text-editor/src/TextEditor.tsx:32
ColorModeis now part of the exportedTextEditorProps, butsrc/index.tsstill exports onlyTextEditor, so consumers cannot import the new public type from@openworkflowspec/text-editor. The analogous diagram package re-exports its color-mode types from its entry point; re-export the public color-mode type here as well.
colorMode?: ColorMode;
- Files reviewed: 7/7 changed files
- Comments generated: 5
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Signed-off-by: Kumar Aditya Raj <sedulous.0007@gmail.com>
kumaradityaraj
requested review from
fantonangeli,
handreyrc and
lornakelly
September 16, 2026 09:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Close #394
Description
Adds theme support to
@openworkflowspec/text-editorby introducing a theme prop that resolves to a Monaco Editor theme.Changes
TextEditor.Testing
Note (BUG)
Storybook has a bug in which the args and Globals are not getting in sync with each other which may lead to the docs reloads in dev mode and less reloads in production. In this pr all the features work perfectly fine in components but in docs it does not work. Link to official storybook bug issue - ISSE1 ISSUE2