Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion frontend/src/v2/__tests__/v2-layout-invariants.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ describe('v2 layout invariants (CSS rule presence)', () => {
const podModel = read('../../../../backend/models/Pod.ts');

test('agent Settings key metadata wraps within the page at phone width', () => {
expect(ruleBody(agentSettings, '.v2-agent-settings')).toContain('width: min(100%, 960px)');
expect(ruleBody(agentSettings, '.v2-agent-settings__column')).toContain('width: min(100%, 960px)');
expect(ruleBody(agentSettings, '.v2-agent-settings__key-meta')).toContain('flex-wrap: wrap');
expect(mediaBlockContaining(agentSettings, '.v2-agent-settings__key-meta')).toContain('display: grid');
});
Expand Down Expand Up @@ -5041,6 +5041,12 @@ describe('agent Wake and Pods controls', () => {
expect(remove).toContain('background: var(--v2-surface)');
expect(remove).toContain('border: 1px solid var(--v2-border)');
});

test('message-wake segment wraps its options instead of overflowing the row', () => {
const segment = ruleBody(css, '.v2-agent-wake-pods__segment');
expect(segment).toContain('display: flex');
expect(segment).toContain('flex-wrap: wrap');
});
});

describe('agent runtime and grants fit the Settings column', () => {
Expand Down
120 changes: 61 additions & 59 deletions frontend/src/v2/agents/V2AgentSettingsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -255,67 +255,69 @@ const V2AgentSettingsPage: React.FC = () => {
return (
<main className="v2-agent-settings">
<V2PageHead title={access.displayName || agentName} actions={<Link to="/v2/agents">{t('agentSettings.yourTeam')}</Link>} />
<nav className="v2-agent-settings__tabs" aria-label={t('agentSettings.tabs')}>
<Link to={`/v2/agent/${encodeURIComponent(agentName)}/${encodeURIComponent(instanceId)}`}>{t('agentSettings.profile')}</Link>
<span aria-current="page">{t('agentSettings.settings')}</span>
<Link to={`/v2/agents/${encodeURIComponent(agentName)}/${encodeURIComponent(instanceId)}/memory`}>{t('agentSettings.memory', { defaultValue: 'Memory' })}</Link>
</nav>
<AgentControlLoader agentName={agentName} instanceId={instanceId}
refreshNonce={connectionRefreshNonce} onConnectionState={onConnectionState} />
<V2AgentWakePods agentName={agentName} instanceId={instanceId} updatePod={updatePod} onRemoved={onRemoved} />
<section className="v2-agent-settings__section" aria-labelledby="agent-keys-title">
<div className="v2-agent-settings__section-head">
<h2 id="agent-keys-title">{t('agentSettings.key')}</h2>
{keysForbidden ? null : installation?.runtime?.runtimeType === 'wrapper' ? (
<span>{t('agentSettings.wrapperReconnect')}</span>
) : !disconnected && (
<button type="button" onClick={() => setPendingAction('replace')} disabled={busy}>
{t('agentSettings.regenerate')}
</button>
<div className="v2-agent-settings__column">
<nav className="v2-agent-settings__tabs" aria-label={t('agentSettings.tabs')}>
<Link to={`/v2/agent/${encodeURIComponent(agentName)}/${encodeURIComponent(instanceId)}`}>{t('agentSettings.profile')}</Link>
<span aria-current="page">{t('agentSettings.settings')}</span>
<Link to={`/v2/agents/${encodeURIComponent(agentName)}/${encodeURIComponent(instanceId)}/memory`}>{t('agentSettings.memory', { defaultValue: 'Memory' })}</Link>
</nav>
<AgentControlLoader agentName={agentName} instanceId={instanceId}
refreshNonce={connectionRefreshNonce} onConnectionState={onConnectionState} />
<V2AgentWakePods agentName={agentName} instanceId={instanceId} updatePod={updatePod} onRemoved={onRemoved} />
<section className="v2-agent-settings__section" aria-labelledby="agent-keys-title">
<div className="v2-agent-settings__section-head">
<h2 id="agent-keys-title">{t('agentSettings.key')}</h2>
{keysForbidden ? null : installation?.runtime?.runtimeType === 'wrapper' ? (
<span>{t('agentSettings.wrapperReconnect')}</span>
) : !disconnected && (
<button type="button" onClick={() => setPendingAction('replace')} disabled={busy}>
{t('agentSettings.regenerate')}
</button>
)}
</div>
{error && <p role="alert" className="v2-agent-settings__error">{error}</p>}
{pendingAction === 'replace' && !keysForbidden && (
<div className="v2-agent-settings__confirm" data-testid="agent-key-replace-confirmation">
<p>{t('agentByo.rekey.warning', { name: access.displayName || agentName })}</p>
<div className="v2-agent-settings__actions">
<button type="button" disabled={busy} onClick={replaceKey}>{t('agentByo.rekey.replace')}</button>
<button type="button" disabled={busy} onClick={() => setPendingAction(null)}>{t('agentByo.rekey.cancel')}</button>
</div>
</div>
)}
</div>
{error && <p role="alert" className="v2-agent-settings__error">{error}</p>}
{pendingAction === 'replace' && !keysForbidden && (
<div className="v2-agent-settings__confirm" data-testid="agent-key-replace-confirmation">
<p>{t('agentByo.rekey.warning', { name: access.displayName || agentName })}</p>
<div className="v2-agent-settings__actions">
<button type="button" disabled={busy} onClick={replaceKey}>{t('agentByo.rekey.replace')}</button>
<button type="button" disabled={busy} onClick={() => setPendingAction(null)}>{t('agentByo.rekey.cancel')}</button>
{oneTimeKey && (
<div className="v2-agent-settings__reveal">
<strong>{t('agentSettings.copyNow')}</strong>
<code data-testid="agent-one-time-key">{oneTimeKey}</code>
<button type="button" onClick={() => setOneTimeKey(null)}>{t('agentSettings.done')}</button>
</div>
</div>
)}
{oneTimeKey && (
<div className="v2-agent-settings__reveal">
<strong>{t('agentSettings.copyNow')}</strong>
<code data-testid="agent-one-time-key">{oneTimeKey}</code>
<button type="button" onClick={() => setOneTimeKey(null)}>{t('agentSettings.done')}</button>
</div>
)}
{keysForbidden ? <p className="v2-agent-settings__empty">{t('agentSettings.keyUnavailable')}</p> : (
<>
{activeKeys.length ? <ul className="v2-agent-settings__keys">{activeKeys.map(renderKey)}</ul>
: <p className="v2-agent-settings__empty">{t('agentSettings.noActiveKeys')}</p>}
{revokedKeys.length > 0 && <details className="v2-agent-settings__revoked-keys">
<summary>{t('agentSettings.revokedCount', { count: revokedKeys.length })}</summary>
<ul className="v2-agent-settings__keys">{revokedKeys.map(renderKey)}</ul>
</details>}
</>
)}
</section>
{installation && <V2AgentIdentitySection key={`${agentName}:${instanceId}`} installation={installation} update={update} />}
<V2AgentRuntimeGrants
key={`runtime:${agentName}:${instanceId}`}
name={agentName}
instanceId={instanceId}
runtime={runtime}
onSaveRuntime={runtimeEditable ? async (changes) => {
await updateRuntime(changes);
} : undefined}
/>
<V2AgentPolicy key={`policy:${agentName}:${instanceId}`} agentName={agentName} instanceId={instanceId}
installation={installation} update={update} />
<div className="v2-agent-settings__section">
<V2AgentSkills podId={podId} podName={access?.pods.find((pod) => pod.id === podId)?.name || podId} agentName={agentName} instanceId={instanceId} />
)}
{keysForbidden ? <p className="v2-agent-settings__empty">{t('agentSettings.keyUnavailable')}</p> : (
<>
{activeKeys.length ? <ul className="v2-agent-settings__keys">{activeKeys.map(renderKey)}</ul>
: <p className="v2-agent-settings__empty">{t('agentSettings.noActiveKeys')}</p>}
{revokedKeys.length > 0 && <details className="v2-agent-settings__revoked-keys">
<summary>{t('agentSettings.revokedCount', { count: revokedKeys.length })}</summary>
<ul className="v2-agent-settings__keys">{revokedKeys.map(renderKey)}</ul>
</details>}
</>
)}
</section>
{installation && <V2AgentIdentitySection key={`${agentName}:${instanceId}`} installation={installation} update={update} />}
<V2AgentRuntimeGrants
key={`runtime:${agentName}:${instanceId}`}
name={agentName}
instanceId={instanceId}
runtime={runtime}
onSaveRuntime={runtimeEditable ? async (changes) => {
await updateRuntime(changes);
} : undefined}
/>
<V2AgentPolicy key={`policy:${agentName}:${instanceId}`} agentName={agentName} instanceId={instanceId}
installation={installation} update={update} />
<div className="v2-agent-settings__section">
<V2AgentSkills podId={podId} podName={access?.pods.find((pod) => pod.id === podId)?.name || podId} agentName={agentName} instanceId={instanceId} />
</div>
</div>
</main>
);
Expand Down
25 changes: 14 additions & 11 deletions frontend/src/v2/agents/V2AgentWakePods.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,17 +188,20 @@ const V2AgentWakePods: React.FC<{
{installations.map((entry) => (
<div className="v2-agent-wake-pods__pod" key={entry.podId}>
<Link to={`/v2/pods/${entry.podId}`}>{entry.podName}</Link>
<fieldset className="v2-agent-wake-pods__choice" aria-busy={busyPod === entry.podId}>
<legend>{t('agentSettings.messageWake')}</legend>
{MESSAGE_WAKE_CHOICES.map((choice) => (
<label className="v2-agent-wake-pods__row v2-agent-wake-pods__subrow" key={choice}>
<span>{t(`agentSettings.messageWake_${choice}`)}</span>
<input type="radio" name={`message-wake-${entry.podId}`} value={choice}
checked={messageWakeChoice(entry) === choice}
onChange={() => { void save(entry, MESSAGE_WAKE_SETTINGS[choice]); }} />
</label>
))}
</fieldset>
<div className="v2-agent-wake-pods__choice" role="group" aria-busy={busyPod === entry.podId}
aria-labelledby={`message-wake-label-${entry.podId}`}>
<span id={`message-wake-label-${entry.podId}`}>{t('agentSettings.messageWake')}</span>
<div className="v2-agent-wake-pods__segment">
{MESSAGE_WAKE_CHOICES.map((choice) => (
<label className="v2-agent-wake-pods__option" key={choice}>
<input type="radio" name={`message-wake-${entry.podId}`} value={choice}
checked={messageWakeChoice(entry) === choice}
onChange={() => { void save(entry, MESSAGE_WAKE_SETTINGS[choice]); }} />
<span>{t(`agentSettings.messageWake_${choice}`)}</span>
</label>
))}
</div>
</div>
<label className="v2-agent-wake-pods__row">
<span>{t('agentSettings.boardWake')}</span>
<input type="checkbox" checked={entry.boardWake} disabled={busyPod === entry.podId}
Expand Down
7 changes: 6 additions & 1 deletion frontend/src/v2/agents/v2-agent-settings.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
.v2-agent-settings {
width: 100%;
color: var(--v2-text-primary);
}

/* The page head spans the shell; only the body sits in the 960px column. */
.v2-agent-settings__column {
width: min(100%, 960px);
margin: 0 auto;
padding: 24px;
color: var(--v2-text-primary);
}

.v2-agent-settings__state { padding: 32px; color: var(--v2-text-secondary); }
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/v2/agents/v2-agent-wake-pods.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading