Compare commits
1 Commits
ed1ee886db
...
agent/rex/
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bcaa526a69 |
@@ -1,31 +0,0 @@
|
|||||||
<!-- Backdrop overlay — click to dismiss -->
|
|
||||||
<div class="global-action-modal__backdrop" #backdrop (click)="onBackdropClick()"></div>
|
|
||||||
|
|
||||||
<!-- Modal panel -->
|
|
||||||
<div class="global-action-modal__panel" (click)="onModalClick($event)" role="dialog" aria-modal="true" aria-label="Global Actions">
|
|
||||||
|
|
||||||
<!-- Header -->
|
|
||||||
<div class="global-action-modal__header">
|
|
||||||
<h2 class="global-action-modal__title">Global Actions</h2>
|
|
||||||
<button matIconButton
|
|
||||||
class="global-action-modal__close"
|
|
||||||
aria-label="Close modal"
|
|
||||||
(click)="onClose()">
|
|
||||||
<mat-icon>close</mat-icon>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Action grid -->
|
|
||||||
<div class="global-action-modal__actions">
|
|
||||||
@for (action of actions; track action.key) {
|
|
||||||
<button class="global-action-modal__action-btn global-action-modal__action-btn--{{ action.color }}"
|
|
||||||
(click)="onAction(action)">
|
|
||||||
<div class="global-action-modal__action-icon">
|
|
||||||
<mat-icon>{{ action.icon }}</mat-icon>
|
|
||||||
</div>
|
|
||||||
<span class="global-action-modal__action-label">{{ action.label }}</span>
|
|
||||||
<span class="global-action-modal__action-desc">{{ action.description }}</span>
|
|
||||||
</button>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@@ -1,198 +0,0 @@
|
|||||||
// ============================================================================
|
|
||||||
// Global Action Modal — Tactical Dark Mode Styling
|
|
||||||
// Uses Control Center design tokens from styles.scss
|
|
||||||
// ============================================================================
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
// Backdrop
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
:host {
|
|
||||||
display: block;
|
|
||||||
position: fixed;
|
|
||||||
inset: 0;
|
|
||||||
z-index: 1000;
|
|
||||||
}
|
|
||||||
|
|
||||||
.global-action-modal__backdrop {
|
|
||||||
position: absolute;
|
|
||||||
inset: 0;
|
|
||||||
background: rgba(0, 0, 0, 0.6);
|
|
||||||
backdrop-filter: blur(4px);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
// Modal Panel
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
.global-action-modal__panel {
|
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
left: 50%;
|
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
width: min(560px, calc(100vw - 48px));
|
|
||||||
background: var(--cc-surface-container);
|
|
||||||
border: 1px solid var(--cc-outline);
|
|
||||||
border-radius: var(--cc-card-border-radius);
|
|
||||||
box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
// Header
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
.global-action-modal__header {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
padding: 20px 24px 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.global-action-modal__title {
|
|
||||||
margin: 0;
|
|
||||||
font-size: 20px;
|
|
||||||
font-weight: 600;
|
|
||||||
color: var(--cc-on-surface);
|
|
||||||
letter-spacing: 0.01em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.global-action-modal__close {
|
|
||||||
--mat-icon-button-state-layer-color: transparent;
|
|
||||||
color: var(--cc-on-surface-variant);
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
color: var(--cc-on-surface);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
// Action Grid
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
.global-action-modal__actions {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: 1fr 1fr;
|
|
||||||
gap: 12px;
|
|
||||||
padding: 12px 24px 24px;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
// Action Button
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
.global-action-modal__action-btn {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
padding: 20px 16px;
|
|
||||||
border: 1px solid var(--cc-outline);
|
|
||||||
border-radius: 12px;
|
|
||||||
background: var(--cc-surface);
|
|
||||||
color: var(--cc-on-surface);
|
|
||||||
cursor: pointer;
|
|
||||||
transition: background 150ms ease, border-color 150ms ease, transform 100ms ease;
|
|
||||||
font-family: inherit;
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background: var(--cc-surface-container-high);
|
|
||||||
border-color: var(--cc-on-surface-variant);
|
|
||||||
transform: translateY(-1px);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:active {
|
|
||||||
transform: translateY(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:focus-visible {
|
|
||||||
outline: 2px solid var(--mat-sys-primary, #38BDF8);
|
|
||||||
outline-offset: 2px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Action icon wrapper
|
|
||||||
.global-action-modal__action-icon {
|
|
||||||
width: 48px;
|
|
||||||
height: 48px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
border-radius: 12px;
|
|
||||||
|
|
||||||
.mat-icon {
|
|
||||||
width: 28px;
|
|
||||||
height: 28px;
|
|
||||||
font-size: 28px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Action label
|
|
||||||
.global-action-modal__action-label {
|
|
||||||
font-size: 15px;
|
|
||||||
font-weight: 600;
|
|
||||||
letter-spacing: 0.01em;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Action description
|
|
||||||
.global-action-modal__action-desc {
|
|
||||||
font-size: 12px;
|
|
||||||
color: var(--cc-on-surface-variant);
|
|
||||||
line-height: 1.4;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
// Color Variants — per-action accent colors
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
.global-action-modal__action-btn--deploy {
|
|
||||||
.global-action-modal__action-icon {
|
|
||||||
background: var(--status-active-bg);
|
|
||||||
color: var(--status-active);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
border-color: var(--status-active);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.global-action-modal__action-btn--pause {
|
|
||||||
.global-action-modal__action-icon {
|
|
||||||
background: var(--status-idle-bg);
|
|
||||||
color: var(--status-idle);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
border-color: var(--status-idle);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.global-action-modal__action-btn--emergency {
|
|
||||||
.global-action-modal__action-icon {
|
|
||||||
background: var(--status-error-bg);
|
|
||||||
color: var(--status-error);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
border-color: var(--status-error);
|
|
||||||
}
|
|
||||||
|
|
||||||
.global-action-modal__action-label {
|
|
||||||
color: var(--status-error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.global-action-modal__action-btn--add {
|
|
||||||
.global-action-modal__action-icon {
|
|
||||||
background: var(--status-thinking-bg);
|
|
||||||
color: var(--status-thinking);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
border-color: var(--status-thinking);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
// Responsive — stack single column on narrow viewports
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
@media (max-width: 400px) {
|
|
||||||
.global-action-modal__actions {
|
|
||||||
grid-template-columns: 1fr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,87 +0,0 @@
|
|||||||
import { ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Output, ViewChild } from '@angular/core';
|
|
||||||
import { MatIconModule } from '@angular/material/icon';
|
|
||||||
import { MatButtonModule } from '@angular/material/button';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Global Action Modal — overlay for fleet-wide commands.
|
|
||||||
*
|
|
||||||
* Four main actions: Deploy All, Pause All, Emergency Stop, Add Agent.
|
|
||||||
* Tactical Dark Mode styling using Control Center design tokens.
|
|
||||||
* Dismisses on backdrop click or close button.
|
|
||||||
*/
|
|
||||||
@Component({
|
|
||||||
selector: 'app-global-action-modal',
|
|
||||||
standalone: true,
|
|
||||||
imports: [MatIconModule, MatButtonModule],
|
|
||||||
templateUrl: './global-action-modal.component.html',
|
|
||||||
styleUrl: './global-action-modal.component.scss',
|
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
||||||
})
|
|
||||||
export class GlobalActionModalComponent {
|
|
||||||
/** Emitted when any action button is clicked. Payload is the action key. */
|
|
||||||
@Output() readonly actionSelected = new EventEmitter<GlobalAction>();
|
|
||||||
|
|
||||||
/** Emitted when the modal is dismissed (backdrop click or close button). */
|
|
||||||
@Output() readonly dismissed = new EventEmitter<void>();
|
|
||||||
|
|
||||||
@ViewChild('backdrop') backdropEl!: ElementRef<HTMLElement>;
|
|
||||||
|
|
||||||
/** All available global actions. */
|
|
||||||
readonly actions: GlobalActionDef[] = [
|
|
||||||
{
|
|
||||||
key: 'deploy-all',
|
|
||||||
label: 'Deploy All',
|
|
||||||
description: 'Deploy all agents in the fleet',
|
|
||||||
icon: 'rocket_launch',
|
|
||||||
color: 'deploy',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'pause-all',
|
|
||||||
label: 'Pause All',
|
|
||||||
description: 'Pause all running agents',
|
|
||||||
icon: 'pause_circle',
|
|
||||||
color: 'pause',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'emergency-stop',
|
|
||||||
label: 'Emergency Stop',
|
|
||||||
description: 'Immediately halt all agents',
|
|
||||||
icon: 'emergency',
|
|
||||||
color: 'emergency',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'add-agent',
|
|
||||||
label: 'Add Agent',
|
|
||||||
description: 'Register a new agent to the fleet',
|
|
||||||
icon: 'person_add',
|
|
||||||
color: 'add',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
onBackdropClick(): void {
|
|
||||||
this.dismissed.emit();
|
|
||||||
}
|
|
||||||
|
|
||||||
onModalClick(event: Event): void {
|
|
||||||
// Prevent clicks inside the modal panel from closing it
|
|
||||||
event.stopPropagation();
|
|
||||||
}
|
|
||||||
|
|
||||||
onClose(): void {
|
|
||||||
this.dismissed.emit();
|
|
||||||
}
|
|
||||||
|
|
||||||
onAction(action: GlobalActionDef): void {
|
|
||||||
this.actionSelected.emit(action.key);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export type GlobalAction = 'deploy-all' | 'pause-all' | 'emergency-stop' | 'add-agent';
|
|
||||||
|
|
||||||
export interface GlobalActionDef {
|
|
||||||
key: GlobalAction;
|
|
||||||
label: string;
|
|
||||||
description: string;
|
|
||||||
icon: string;
|
|
||||||
color: 'deploy' | 'pause' | 'emergency' | 'add';
|
|
||||||
}
|
|
||||||
1
frontend/src/app/components/index.ts
Normal file
1
frontend/src/app/components/index.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export * from './quick-jump-button/quick-jump-button.component';
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<button
|
||||||
|
mat-icon-button
|
||||||
|
class="quick-jump-button"
|
||||||
|
[attr.aria-label]="'Jump to agent session'"
|
||||||
|
(click)="onJumpClick()"
|
||||||
|
>
|
||||||
|
<mat-icon>arrow_forward</mat-icon>
|
||||||
|
</button>
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
// ============================================================================
|
||||||
|
// Quick-Jump Button — M3 FilledTonalIconButton
|
||||||
|
// Per spec Section 7.3: Agent Card Quick-Jump action
|
||||||
|
// M3 spec: FilledTonalIconButton uses secondary container color
|
||||||
|
// with 8% state layer overlay for hover/focus.
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
.quick-jump-button {
|
||||||
|
// M3 FilledTonalIconButton: secondary-container background
|
||||||
|
// Angular Material mat-icon-button sets up the base shape (40x40, round).
|
||||||
|
// We override the color tokens to match FilledTonal style.
|
||||||
|
--mdc-icon-button-icon-color: var(--mat-sys-on-secondary-container);
|
||||||
|
background-color: var(--mat-sys-secondary-container);
|
||||||
|
border-radius: 50%;
|
||||||
|
transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
|
|
||||||
|
// M3 State Layer: 8% overlay on hover
|
||||||
|
&:hover {
|
||||||
|
background-color: var(--mat-sys-secondary-container);
|
||||||
|
// State layer overlay using a pseudo-element for precise 8% opacity
|
||||||
|
&::after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
border-radius: 50%;
|
||||||
|
background-color: var(--mat-sys-on-secondary-container);
|
||||||
|
opacity: 0.08;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// M3 State Layer: 12% overlay on focus-visible (slightly stronger for accessibility)
|
||||||
|
&:focus-visible {
|
||||||
|
background-color: var(--mat-sys-secondary-container);
|
||||||
|
outline: 3px solid var(--status-active);
|
||||||
|
outline-offset: 2px;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
border-radius: 50%;
|
||||||
|
background-color: var(--mat-sys-on-secondary-container);
|
||||||
|
opacity: 0.12;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// M3 State Layer: 12% overlay on active/pressed
|
||||||
|
&:active {
|
||||||
|
background-color: var(--mat-sys-secondary-container);
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
border-radius: 50%;
|
||||||
|
background-color: var(--mat-sys-on-secondary-container);
|
||||||
|
opacity: 0.12;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Icon color stays on-secondary-container across all states
|
||||||
|
.mat-icon {
|
||||||
|
color: var(--mat-sys-on-secondary-container);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
import { ChangeDetectionStrategy, Component, EventEmitter, Output } from '@angular/core';
|
||||||
|
import { MatIconButton } from '@angular/material/button';
|
||||||
|
import { MatIcon } from '@angular/material/icon';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Quick-Jump Button — M3 FilledTonalIconButton
|
||||||
|
*
|
||||||
|
* An icon button that emits a navigation event for jumping to an agent session.
|
||||||
|
* Uses the Material Design 3 FilledTonalIconButton style with 8% state layer
|
||||||
|
* overlay on hover and focus.
|
||||||
|
*
|
||||||
|
* Per spec Section 7.3: Agent Card Component Interface
|
||||||
|
*/
|
||||||
|
@Component({
|
||||||
|
selector: 'app-quick-jump-button',
|
||||||
|
standalone: true,
|
||||||
|
imports: [MatIconButton, MatIcon],
|
||||||
|
templateUrl: './quick-jump-button.component.html',
|
||||||
|
styleUrl: './quick-jump-button.component.scss',
|
||||||
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
|
})
|
||||||
|
export class QuickJumpButtonComponent {
|
||||||
|
/** Emitted when the button is clicked, carrying the session key for navigation. */
|
||||||
|
@Output() jumpClick = new EventEmitter<string>();
|
||||||
|
|
||||||
|
/** The session key to navigate to. Set by the parent agent card. */
|
||||||
|
sessionKey = '';
|
||||||
|
|
||||||
|
onJumpClick(): void {
|
||||||
|
this.jumpClick.emit(this.sessionKey);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user