System default dark mode#92
Conversation
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
|
@kumaradityaraj Thanks for the PR. Looks like this only handles the first part of ticket for system default but the second part needs to be done "implement an attribute in the component to override this behaviour and force a specific theme" |
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
There was a problem hiding this comment.
Pull request overview
Implements theme switching for the diagram editor by wiring React Flow’s colorMode to a new state (defaulting to system), and removes the previous hardcoded diagram background styling.
Changes:
- Add
colorMode="system"support to@xyflow/reactReactFlowvia component state. - Add a UI
<select>to manually switch betweendark,light, andsystem. - Remove
.diagram-backgroundstyling from the diagram CSS; add a test-run artifact file.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| packages/serverless-workflow-diagram-editor/src/react-flow/diagram/Diagram.tsx | Adds colorMode state, passes it to ReactFlow, and introduces a theme dropdown UI. |
| packages/serverless-workflow-diagram-editor/src/react-flow/diagram/Diagram.css | Removes background styling previously applied via .diagram-background. |
| packages/serverless-workflow-diagram-editor/test-results/.last-run.json | Adds last test run result artifact. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@fantonangeli |
|
@kumaradityaraj I was thinking about:
|
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
Signed-off-by: fantonangeli <fabrizio.antonangeli@gmail.com>
Use sand flow background
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
Signed-off-by: fantonangeli <fabrizio.antonangeli@gmail.com>
…css-classes Implement colorMode css classes
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx:63
DiagramEditorusesprops.refwithuseImperativeHandle, butrefis not passed as a normal prop to function components unless the component is wrapped withReact.forwardRef. As-is, the imperative handle will never be exposed to consumers. ConvertDiagramEditortoforwardRef(removereffromDiagramEditorProps) and use the forwarded ref inuseImperativeHandle.
// Allow imperatively controlling the Editor
React.useImperativeHandle(
props.ref,
() => ({
doSomething: () => {
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
| background-color: #141414; | ||
| } | ||
|
|
||
| @media (prefers-color-scheme: dark) { |
There was a problem hiding this comment.
More of an FYI but because we will be introducing tailwind in a later PR we will need to replace this to tailwind style. I will change this when I am merging tailwind work. For your own info, worth looking up how tailwind implements dark and light styles - no need to change this PR though
| const locale = "en"; | ||
| const isReadOnly = true; | ||
|
|
||
| test("Renders react flow Diagram component", () => { |
There was a problem hiding this comment.
the pattern we are using for tests is it not test if you can change for consistency
Closes Add support for dark and light theme
This feature implements dark mode by using system current status.
Screen.Recording.2026-04-15.at.2.27.00.PM.mov