Skip to content

Commit c846bc4

Browse files
committed
Adjust mermaid diagram colors
1 parent efaa0d0 commit c846bc4

File tree

2 files changed

+62
-14
lines changed

2 files changed

+62
-14
lines changed

src/core/prompts/system.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ In each user message, the environment_details will specify the current mode. The
885885
- When starting in PLAN MODE, depending on the user's request, you may need to do some information gathering e.g. using read_file or search_files to get more context about the task. You may also ask the user clarifying questions to get a better understanding of the task. You may return mermaid diagrams to visually display your understanding.
886886
- Once you've gained more context about the user's request, you should architect a detailed plan for how you will accomplish the task. Returning mermaid diagrams may be helpful here as well.
887887
- Then you might ask the user if they are pleased with this plan, or if they would like to make any changes. Think of this as a brainstorming session where you can discuss the task and plan the best way to accomplish it.
888-
- If at any point a mermaid diagram would make your plan clearer to help the user quickly see the structure, you are encouraged to include a Mermaid code block in the response.
888+
- If at any point a mermaid diagram would make your plan clearer to help the user quickly see the structure, you are encouraged to include a Mermaid code block in the response. (Note: if you use colors in your mermaid diagrams, be sure to use high contrast colors so the text is readable.)
889889
- Finally once it seems like you've reached a good plan, ask the user to switch you back to ACT MODE to implement the solution.
890890
891891
====

webview-ui/src/components/common/MermaidBlock.tsx

Lines changed: 61 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,73 @@ import styled from "styled-components"
55
import { vscode } from "../../utils/vscode"
66

77
const MERMAID_THEME = {
8-
background: "#1e1e1e",
9-
textColor: "#ffffff",
10-
mainBkg: "#2d2d2d",
11-
lineColor: "#cccccc",
12-
primaryColor: "#3c3c3c",
8+
background: "#1e1e1e", // VS Code dark theme background
9+
textColor: "#ffffff", // Main text color
10+
mainBkg: "#2d2d2d", // Background for nodes
11+
nodeBorder: "#888888", // Border color for nodes
12+
lineColor: "#cccccc", // Lines connecting nodes
13+
primaryColor: "#3c3c3c", // Primary color for highlights
14+
primaryTextColor: "#ffffff", // Text in primary colored elements
15+
primaryBorderColor: "#888888",
16+
secondaryColor: "#2d2d2d", // Secondary color for alternate elements
17+
tertiaryColor: "#454545", // Third color for special elements
18+
19+
// Class diagram specific
20+
classText: "#ffffff",
21+
22+
// State diagram specific
23+
labelColor: "#ffffff",
24+
25+
// Sequence diagram specific
26+
actorLineColor: "#cccccc",
27+
actorBkg: "#2d2d2d",
28+
actorBorder: "#888888",
29+
actorTextColor: "#ffffff",
30+
31+
// Flow diagram specific
32+
fillType0: "#2d2d2d",
33+
fillType1: "#3c3c3c",
34+
fillType2: "#454545",
1335
}
1436

1537
mermaid.initialize({
1638
startOnLoad: false,
1739
securityLevel: "loose",
1840
theme: "dark",
19-
// themeVariables: {
20-
// background: MERMAID_THEME.background,
21-
// textColor: MERMAID_THEME.textColor,
22-
// mainBkg: MERMAID_THEME.mainBkg,
23-
// lineColor: MERMAID_THEME.lineColor,
24-
// fontSize: "16px",
25-
// primaryColor: MERMAID_THEME.primaryColor,
26-
// },
41+
themeVariables: {
42+
...MERMAID_THEME,
43+
fontSize: "16px",
44+
fontFamily: "var(--vscode-font-family, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif)",
45+
46+
// Additional styling
47+
noteTextColor: "#ffffff",
48+
noteBkgColor: "#454545",
49+
noteBorderColor: "#888888",
50+
51+
// Improve contrast for special elements
52+
critBorderColor: "#ff9580",
53+
critBkgColor: "#803d36",
54+
55+
// Task diagram specific
56+
taskTextColor: "#ffffff",
57+
taskTextOutsideColor: "#ffffff",
58+
taskTextLightColor: "#ffffff",
59+
60+
// Numbers/sections
61+
sectionBkgColor: "#2d2d2d",
62+
sectionBkgColor2: "#3c3c3c",
63+
64+
// Alt sections in sequence diagrams
65+
altBackground: "#2d2d2d",
66+
67+
// Links
68+
linkColor: "#6cb6ff",
69+
70+
// Borders and lines
71+
compositeBackground: "#2d2d2d",
72+
compositeBorder: "#888888",
73+
titleColor: "#ffffff",
74+
},
2775
})
2876

2977
interface MermaidBlockProps {

0 commit comments

Comments
 (0)