Spaces:
Running
Running
Commit
·
2826758
1
Parent(s):
0cc4d1b
theme edit and tool display fix
Browse files
frontend/src/components/SessionSidebar/SessionSidebar.tsx
CHANGED
|
@@ -130,7 +130,7 @@ export default function SessionSidebar({ onClose }: SessionSidebarProps) {
|
|
| 130 |
fontSize: '0.7rem',
|
| 131 |
py: 0.25,
|
| 132 |
'& .MuiAlert-message': { py: 0 },
|
| 133 |
-
borderColor: '#
|
| 134 |
color: 'var(--text)',
|
| 135 |
}}
|
| 136 |
>
|
|
@@ -296,7 +296,7 @@ export default function SessionSidebar({ onClose }: SessionSidebarProps) {
|
|
| 296 |
py: 1.25,
|
| 297 |
border: 'none',
|
| 298 |
borderRadius: '10px',
|
| 299 |
-
bgcolor: '#
|
| 300 |
color: '#000',
|
| 301 |
fontSize: '0.85rem',
|
| 302 |
fontWeight: 700,
|
|
|
|
| 130 |
fontSize: '0.7rem',
|
| 131 |
py: 0.25,
|
| 132 |
'& .MuiAlert-message': { py: 0 },
|
| 133 |
+
borderColor: '#FF9D00',
|
| 134 |
color: 'var(--text)',
|
| 135 |
}}
|
| 136 |
>
|
|
|
|
| 296 |
py: 1.25,
|
| 297 |
border: 'none',
|
| 298 |
borderRadius: '10px',
|
| 299 |
+
bgcolor: '#FF9D00',
|
| 300 |
color: '#000',
|
| 301 |
fontSize: '0.85rem',
|
| 302 |
fontWeight: 700,
|
frontend/src/components/WelcomeScreen/WelcomeScreen.tsx
CHANGED
|
@@ -12,8 +12,8 @@ import { useAgentStore } from '@/store/agentStore';
|
|
| 12 |
import { apiFetch } from '@/utils/api';
|
| 13 |
import { isInIframe, triggerLogin } from '@/hooks/useAuth';
|
| 14 |
|
| 15 |
-
/** HF brand
|
| 16 |
-
const HF_ORANGE = '#
|
| 17 |
|
| 18 |
export default function WelcomeScreen() {
|
| 19 |
const { createSession } = useSessionStore();
|
|
@@ -149,11 +149,11 @@ export default function WelcomeScreen() {
|
|
| 149 |
borderRadius: '12px',
|
| 150 |
bgcolor: HF_ORANGE,
|
| 151 |
color: '#000',
|
| 152 |
-
boxShadow: '0 4px 24px rgba(
|
| 153 |
textDecoration: 'none',
|
| 154 |
'&:hover': {
|
| 155 |
bgcolor: '#FFB340',
|
| 156 |
-
boxShadow: '0 6px 32px rgba(
|
| 157 |
},
|
| 158 |
}}
|
| 159 |
>
|
|
@@ -174,10 +174,10 @@ export default function WelcomeScreen() {
|
|
| 174 |
borderRadius: '12px',
|
| 175 |
bgcolor: HF_ORANGE,
|
| 176 |
color: '#000',
|
| 177 |
-
boxShadow: '0 4px 24px rgba(
|
| 178 |
'&:hover': {
|
| 179 |
bgcolor: '#FFB340',
|
| 180 |
-
boxShadow: '0 6px 32px rgba(
|
| 181 |
},
|
| 182 |
}}
|
| 183 |
>
|
|
@@ -202,13 +202,13 @@ export default function WelcomeScreen() {
|
|
| 202 |
borderRadius: '12px',
|
| 203 |
bgcolor: HF_ORANGE,
|
| 204 |
color: '#000',
|
| 205 |
-
boxShadow: '0 4px 24px rgba(
|
| 206 |
'&:hover': {
|
| 207 |
bgcolor: '#FFB340',
|
| 208 |
-
boxShadow: '0 6px 32px rgba(
|
| 209 |
},
|
| 210 |
'&.Mui-disabled': {
|
| 211 |
-
bgcolor: 'rgba(
|
| 212 |
color: 'rgba(0,0,0,0.45)',
|
| 213 |
},
|
| 214 |
}}
|
|
|
|
| 12 |
import { apiFetch } from '@/utils/api';
|
| 13 |
import { isInIframe, triggerLogin } from '@/hooks/useAuth';
|
| 14 |
|
| 15 |
+
/** HF brand orange */
|
| 16 |
+
const HF_ORANGE = '#FF9D00';
|
| 17 |
|
| 18 |
export default function WelcomeScreen() {
|
| 19 |
const { createSession } = useSessionStore();
|
|
|
|
| 149 |
borderRadius: '12px',
|
| 150 |
bgcolor: HF_ORANGE,
|
| 151 |
color: '#000',
|
| 152 |
+
boxShadow: '0 4px 24px rgba(255, 157, 0, 0.3)',
|
| 153 |
textDecoration: 'none',
|
| 154 |
'&:hover': {
|
| 155 |
bgcolor: '#FFB340',
|
| 156 |
+
boxShadow: '0 6px 32px rgba(255, 157, 0, 0.45)',
|
| 157 |
},
|
| 158 |
}}
|
| 159 |
>
|
|
|
|
| 174 |
borderRadius: '12px',
|
| 175 |
bgcolor: HF_ORANGE,
|
| 176 |
color: '#000',
|
| 177 |
+
boxShadow: '0 4px 24px rgba(255, 157, 0, 0.3)',
|
| 178 |
'&:hover': {
|
| 179 |
bgcolor: '#FFB340',
|
| 180 |
+
boxShadow: '0 6px 32px rgba(255, 157, 0, 0.45)',
|
| 181 |
},
|
| 182 |
}}
|
| 183 |
>
|
|
|
|
| 202 |
borderRadius: '12px',
|
| 203 |
bgcolor: HF_ORANGE,
|
| 204 |
color: '#000',
|
| 205 |
+
boxShadow: '0 4px 24px rgba(255, 157, 0, 0.3)',
|
| 206 |
'&:hover': {
|
| 207 |
bgcolor: '#FFB340',
|
| 208 |
+
boxShadow: '0 6px 32px rgba(255, 157, 0, 0.45)',
|
| 209 |
},
|
| 210 |
'&.Mui-disabled': {
|
| 211 |
+
bgcolor: 'rgba(255, 157, 0, 0.35)',
|
| 212 |
color: 'rgba(0,0,0,0.45)',
|
| 213 |
},
|
| 214 |
}}
|
frontend/src/store/agentStore.ts
CHANGED
|
@@ -253,22 +253,44 @@ export const useAgentStore = create<AgentStore>()(
|
|
| 253 |
const latestTools = state.traceLogs.length > 0 ? [...state.traceLogs] : undefined;
|
| 254 |
if (!latestTools) return;
|
| 255 |
|
|
|
|
|
|
|
|
|
|
| 256 |
const updatedMessages = currentMessages.map((msg) => {
|
| 257 |
if (msg.id !== state.currentTurnMessageId) return msg;
|
| 258 |
|
| 259 |
const segments = msg.segments ? [...msg.segments] : [];
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
segments[
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 272 |
}
|
| 273 |
|
| 274 |
return { ...msg, segments };
|
|
|
|
| 253 |
const latestTools = state.traceLogs.length > 0 ? [...state.traceLogs] : undefined;
|
| 254 |
if (!latestTools) return;
|
| 255 |
|
| 256 |
+
// Build a lookup of the latest state for each tool by id
|
| 257 |
+
const toolById = new Map(latestTools.map(t => [t.id, t]));
|
| 258 |
+
|
| 259 |
const updatedMessages = currentMessages.map((msg) => {
|
| 260 |
if (msg.id !== state.currentTurnMessageId) return msg;
|
| 261 |
|
| 262 |
const segments = msg.segments ? [...msg.segments] : [];
|
| 263 |
+
|
| 264 |
+
// First pass: update existing tools in their original segments
|
| 265 |
+
const placedToolIds = new Set<string>();
|
| 266 |
+
for (let i = 0; i < segments.length; i++) {
|
| 267 |
+
if (segments[i].type === 'tools' && segments[i].tools) {
|
| 268 |
+
segments[i] = {
|
| 269 |
+
...segments[i],
|
| 270 |
+
tools: segments[i].tools!.map(t => {
|
| 271 |
+
placedToolIds.add(t.id);
|
| 272 |
+
return toolById.get(t.id) || t;
|
| 273 |
+
}),
|
| 274 |
+
};
|
| 275 |
+
}
|
| 276 |
+
}
|
| 277 |
+
|
| 278 |
+
// Collect only genuinely new tools (not yet in any segment)
|
| 279 |
+
const newTools = latestTools.filter(t => !placedToolIds.has(t.id));
|
| 280 |
+
|
| 281 |
+
if (newTools.length > 0) {
|
| 282 |
+
const lastToolsIdx = segments.map((s) => s.type).lastIndexOf('tools');
|
| 283 |
+
|
| 284 |
+
if (lastToolsIdx >= 0 && lastToolsIdx === segments.length - 1) {
|
| 285 |
+
// Last segment is tools — append new tools to it
|
| 286 |
+
segments[lastToolsIdx] = {
|
| 287 |
+
...segments[lastToolsIdx],
|
| 288 |
+
tools: [...(segments[lastToolsIdx].tools || []), ...newTools],
|
| 289 |
+
};
|
| 290 |
+
} else {
|
| 291 |
+
// Text came after previous tools — create a new segment with only new tools
|
| 292 |
+
segments.push({ type: 'tools', tools: newTools });
|
| 293 |
+
}
|
| 294 |
}
|
| 295 |
|
| 296 |
return { ...msg, segments };
|
frontend/src/theme.ts
CHANGED
|
@@ -38,14 +38,14 @@ const darkVars = {
|
|
| 38 |
'--surface': '#121416',
|
| 39 |
'--text': '#E6EEF8',
|
| 40 |
'--muted-text': '#98A0AA',
|
| 41 |
-
'--accent-yellow': '#
|
| 42 |
-
'--accent-yellow-weak': 'rgba(
|
| 43 |
'--accent-green': '#2FCC71',
|
| 44 |
'--accent-red': '#E05A4F',
|
| 45 |
'--shadow-1': '0 6px 18px rgba(2,6,12,0.55)',
|
| 46 |
'--radius-lg': '20px',
|
| 47 |
'--radius-md': '12px',
|
| 48 |
-
'--focus': '0 0 0 3px rgba(
|
| 49 |
'--border': 'rgba(255,255,255,0.03)',
|
| 50 |
'--border-hover': 'rgba(255,255,255,0.1)',
|
| 51 |
'--code-bg': 'rgba(0,0,0,0.5)',
|
|
@@ -75,14 +75,14 @@ const lightVars = {
|
|
| 75 |
'--surface': '#F0F1F3',
|
| 76 |
'--text': '#1A1A2E',
|
| 77 |
'--muted-text': '#6B7280',
|
| 78 |
-
'--accent-yellow': '#
|
| 79 |
-
'--accent-yellow-weak': 'rgba(
|
| 80 |
'--accent-green': '#16A34A',
|
| 81 |
'--accent-red': '#DC2626',
|
| 82 |
'--shadow-1': '0 4px 12px rgba(0,0,0,0.08)',
|
| 83 |
'--radius-lg': '20px',
|
| 84 |
'--radius-md': '12px',
|
| 85 |
-
'--focus': '0 0 0 3px rgba(
|
| 86 |
'--border': 'rgba(0,0,0,0.08)',
|
| 87 |
'--border-hover': 'rgba(0,0,0,0.15)',
|
| 88 |
'--code-bg': 'rgba(0,0,0,0.04)',
|
|
@@ -93,7 +93,7 @@ const lightVars = {
|
|
| 93 |
'--msg-gradient': 'linear-gradient(180deg, rgba(0,0,0,0.01), transparent)',
|
| 94 |
'--body-gradient': 'linear-gradient(180deg, #FFFFFF, #F7F8FA)',
|
| 95 |
'--scrollbar-thumb': '#C4C8CC',
|
| 96 |
-
'--success-icon': '#
|
| 97 |
'--error-icon': '#DC2626',
|
| 98 |
'--clickable-text': 'rgba(0, 0, 0, 0.85)',
|
| 99 |
'--clickable-underline': 'rgba(0,0,0,0.25)',
|
|
@@ -176,14 +176,14 @@ function makeTextField() {
|
|
| 176 |
export const darkTheme = createTheme({
|
| 177 |
palette: {
|
| 178 |
mode: 'dark',
|
| 179 |
-
primary: { main: '#
|
| 180 |
-
secondary: { main: '#
|
| 181 |
background: { default: '#0B0D10', paper: '#0F1316' },
|
| 182 |
text: { primary: '#E6EEF8', secondary: '#98A0AA' },
|
| 183 |
divider: 'rgba(255,255,255,0.03)',
|
| 184 |
success: { main: '#2FCC71' },
|
| 185 |
error: { main: '#E05A4F' },
|
| 186 |
-
warning: { main: '#
|
| 187 |
info: { main: '#58A6FF' },
|
| 188 |
},
|
| 189 |
typography: sharedTypography,
|
|
@@ -199,14 +199,14 @@ export const darkTheme = createTheme({
|
|
| 199 |
export const lightTheme = createTheme({
|
| 200 |
palette: {
|
| 201 |
mode: 'light',
|
| 202 |
-
primary: { main: '#
|
| 203 |
-
secondary: { main: '#
|
| 204 |
background: { default: '#FFFFFF', paper: '#F7F8FA' },
|
| 205 |
text: { primary: '#1A1A2E', secondary: '#6B7280' },
|
| 206 |
divider: 'rgba(0,0,0,0.08)',
|
| 207 |
success: { main: '#16A34A' },
|
| 208 |
error: { main: '#DC2626' },
|
| 209 |
-
warning: { main: '#
|
| 210 |
info: { main: '#2563EB' },
|
| 211 |
},
|
| 212 |
typography: sharedTypography,
|
|
|
|
| 38 |
'--surface': '#121416',
|
| 39 |
'--text': '#E6EEF8',
|
| 40 |
'--muted-text': '#98A0AA',
|
| 41 |
+
'--accent-yellow': '#FF9D00',
|
| 42 |
+
'--accent-yellow-weak': 'rgba(255,157,0,0.08)',
|
| 43 |
'--accent-green': '#2FCC71',
|
| 44 |
'--accent-red': '#E05A4F',
|
| 45 |
'--shadow-1': '0 6px 18px rgba(2,6,12,0.55)',
|
| 46 |
'--radius-lg': '20px',
|
| 47 |
'--radius-md': '12px',
|
| 48 |
+
'--focus': '0 0 0 3px rgba(255,157,0,0.12)',
|
| 49 |
'--border': 'rgba(255,255,255,0.03)',
|
| 50 |
'--border-hover': 'rgba(255,255,255,0.1)',
|
| 51 |
'--code-bg': 'rgba(0,0,0,0.5)',
|
|
|
|
| 75 |
'--surface': '#F0F1F3',
|
| 76 |
'--text': '#1A1A2E',
|
| 77 |
'--muted-text': '#6B7280',
|
| 78 |
+
'--accent-yellow': '#FF9D00',
|
| 79 |
+
'--accent-yellow-weak': 'rgba(255,157,0,0.08)',
|
| 80 |
'--accent-green': '#16A34A',
|
| 81 |
'--accent-red': '#DC2626',
|
| 82 |
'--shadow-1': '0 4px 12px rgba(0,0,0,0.08)',
|
| 83 |
'--radius-lg': '20px',
|
| 84 |
'--radius-md': '12px',
|
| 85 |
+
'--focus': '0 0 0 3px rgba(255,157,0,0.15)',
|
| 86 |
'--border': 'rgba(0,0,0,0.08)',
|
| 87 |
'--border-hover': 'rgba(0,0,0,0.15)',
|
| 88 |
'--code-bg': 'rgba(0,0,0,0.04)',
|
|
|
|
| 93 |
'--msg-gradient': 'linear-gradient(180deg, rgba(0,0,0,0.01), transparent)',
|
| 94 |
'--body-gradient': 'linear-gradient(180deg, #FFFFFF, #F7F8FA)',
|
| 95 |
'--scrollbar-thumb': '#C4C8CC',
|
| 96 |
+
'--success-icon': '#FF9D00',
|
| 97 |
'--error-icon': '#DC2626',
|
| 98 |
'--clickable-text': 'rgba(0, 0, 0, 0.85)',
|
| 99 |
'--clickable-underline': 'rgba(0,0,0,0.25)',
|
|
|
|
| 176 |
export const darkTheme = createTheme({
|
| 177 |
palette: {
|
| 178 |
mode: 'dark',
|
| 179 |
+
primary: { main: '#FF9D00', light: '#FFB740', dark: '#E08C00', contrastText: '#fff' },
|
| 180 |
+
secondary: { main: '#FF9D00' },
|
| 181 |
background: { default: '#0B0D10', paper: '#0F1316' },
|
| 182 |
text: { primary: '#E6EEF8', secondary: '#98A0AA' },
|
| 183 |
divider: 'rgba(255,255,255,0.03)',
|
| 184 |
success: { main: '#2FCC71' },
|
| 185 |
error: { main: '#E05A4F' },
|
| 186 |
+
warning: { main: '#FF9D00' },
|
| 187 |
info: { main: '#58A6FF' },
|
| 188 |
},
|
| 189 |
typography: sharedTypography,
|
|
|
|
| 199 |
export const lightTheme = createTheme({
|
| 200 |
palette: {
|
| 201 |
mode: 'light',
|
| 202 |
+
primary: { main: '#FF9D00', light: '#FFB740', dark: '#E08C00', contrastText: '#fff' },
|
| 203 |
+
secondary: { main: '#E08C00' },
|
| 204 |
background: { default: '#FFFFFF', paper: '#F7F8FA' },
|
| 205 |
text: { primary: '#1A1A2E', secondary: '#6B7280' },
|
| 206 |
divider: 'rgba(0,0,0,0.08)',
|
| 207 |
success: { main: '#16A34A' },
|
| 208 |
error: { main: '#DC2626' },
|
| 209 |
+
warning: { main: '#FF9D00' },
|
| 210 |
info: { main: '#2563EB' },
|
| 211 |
},
|
| 212 |
typography: sharedTypography,
|