Skip to content

AI media harness for planning, generating, and editing locally

TypeScript
7.6 KB
Raw Blame
/* ============================================================================
   agent-dock.css — the agent as a docked tool pane: a 36px pane toolbar
   (provider status and ComboBox leading, clear and close trailing; no title),
   the conversation, and a flush text box with a send button. No glass, shadow, glow or halo: it is a
   pane like the inspectors, sitting on the same layer. The pane container
   (placement, splitter, show/hide) is the workspace's (.project-agent-pane).
   ========================================================================== */

.agent-dock {
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface-pane);
}

.agent-dock__header {
  flex: 0 0 auto;
}

/* The picker gives way before the clear and close buttons do. */
.agent-dock__header .ui-pane-header__views {
  flex: 0 1 auto;
}

.agent-dock__action.icon-button {
  width: var(--control-sm);
  height: var(--control-sm);
}

/* A compact provider picker leading the toolbar, after its status light. */
.ui-combo.agent-provider {
  min-width: 0;
  width: auto;
  max-width: 200px;
  height: var(--control-sm);
  min-height: var(--control-sm);
  font-size: var(--text-xs);
}

.agent-provider-light {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
}

.agent-provider-light i {
  width: 8px;
  height: 8px;
  display: block;
  border-radius: 50%;
  background: var(--text-faint);
}

/* Provider state is real information — every state gets a truthful colour. */
.agent-provider--ready i { background: var(--success); }

.agent-provider--authRequired i,
.agent-provider--notInstalled i {
  background: var(--warning);
}

.agent-provider--unavailable i { background: var(--danger); }

.agent-provider--disabled i,
.agent-provider--unknown i {
  background: var(--text-faint);
}

/* --- Conversation ------------------------------------------------------------ */

.agent-conversation {
  user-select: text;
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  overflow-y: auto;
  padding: var(--space-2) var(--space-3);
}

/* Messages are chat bubbles, as in a phone messenger: what you sent sits on
   the right in the accent fill, Slop's side on the left in a neutral bubble.
   The corner nearest the speaker is pinched to read as the bubble's tail. */
.agent-message {
  --bubble-radius: 16px;
  max-width: 85%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  align-self: flex-start;
  gap: 2px;
  color: var(--text-primary);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}

.agent-message__bubble {
  max-width: 100%;
  min-width: 0;
  padding: 6px 12px;
  border: 1px solid var(--stroke-card);
  border-radius: var(--bubble-radius) var(--bubble-radius) var(--bubble-radius) var(--space-1);
  background: var(--fill-control);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Speaker labels: 12px semibold, sentence case, secondary ink. */
.agent-message__speaker {
  padding-inline: var(--space-1);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
}

.agent-message__queued {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  opacity: 0.8;
}

/* Yours: right-aligned, filled accent. The side already says who sent it, so
   "You" is kept for screen readers only. */
.agent-conversation__user,
.agent-conversation__pending {
  align-self: flex-end;
  align-items: flex-end;
}

.agent-conversation__user > .agent-message__bubble,
.agent-conversation__pending > .agent-message__bubble {
  border-color: transparent;
  border-radius: var(--bubble-radius) var(--bubble-radius) var(--space-1) var(--bubble-radius);
  color: var(--on-accent);
  background: var(--accent-fill);
}

.agent-conversation__user > .agent-message__speaker,
.agent-conversation__pending > .agent-message__speaker {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Sent, not answered yet. */
.agent-conversation__pending > .agent-message__bubble {
  opacity: 0.75;
}

.agent-conversation__validation > .agent-message__bubble {
  border-color: var(--warning);
  color: var(--warning);
  background: var(--warning-soft);
}

.agent-conversation__diagnostic > .agent-message__bubble,
.agent-conversation__error > .agent-message__bubble {
  border-color: var(--danger-line);
  color: var(--danger);
  background: var(--danger-soft);
}

/* Slop's replies are formatted messages (MessageText): the blocks carry the
   line breaks, so the bubble's pre-wrap is lifted. */
.agent-conversation__assistant > .agent-message__bubble,
.agent-conversation__output > .agent-message__bubble {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  white-space: normal;
}

.agent-message__bubble :is(p, ul, ol, pre) {
  margin: 0;
}

.agent-message__bubble :is(ul, ol) {
  padding-left: 20px;
}

.agent-message__bubble li + li {
  margin-top: 2px;
}

.agent-message__bubble .message-text__heading {
  font-weight: var(--weight-semibold);
}

.agent-message__bubble code {
  padding: 0 3px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--fill-control-alt);
}

.agent-message__bubble pre {
  padding: var(--space-2);
  overflow-x: auto;
  border-radius: var(--radius-sm);
  background: var(--surface-well);
  white-space: pre;
}

.agent-message__bubble pre code {
  padding: 0;
  background: none;
}

.agent-conversation__thinking {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

/* --- Composer -------------------------------------------------------------------
   A flush TextBox (4px corners, the accent underline on focus) that grows
   with its text, with the send button beside it. */

.agent-composer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2);
  border-top: 1px solid var(--line);
}

/* Two lines at rest; AgentDock grows it with the text up to six lines
   (COMPOSER_MAX_LINES) and then it scrolls, so there is no resize grip. */
.agent-composer__field.text-field {
  min-width: 0;
  flex: 1 1 auto;
  height: auto;
  min-height: 54px;
  padding: 6px var(--space-2);
  font-family: inherit;
  line-height: var(--leading-normal);
  resize: none;
}

.agent-composer__field::placeholder {
  color: var(--text-faint);
}

.agent-composer__send {
  width: var(--icon-button);
  height: var(--icon-button);
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--button-primary-stroke);
  border-bottom-color: var(--button-primary-stroke-bottom);
  border-radius: var(--radius-sm);
  color: var(--on-accent);
  background: var(--button-primary-bg);
  transition: var(--transition-control);
}

.agent-composer__send:hover:not(:disabled) {
  background: var(--button-primary-hover);
}

.agent-composer__send:disabled {
  border-color: transparent;
  color: var(--button-primary-off-ink);
  background: var(--button-primary-off-bg);
}

.agent-composer__send.agent-cancel {
  border-color: var(--stroke-control);
  color: var(--text-primary);
  background: var(--fill-control);
}

.agent-composer__send.agent-cancel:hover {
  background: var(--fill-control-hover);
}

/* The status light beside the picker already shows the chosen provider's
   state (with a tooltip); the same dot repeated inside the closed picker read
   as two indicators. The options in the open list keep theirs. */
.agent-provider.ui-combo > .ui-combo__icon {
  display: none;
}