Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

3.4 KB
Raw Blame
/*
  Composer autocomplete (D123–D125, ADR 0024) — full-composer-width panel above
  the input using the model-menu surface recipe; focus never leaves the
  textarea.
*/

/* ============================================================
 * Composer autocomplete (D123–D125, ADR 0024)
 * Full-composer-width panel above the input; model-menu surface
 * recipe; focus never leaves the textarea.
 * ============================================================ */

.composer-autocomplete {
  position: fixed;
  top: 0;
  left: 0;
  right: auto;
  bottom: auto;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: min(100%, calc(100vw - 24px));
  max-height: min(380px, calc(100vh - 160px));
  max-width: calc(100vw - 24px);
  border-radius: var(--radius-lg);
  background: var(--ds-bg-elevated-opaque);
  box-shadow: var(--ds-shadow-dialog);
  border: 1px solid var(--ds-border-subtle);
  color: var(--ds-text-primary);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.composer-autocomplete-anchor {
  display: contents;
}

.composer-autocomplete.is-open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.composer-ac-list {
  overflow-y: auto;
  padding: 6px;
}

.composer-ac-item {
  gap: 8px;
}

.composer-ac-icon {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--ds-text-secondary);
}

.composer-ac-name {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: var(--text-sm-plus, var(--text-md));
}

.composer-ac-hint {
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ds-text-muted);
  font-size: var(--text-xs-plus, var(--text-sm));
}

.composer-ac-desc {
  /* Descriptions use remaining space without shrinking the command name. */
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
  color: var(--ds-text-muted);
  font-size: var(--text-xs-plus, var(--text-sm));
}

.composer-ac-path {
  /* The relative path takes the remaining width and truncates first, so the
     leaf name survives as long as it can. */
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  color: var(--ds-text-muted);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: var(--text-xs-plus, var(--text-sm));
}

.composer-ac-hl {
  color: var(--ds-accent);
  font-weight: var(--font-weight-semibold);
}

.composer-ac-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 12px;
  /* Footer band is a tile, not a rule (D297). */
  background: var(--ds-tile);
  color: var(--ds-text-muted);
  font-size: var(--text-xs-plus, var(--text-sm));
  user-select: none;
}

.composer-ac-truncated {
  flex: 0 0 auto;
}

/* Typed slash invocation rendered as a chip in the transcript (D123).
   Skill invocations carry the user's whole typed body, so the chip wraps
   like .message-user-text instead of truncating. */
.chat-command-chip {
  display: inline-block;
  max-width: 100%;
  vertical-align: top;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 2px 8px;
  border-radius: var(--radius-md);
  background: var(--ds-tile-deep);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: var(--text-sm-plus, var(--text-md));
}