Skip to content

Commit 70ef037

Browse files
authored
feat: better colours (#171)
1 parent 5e1ac70 commit 70ef037

File tree

11 files changed

+382
-17
lines changed

11 files changed

+382
-17
lines changed

apps/array/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@
114114
"@xterm/addon-fit": "^0.10.0",
115115
"@xterm/addon-serialize": "^0.13.0",
116116
"@xterm/addon-web-links": "^0.11.0",
117+
"@xterm/addon-webgl": "^0.18.0",
117118
"@xterm/xterm": "^5.5.0",
118119
"ai": "^5.0.75",
119120
"chokidar": "^5.0.0",

apps/array/src/renderer/components/StatusBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function StatusBar({ showKeyHints = true }: StatusBarProps) {
4444

4545
{IS_DEV && (
4646
<Flex align="center" gap="2">
47-
<Badge color="orange" size="1">
47+
<Badge size="1">
4848
<Code size="1" variant="ghost">
4949
DEV
5050
</Code>

apps/array/src/renderer/components/ThemeWrapper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export function ThemeWrapper({ children }: { children: React.ReactNode }) {
88
return (
99
<Theme
1010
appearance={isDarkMode ? "dark" : "light"}
11-
accentColor="orange"
11+
accentColor={isDarkMode ? "orange" : "yellow"}
1212
grayColor="slate"
1313
panelBackground="solid"
1414
radius="none"

apps/array/src/renderer/features/logs/components/DoneView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export function DoneView({ event }: DoneViewProps) {
8787
)}
8888
{event.permissionDenials && event.permissionDenials.length > 0 && (
8989
<Box mt={event.result ? "2" : "0"}>
90-
<Code size="1" color="orange" variant="soft">
90+
<Code size="1" variant="soft">
9191
{event.permissionDenials.length} tool call(s) denied by
9292
permissions
9393
</Code>

apps/array/src/renderer/features/logs/components/LogView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ export function LogView({
234234
<Box
235235
width="8px"
236236
height="8px"
237-
className="rounded-full bg-orange-9"
237+
className="rounded-full bg-accent-9"
238238
/>
239239
<Text size="2" color="gray">
240240
Idle

apps/array/src/renderer/features/task-detail/components/SuggestedTasks.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export function SuggestedTasks({ editor }: SuggestedTasksProps) {
5252
onClick={() =>
5353
handleSuggestionClick(suggestion.title, suggestion.prompt)
5454
}
55-
className="group relative flex cursor-pointer items-start gap-2 rounded border border-gray-6 bg-gray-2 p-2 text-left transition-colors hover:border-orange-6 hover:bg-accent-2"
55+
className="group relative flex cursor-pointer items-start gap-2 rounded border border-gray-6 bg-gray-2 p-2 text-left transition-colors hover:border-accent-6 hover:bg-accent-2"
5656
>
5757
<Flex direction="column" gap="1" style={{ flex: 1 }}>
5858
<Text size="1" weight="medium" className="text-gray-12">

apps/array/src/renderer/features/task-detail/components/TaskFileMentionList.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export const TaskFileMentionList = forwardRef(
119119
return (
120120
<div
121121
ref={containerRef}
122-
className="scrollbar-hide absolute z-[1000] max-h-60 min-w-[300px] overflow-auto rounded border border-orange-6 bg-gray-1 font-mono text-xs shadow-xl"
122+
className="scrollbar-hide absolute z-[1000] max-h-60 min-w-[300px] overflow-auto rounded border border-accent-6 bg-gray-1 font-mono text-xs shadow-xl"
123123
>
124124
{props.items.map((item, index) => {
125125
const isSelected = index === selectedIndex;
@@ -136,8 +136,8 @@ export const TaskFileMentionList = forwardRef(
136136
onMouseEnter={() => setSelectedIndex(index)}
137137
className={`flex w-full cursor-pointer items-center gap-1 px-2 py-0.5 text-left ${
138138
isSelected
139-
? "bg-orange-3 text-orange-11"
140-
: "text-gray-11 hover:bg-orange-2"
139+
? "bg-accent-3 text-accent-11"
140+
: "text-gray-11 hover:bg-accent-2"
141141
}
142142
`}
143143
>

apps/array/src/renderer/features/task-detail/components/TaskInputEditor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function TaskInputEditor({
1616
<Flex
1717
direction="column"
1818
style={{
19-
backgroundColor: "rgba(0, 0, 0, 0.3)",
19+
backgroundColor: "var(--gray-a1)",
2020
borderRadius: "var(--radius-2)",
2121
border: "1px solid var(--gray-a6)",
2222
position: "relative",

apps/array/src/renderer/features/terminal/components/ShellTerminal.tsx

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { SerializeAddon } from "@xterm/addon-serialize";
44
import { WebLinksAddon } from "@xterm/addon-web-links";
55
import { Terminal } from "@xterm/xterm";
66
import "@xterm/xterm/css/xterm.css";
7+
import { useThemeStore } from "@stores/themeStore";
78
import { useEffect, useRef } from "react";
89
import { logger } from "@/renderer/lib/logger";
910
import { useTerminalStore } from "../stores/terminalStore";
@@ -59,6 +60,7 @@ export function ShellTerminal({ cwd, stateKey }: ShellTerminalProps) {
5960
const restoredStateLengthRef = useRef<number>(0);
6061

6162
const terminalStore = useTerminalStore();
63+
const isDarkMode = useThemeStore((state) => state.isDarkMode);
6264
const persistenceKey = stateKey || cwd || "default";
6365

6466
useEffect(() => {
@@ -79,14 +81,23 @@ export function ShellTerminal({ cwd, stateKey }: ShellTerminalProps) {
7981
cursorBlink: true,
8082
fontSize: 12,
8183
fontFamily: "monospace",
82-
theme: {
83-
background: "transparent",
84-
foreground: "#ffffff",
85-
cursor: "#BD6C3A",
86-
cursorAccent: "#ffffff",
87-
selectionBackground: "#532601",
88-
selectionForeground: "#ffffff",
89-
},
84+
theme: isDarkMode
85+
? {
86+
background: "transparent",
87+
foreground: "#eeeeea",
88+
cursor: "#dc9300",
89+
cursorAccent: "#eeeeea",
90+
selectionBackground: "rgba(255, 203, 129, 0.3)",
91+
selectionForeground: "#eeeeea",
92+
}
93+
: {
94+
background: "transparent",
95+
foreground: "#1f1f1f",
96+
cursor: "#dc9300",
97+
cursorAccent: "#1f1f1f",
98+
selectionBackground: "rgba(255, 189, 87, 0.4)",
99+
selectionForeground: "#1f1f1f",
100+
},
90101
cursorStyle: "block",
91102
cursorWidth: 8,
92103
allowProposedApi: true,
@@ -296,14 +307,38 @@ export function ShellTerminal({ cwd, stateKey }: ShellTerminalProps) {
296307
hasReceivedDataRef.current = false;
297308
restoredStateLengthRef.current = 0;
298309
};
310+
// eslint-disable-next-line react-hooks/exhaustive-deps
299311
}, [
300312
cwd,
301313
persistenceKey,
302314
terminalStore.getTerminalState,
303315
terminalStore.setSerializedState,
304316
terminalStore.setSessionId,
317+
isDarkMode,
305318
]);
306319

320+
useEffect(() => {
321+
if (terminal.current) {
322+
terminal.current.options.theme = isDarkMode
323+
? {
324+
background: "transparent",
325+
foreground: "#eeeeea",
326+
cursor: "#dc9300",
327+
cursorAccent: "#eeeeea",
328+
selectionBackground: "rgba(255, 203, 129, 0.3)",
329+
selectionForeground: "#eeeeea",
330+
}
331+
: {
332+
background: "transparent",
333+
foreground: "#1f1f1f",
334+
cursor: "#dc9300",
335+
cursorAccent: "#1f1f1f",
336+
selectionBackground: "rgba(255, 189, 87, 0.4)",
337+
selectionForeground: "#1f1f1f",
338+
};
339+
}
340+
}, [isDarkMode]);
341+
307342
return (
308343
<Box
309344
style={{

0 commit comments

Comments
 (0)