Patchwise Agent Studio: Oracle AI Agent Studio cycles
Browse files
web/src/components/shell/AppSidebar.tsx
CHANGED
|
@@ -14,6 +14,7 @@ import { areaTone } from '../../agents';
|
|
| 14 |
import { runTitle } from '../../runName';
|
| 15 |
import { EnvSwitcher, envKind, useChosenEnv } from './EnvSwitcher';
|
| 16 |
import { setCursorEffects, useCursorEffects } from './CursorFx';
|
|
|
|
| 17 |
import { isWaiting, useWaitsOnMe } from '../../waiting';
|
| 18 |
|
| 19 |
type RunSummary = Schemas['RunSummary'];
|
|
@@ -185,6 +186,7 @@ export function AccountMenu({ compact = false }: { compact?: boolean }) {
|
|
| 185 |
))}
|
| 186 |
<Menu.Divider />
|
| 187 |
<CursorMenuItem />
|
|
|
|
| 188 |
{desktop() && <Menu.Item onClick={() => desktop()?.openSettings()}>Desktop settings</Menu.Item>}
|
| 189 |
<Menu.Item leftSection={<IconLogout size={15} />} aria-label="Sign out" onClick={() => void logout()}>Sign out</Menu.Item>
|
| 190 |
</Menu.Dropdown>
|
|
@@ -201,3 +203,13 @@ function CursorMenuItem() {
|
|
| 201 |
</Menu.Item>
|
| 202 |
);
|
| 203 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
import { runTitle } from '../../runName';
|
| 15 |
import { EnvSwitcher, envKind, useChosenEnv } from './EnvSwitcher';
|
| 16 |
import { setCursorEffects, useCursorEffects } from './CursorFx';
|
| 17 |
+
import { setSimpleMode, useSimpleMode } from './simpleMode';
|
| 18 |
import { isWaiting, useWaitsOnMe } from '../../waiting';
|
| 19 |
|
| 20 |
type RunSummary = Schemas['RunSummary'];
|
|
|
|
| 186 |
))}
|
| 187 |
<Menu.Divider />
|
| 188 |
<CursorMenuItem />
|
| 189 |
+
<SimpleMenuItem />
|
| 190 |
{desktop() && <Menu.Item onClick={() => desktop()?.openSettings()}>Desktop settings</Menu.Item>}
|
| 191 |
<Menu.Item leftSection={<IconLogout size={15} />} aria-label="Sign out" onClick={() => void logout()}>Sign out</Menu.Item>
|
| 192 |
</Menu.Dropdown>
|
|
|
|
| 203 |
</Menu.Item>
|
| 204 |
);
|
| 205 |
}
|
| 206 |
+
|
| 207 |
+
/** Simple mode on or off, for this browser: the test run page shows only the current step, the rest folded away. */
|
| 208 |
+
function SimpleMenuItem() {
|
| 209 |
+
const on = useSimpleMode();
|
| 210 |
+
return (
|
| 211 |
+
<Menu.Item onClick={() => setSimpleMode(!on)} rightSection={on ? <IconCheck size={14} aria-hidden /> : null} aria-label={`Simple mode: ${on ? 'on' : 'off'}`}>
|
| 212 |
+
Simple mode
|
| 213 |
+
</Menu.Item>
|
| 214 |
+
);
|
| 215 |
+
}
|
web/src/components/shell/simpleMode.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { useEffect, useState } from 'react';
|
| 2 |
+
|
| 3 |
+
/* Simple mode: the test run page as one guided column (the current step only, the rest folded away), for people new
|
| 4 |
+
to the app. Each person switches it in the account menu; the choice stays in this browser. */
|
| 5 |
+
|
| 6 |
+
const KEY = 'pw.simple';
|
| 7 |
+
const EVT = 'pw-simple';
|
| 8 |
+
|
| 9 |
+
export const simpleModeOn = () => { try { return window.localStorage.getItem(KEY) === 'on'; } catch { return false; } };
|
| 10 |
+
export function setSimpleMode(on: boolean) {
|
| 11 |
+
try { window.localStorage.setItem(KEY, on ? 'on' : 'off'); } catch { /* storage blocked: the choice lasts this page */ }
|
| 12 |
+
window.dispatchEvent(new Event(EVT));
|
| 13 |
+
}
|
| 14 |
+
export function useSimpleMode() {
|
| 15 |
+
const [on, setOn] = useState(simpleModeOn);
|
| 16 |
+
useEffect(() => {
|
| 17 |
+
const f = () => setOn(simpleModeOn());
|
| 18 |
+
window.addEventListener(EVT, f);
|
| 19 |
+
return () => window.removeEventListener(EVT, f);
|
| 20 |
+
}, []);
|
| 21 |
+
return on;
|
| 22 |
+
}
|
web/src/pages/RunStages.tsx
CHANGED
|
@@ -10,6 +10,7 @@ import type { ModuleReadiness } from '../api/types';
|
|
| 10 |
import { Can, ErrorAlert } from '../components/common';
|
| 11 |
import { EnvBadge, envKind } from '../components/shell/EnvSwitcher';
|
| 12 |
import { useShell } from '../components/shell/prefs';
|
|
|
|
| 13 |
import { useSidePanelOptional } from '../components/shell/SidePanel';
|
| 14 |
import { decisionWords } from '../glossary';
|
| 15 |
import { useRunStream } from '../hooks/useRunStream';
|
|
@@ -137,6 +138,7 @@ export function RunStages({ id }: { id: string }) {
|
|
| 137 |
const failing = mods.reduce((n, m) => n + m.counts.failing, 0);
|
| 138 |
const stage = r ? guideStage(r, scenarios) : 'prepare';
|
| 139 |
const mine = useWaitsOnMe();
|
|
|
|
| 140 |
const forMe = !!r && mine(r);
|
| 141 |
// a run paused for another role says whom it waits for, not "Waiting for you"
|
| 142 |
const waitTag = { words: forMe ? 'Waiting for you' : waitingForWords(r?.pending_gate), tone: forMe ? 'orange' : 'ink' } as const;
|
|
@@ -188,11 +190,20 @@ export function RunStages({ id }: { id: string }) {
|
|
| 188 |
const stopped = stage === 'stopped';
|
| 189 |
|
| 190 |
const prepared = stage !== 'prepare';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 191 |
|
| 192 |
return (
|
| 193 |
<div className="fpt-ws-scroll" ref={scroller} tabIndex={0} aria-label="Test run steps">
|
| 194 |
<div className="fpt-sr-only" role="status">{announce}</div>
|
| 195 |
-
<div className="trio-stages">
|
| 196 |
<header className="trio-rhead">
|
| 197 |
<h1 data-testid="run-title" title={`${browserRun ? 'Full browser run' : 'Quick simulation (no browser)'}${r.modules.length > 1 ? `: ${r.modules.map((m) => MODULE_NAMES[m] ?? m).join(', ')}` : ''}`}>{runAreas(r)} test run</h1>
|
| 198 |
<div className="trio-meta">
|
|
@@ -252,15 +263,14 @@ export function RunStages({ id }: { id: string }) {
|
|
| 252 |
)}
|
| 253 |
{stopped && <StageCard stage="stopped"><Stopped r={r} /></StageCard>}
|
| 254 |
</section>
|
| 255 |
-
|
| 256 |
-
<section className="rc-card">
|
| 257 |
-
<h2 className="rc-h">Your AI team on this run</h2>
|
| 258 |
-
<TeamStrip runId={id} finished={finished || stopped} events={events} />
|
| 259 |
-
</section>
|
| 260 |
-
{prepared && <ScenarioMap id={id} live={stage === 'testing'} onOpen={panel ? (c) => panel.show(browserRun && afterApprove ? 'screens' : 'steps', { scenario: c }) : undefined} />}
|
| 261 |
-
</aside>
|
| 262 |
</div>
|
| 263 |
-
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 264 |
<p className="trio-aifoot">{(r.llm_calls ?? []).length ? `AI on this run: ${(r.llm_calls ?? []).length} call(s). Built-in rules decided the result.` : 'AI on this run: none. Built-in rules did the work.'}{r.created_at ? ` Started ${shortWhen(r.created_at)}.` : ''}</p>
|
| 265 |
</div>
|
| 266 |
</div>
|
|
|
|
| 10 |
import { Can, ErrorAlert } from '../components/common';
|
| 11 |
import { EnvBadge, envKind } from '../components/shell/EnvSwitcher';
|
| 12 |
import { useShell } from '../components/shell/prefs';
|
| 13 |
+
import { useSimpleMode } from '../components/shell/simpleMode';
|
| 14 |
import { useSidePanelOptional } from '../components/shell/SidePanel';
|
| 15 |
import { decisionWords } from '../glossary';
|
| 16 |
import { useRunStream } from '../hooks/useRunStream';
|
|
|
|
| 138 |
const failing = mods.reduce((n, m) => n + m.counts.failing, 0);
|
| 139 |
const stage = r ? guideStage(r, scenarios) : 'prepare';
|
| 140 |
const mine = useWaitsOnMe();
|
| 141 |
+
const simple = useSimpleMode();
|
| 142 |
const forMe = !!r && mine(r);
|
| 143 |
// a run paused for another role says whom it waits for, not "Waiting for you"
|
| 144 |
const waitTag = { words: forMe ? 'Waiting for you' : waitingForWords(r?.pending_gate), tone: forMe ? 'orange' : 'ink' } as const;
|
|
|
|
| 190 |
const stopped = stage === 'stopped';
|
| 191 |
|
| 192 |
const prepared = stage !== 'prepare';
|
| 193 |
+
const side = (
|
| 194 |
+
<aside className="rc-side" aria-label="About this test run">
|
| 195 |
+
<section className="rc-card">
|
| 196 |
+
<h2 className="rc-h">Your AI team on this run</h2>
|
| 197 |
+
<TeamStrip runId={id} finished={finished || stopped} events={events} />
|
| 198 |
+
</section>
|
| 199 |
+
{prepared && <ScenarioMap id={id} live={stage === 'testing'} onOpen={panel ? (c) => panel.show(browserRun && afterApprove ? 'screens' : 'steps', { scenario: c }) : undefined} />}
|
| 200 |
+
</aside>
|
| 201 |
+
);
|
| 202 |
|
| 203 |
return (
|
| 204 |
<div className="fpt-ws-scroll" ref={scroller} tabIndex={0} aria-label="Test run steps">
|
| 205 |
<div className="fpt-sr-only" role="status">{announce}</div>
|
| 206 |
+
<div className="trio-stages" data-simple={simple || undefined}>
|
| 207 |
<header className="trio-rhead">
|
| 208 |
<h1 data-testid="run-title" title={`${browserRun ? 'Full browser run' : 'Quick simulation (no browser)'}${r.modules.length > 1 ? `: ${r.modules.map((m) => MODULE_NAMES[m] ?? m).join(', ')}` : ''}`}>{runAreas(r)} test run</h1>
|
| 209 |
<div className="trio-meta">
|
|
|
|
| 263 |
)}
|
| 264 |
{stopped && <StageCard stage="stopped"><Stopped r={r} /></StageCard>}
|
| 265 |
</section>
|
| 266 |
+
{!simple && side}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 267 |
</div>
|
| 268 |
+
{simple ? (
|
| 269 |
+
<details className="gf-more">
|
| 270 |
+
<summary>More about this run: the AI team, every scenario, results by process step</summary>
|
| 271 |
+
<div className="gf-more-body">{side}{prepared && <ProcessSteps modules={mods} />}</div>
|
| 272 |
+
</details>
|
| 273 |
+
) : prepared && <ProcessSteps modules={mods} />}
|
| 274 |
<p className="trio-aifoot">{(r.llm_calls ?? []).length ? `AI on this run: ${(r.llm_calls ?? []).length} call(s). Built-in rules decided the result.` : 'AI on this run: none. Built-in rules did the work.'}{r.created_at ? ` Started ${shortWhen(r.created_at)}.` : ''}</p>
|
| 275 |
</div>
|
| 276 |
</div>
|
web/src/pages/cockpit.css
CHANGED
|
@@ -96,3 +96,20 @@
|
|
| 96 |
.fpt-ws-detail [aria-label='activity feed'] > [data-kind='error']::before, .fpt-ws-detail [aria-label='activity feed'] > [data-kind='killed']::before { background: var(--red); }
|
| 97 |
.fpt-ws-detail [aria-label='activity feed'] > .fpt-live::before { background: var(--blue); animation: rc-pulse 1.4s var(--ease) infinite; }
|
| 98 |
.fpt-ws-detail [aria-label='activity feed'] > .fpt-card { border-radius: 14px; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
.fpt-ws-detail [aria-label='activity feed'] > [data-kind='error']::before, .fpt-ws-detail [aria-label='activity feed'] > [data-kind='killed']::before { background: var(--red); }
|
| 97 |
.fpt-ws-detail [aria-label='activity feed'] > .fpt-live::before { background: var(--blue); animation: rc-pulse 1.4s var(--ease) infinite; }
|
| 98 |
.fpt-ws-detail [aria-label='activity feed'] > .fpt-card { border-radius: 14px; }
|
| 99 |
+
|
| 100 |
+
/* Simple mode: one guided column, the current step only; the team, the scenario map and the steps fold away */
|
| 101 |
+
.fpt-ws .trio-stages[data-simple] { max-width: 780px; }
|
| 102 |
+
.trio-stages[data-simple] .trio-rhead { text-align: center; }
|
| 103 |
+
.trio-stages[data-simple] .trio-rhead h1 { font-size: 40px; line-height: 46px; }
|
| 104 |
+
.trio-stages[data-simple] .trio-meta { justify-content: center; }
|
| 105 |
+
.trio-stages[data-simple] .rc-phases { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; }
|
| 106 |
+
.trio-stages[data-simple] .rc-phase { padding: 10px 12px; gap: 4px; }
|
| 107 |
+
.trio-stages[data-simple] .rc-ps { display: none; }
|
| 108 |
+
.trio-stages[data-simple] .rc-pl { font-size: 13px; line-height: 18px; }
|
| 109 |
+
.trio-stages[data-simple] .rc-grid { grid-template-columns: minmax(0, 1fr); }
|
| 110 |
+
.trio-stages[data-simple] .rc-eyebrow { text-align: center; }
|
| 111 |
+
.gf-more { margin-top: 18px; border-radius: 16px; background: var(--bg-elev); border: 1px solid var(--sep); }
|
| 112 |
+
.gf-more > summary { padding: 14px 18px; cursor: pointer; font: 600 14px var(--font-display); color: var(--label); }
|
| 113 |
+
.gf-more > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 16px; }
|
| 114 |
+
.gf-more-body { display: flex; flex-direction: column; gap: 14px; padding: 0 14px 14px; }
|
| 115 |
+
.gf-more-body .rc-steps { margin-top: 0; }
|