Skip to content

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

18.9 KB
Raw Blame
/*
  Floating surfaces and transient notices — global search spotlight, toasts,
  update notices and the release-notes dialog, plus the backend/chat error
  banners and the destination page shell.
*/

/*
  Global search (Codex-style ⌘K spotlight): top-anchored dialog over a dimmed
  scrim. Same floating-surface family as .dialog; rows reuse the menu idiom.

  The ⌘K spotlight keeps one veil in both palettes. §8.4/D148 give the light
  theme ~28% ink so white dialogs do not sit under a heavy veil; tokenizing this
  value would either change built-in light paint or record a value the design
  system does not own, so it stays a literal and is listed as an explicit
  exemption in scripts/style-surface-tokens.mjs (issue #341).
*/
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: color-mix(in oklab, #000 45%, transparent);
  padding: clamp(48px, 16vh, 140px) 24px 48px;
  animation: overlay-in var(--motion-duration-normal) var(--motion-ease-out) both;
}

.search-dialog {
  display: flex;
  width: min(100%, 620px);
  max-height: min(460px, 100%);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--ds-border-default);
  border-radius: var(--radius-lg-plus);
  background: var(--ds-bg-elevated-opaque);
  box-shadow: var(--ds-shadow-dialog);
  animation: surface-in-top var(--motion-duration-normal) var(--motion-ease-out) both;
}

.search-input-row {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 8px;
  color: var(--ds-text-muted);
}

.search-input {
  min-width: 0;
  flex: 1;
  border: none;
  background: transparent;
  color: var(--ds-text-primary);
  font-size: var(--text-base-plus);
  line-height: var(--leading-compact-plus);
  outline: none;
}

.search-input::placeholder {
  color: var(--ds-text-muted);
}

.search-results {
  min-height: 0;
  overflow-y: auto;
  padding: 6px;
}

.search-group-label {
  padding: 10px 10px 4px;
  color: var(--ds-text-muted);
  font-size: var(--text-2xs);
  font-weight: var(--font-weight-medium);
}

.search-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md-plus);
  color: var(--ds-text-secondary);
  font-size: var(--text-md-plus);
  line-height: var(--leading-compact);
  text-align: left;
  transition: background var(--motion-duration-fast) var(--motion-ease-out), color var(--motion-duration-fast) var(--motion-ease-out);
}

.search-item.active {
  background: var(--ds-bg-hover);
  color: var(--ds-text-primary);
}

.search-item-icon {
  flex: 0 0 auto;
  color: var(--ds-text-muted);
}

.search-item.active .search-item-icon {
  color: var(--ds-text-secondary);
}

.search-item-title {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Match emphasis inherits the row surface — no highlighter background. */
.search-hit {
  background: transparent;
  color: var(--ds-text-primary);
  font-weight: var(--font-weight-semibold);
}

.search-item-meta {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  max-width: 45%;
  color: var(--ds-text-muted);
  font-size: var(--text-sm);
}

.search-item-project {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-item-running {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: var(--radius-full);
  background: var(--ds-success);
}

.search-item-badge {
  flex: 0 0 auto;
  border-radius: var(--radius-full);
  background: var(--ds-tile-deep);
  padding: 1px 6px;
  font-size: var(--text-2xs);
}

.search-empty {
  padding: 28px 12px;
  color: var(--ds-text-muted);
  font-size: var(--text-md);
  text-align: center;
}

/* Row anchor flash after arriving from a global-search settings hit. */
.settings-anchor-flash {
  border-radius: var(--radius-md);
  animation: settings-anchor-flash 1.8s ease-out;
}

@keyframes settings-anchor-flash {
  0%,
  35% {
    background-color: color-mix(in oklab, var(--ds-accent) 16%, transparent);
  }
  100% {
    background-color: transparent;
  }
}

/*
  Toast notifications (design-system §11.8, component-spec §17).
  Same floating-surface family as the elevated menus: elevated-opaque plate,
  subtle 1px ring, dialog shadow. Variants tint the leading icon only —
  surfaces stay neutral (restraint principle).
  The stack is hosted on the body (Toast.tsx), so `z-toast` outranks the
  `z-dialog` (40) overlay host the dialogs are portaled into; inside the shell
  it would paint under their scrim.
*/
.toast-viewport {
  position: fixed;
  top: 16px;
  left: var(--toast-viewport-center, 50%);
  z-index: 50; /* z-toast */
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 8px;
  width: min(360px, var(--toast-viewport-width, calc(100vw - 32px)));
  transform: translateX(-50%);
  pointer-events: none;
}

/*
  Persistent update notices live in the main pane's top safe area. Keeping
  them opposite the bottom composer prevents multi-line drafts and update
  actions from competing for the same screen space.
*/
.update-notice {
  -webkit-app-region: no-drag;
  pointer-events: auto;
  position: absolute;
  top: 54px;
  right: 16px;
  z-index: 45;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 24px;
  gap: 10px;
  width: min(356px, calc(100% - 32px));
  padding: 12px;
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--radius-md-plus);
  background: var(--ds-bg-elevated-opaque);
  box-shadow: var(--ds-shadow-dialog);
  color: var(--ds-text-primary);
  animation: update-notice-in var(--motion-duration-normal) var(--motion-ease-out);
}

.update-notice-icon {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: color-mix(in oklab, var(--ds-accent) 12%, transparent);
  color: var(--ds-accent);
}

.update-notice-body {
  min-width: 0;
}

.update-notice-title {
  font-size: var(--text-md);
  font-weight: var(--font-weight-semibold);
  line-height: var(--leading-compact-plus);
}

.update-notice-message {
  margin-top: 2px;
  color: var(--ds-text-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-body);
  overflow-wrap: anywhere;
}

.update-notice-notes {
  margin-top: 8px;
  max-height: 7.5rem;
  overflow: auto;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: color-mix(in oklab, var(--ds-text-primary) 5%, transparent);
}

.update-notice-notes-label {
  color: var(--ds-text-muted);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  line-height: var(--leading-compact);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.update-notice-notes-body {
  margin: 4px 0 0;
  color: var(--ds-text-secondary);
  font-family: inherit;
  font-size: var(--text-sm);
  line-height: var(--leading-body);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.update-settings-notes {
  margin-top: 4px;
  max-width: min(320px, 100%);
  max-height: 9rem;
  overflow: auto;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: color-mix(in oklab, var(--ds-text-primary) 5%, transparent);
  text-align: left;
}

.update-settings-notes-label {
  color: var(--ds-text-muted);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  line-height: var(--leading-compact);
}

.update-settings-notes-body {
  margin: 4px 0 0;
  color: var(--ds-text-secondary);
  font-family: inherit;
  font-size: var(--text-xs-plus);
  line-height: var(--leading-body);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.update-settings-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.release-notes-overlay {
  /* z-dialog, like every other overlay: leaf popups (60) and toasts (50) keep
     painting above it. */
  z-index: 40;
}

.release-notes-dialog {
  display: flex;
  width: min(100%, 680px);
  max-height: min(82vh, 760px);
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  color: var(--ds-text-primary);
}

.release-notes-header {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 10px;
}

.release-notes-heading {
  min-width: 0;
}

.release-notes-heading h2 {
  margin: 0;
  color: var(--ds-text-primary);
  font-size: var(--text-lg);
  font-weight: var(--font-weight-semibold);
  line-height: var(--leading-heading);
}

.release-notes-heading p {
  margin: 3px 0 0;
  color: var(--ds-text-muted);
  font-size: var(--text-xs-plus);
  line-height: var(--leading-body);
}

.release-notes-close {
  flex: 0 0 auto;
  width: 28px;
  padding: 0;
}

.release-notes-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 20px;
}

/* Versions are stacked with a gap; the highlighted one sits on a soft tile
   instead of carrying an accent bar (D297). */
.release-notes-version {
  border-radius: var(--radius-md);
  padding: 14px 12px;
}

.release-notes-version + .release-notes-version {
  margin-top: 6px;
}

.release-notes-version.is-highlighted {
  background: var(--ds-tile);
}

.release-notes-version-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.release-notes-version h3 {
  margin: 0;
  color: var(--ds-text-primary);
  font-size: var(--text-md-plus);
  font-weight: var(--font-weight-semibold);
  line-height: var(--leading-compact-plus);
}

.release-notes-version time {
  display: block;
  margin-top: 3px;
  color: var(--ds-text-muted);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  line-height: var(--leading-body);
}

.release-notes-badges {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.release-notes-version ul {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding-inline-start: 18px;
  color: var(--ds-text-secondary);
  font-size: var(--text-md);
  line-height: var(--leading-body);
}

.release-notes-version li::marker {
  color: var(--ds-text-muted);
}

@media (max-width: 560px) {
  .release-notes-overlay {
    padding: 12px;
  }

  .release-notes-dialog {
    max-height: calc(100dvh - 24px);
  }

  .release-notes-header {
    padding: 16px;
  }

  .release-notes-list {
    padding: 0 16px;
  }

  .release-notes-version-header {
    gap: 10px;
  }
}

.update-notice-progress {
  height: 3px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: var(--radius-full);
  background: color-mix(in oklab, var(--ds-text-primary) 10%, transparent);
}

.update-notice-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--ds-accent);
  transition: width var(--motion-duration-normal) var(--motion-ease-out);
}

.update-notice-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 10px;
}

.update-notice-actions:empty {
  display: none;
}

.update-notice-dismiss {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-2xs);
  color: var(--ds-text-muted);
  transition: background var(--motion-duration-fast) var(--motion-ease-out), color var(--motion-duration-fast) var(--motion-ease-out);
}

.update-notice-dismiss:hover {
  background: var(--ds-bg-hover);
  color: var(--ds-text-primary);
}

@keyframes update-notice-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toast {
  -webkit-app-region: no-drag;
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 100%;
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--radius-md-plus);
  background: var(--ds-bg-elevated-opaque);
  box-shadow: var(--ds-shadow-dialog);
  padding: 10px 10px 10px 12px;
  color: var(--ds-text-primary);
  animation: toast-in var(--motion-duration-normal) var(--motion-ease-out);
}

.toast.closing {
  animation: toast-out var(--motion-duration-fast) var(--motion-ease-in) forwards;
}

.toast-icon {
  display: inline-flex;
  flex: 0 0 auto;
  margin-top: 1px; /* optical center against first text line */
}

.toast.info .toast-icon {
  color: var(--ds-info);
}
.toast.success .toast-icon {
  color: var(--ds-success);
}
.toast.warning .toast-icon {
  color: var(--ds-warning);
}
.toast.error .toast-icon {
  color: var(--ds-error);
}

.toast-message {
  min-width: 0;
  font-size: var(--text-md);
  line-height: var(--leading-compact-plus);
  overflow-wrap: anywhere;
}

.toast-action.btn {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  padding: 0;
  text-align: left;
  color: inherit;
}

.toast-action.btn:hover:not(:disabled) {
  background: transparent;
}

.toast-action:focus-visible {
  outline: 2px solid var(--ds-accent);
  outline-offset: 3px;
}

.toast-dismiss {
  display: inline-flex;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin: -2px 0 -2px 2px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-2xs);
  color: var(--ds-text-muted);
  transition: background var(--motion-duration-fast) var(--motion-ease-out), color var(--motion-duration-fast) var(--motion-ease-out);
}

.toast-dismiss:hover {
  background: var(--ds-bg-hover);
  color: var(--ds-text-primary);
}

@keyframes overlay-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes surface-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes surface-in-top {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
}

.backend-banner {
  position: absolute;
  top: 54px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--ds-border-default);
  border-radius: var(--radius-full);
  background: var(--ds-bg-elevated-opaque);
  box-shadow: var(--ds-shadow-dialog);
  padding: 6px 14px;
  font-size: var(--text-sm-plus);
  color: var(--ds-text-primary);
  white-space: nowrap;
}
.backend-banner .backend-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-round);
  flex: none;
}
.backend-banner.warn .backend-dot {
  background: var(--ds-warning);
  animation: pulse-soft 1.2s ease-in-out 2;
}
.backend-banner.fatal .backend-dot {
  background: var(--ds-error);
}
.backend-banner .backend-action {
  border: none;
  background: none;
  padding: 0;
  color: var(--ds-text-primary);
  font-size: var(--text-sm-plus);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  opacity: 0.85;
}
.backend-banner .backend-action:hover {
  opacity: 1;
}

@keyframes pulse-soft {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

@media (prefers-reduced-motion: reduce) {
  .overlay,
  .dialog,
  .search-overlay,
  .search-dialog,
  .plugins-modal-backdrop,
  .plugins-modal,
  .provider-dialog-overlay,
  .provider-dialog {
    animation-duration: 0.01ms !important;
  }
  .backend-banner.warn .backend-dot {
    animation: none;
  }
  .working-indicator-mark > span,
  .activity-marker {
    animation: none;
    opacity: 0.7;
  }
  .tool-spinner {
    animation: none;
  }
  .tool-row-caret {
    transition: none;
  }
  .tool-activity-caret {
    transition: none;
  }
  .tool-activity-collapse {
    transition: none;
  }
  /* Near-zero (not none): toast removal listens for animationend. */
  .toast,
  .toast.closing {
    animation-duration: 0.01ms;
  }
  .update-notice {
    animation: none;
  }
  .update-notice-progress > span {
    transition: none;
  }
}

/* Destination pages (Projects / PRs / Scheduled / Plugins) */
.page-frame {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 28px 28px 48px;
}

/* The 46px titlebar band floats over destination pages on every platform: it is
 * an opaque absolute .main-titlebar. On frameless Windows/Linux it also paints
 * the window controls in the conversation pane's rightmost 120px — a 112px
 * control strip behind an 8px visual buffer. A page header keeps its title and
 * actions in that top band, so start the frame below it — the same reservation
 * .thread-content makes for the transcript — instead of letting the band cover
 * the header or the window controls sit on top of its actions. */
:root[data-platform="win32"] .page-frame,
:root[data-platform="linux"] .page-frame,
:root[data-platform="darwin"] .page-frame {
  padding-top: calc(var(--ds-toolbar-height) + 8px);
}

.chat-error-layer {
  position: absolute;
  inset-inline: 0;
  bottom: 150px;
  z-index: 10;
  display: flex;
  justify-content: center;
  padding-inline: 16px;
  pointer-events: none;
}

.chat-error-notice {
  display: flex;
  max-width: 820px;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid color-mix(in oklab, var(--ds-error) 30%, transparent);
  border-radius: var(--radius-md-plus);
  background: var(--ds-bg-secondary);
  color: var(--ds-error);
  font-size: var(--text-md);
  box-shadow: var(--ds-shadow-composer);
  pointer-events: auto;
  animation: notice-in var(--motion-duration-normal) var(--motion-ease-out) both;
}

.chat-error-notice > span {
  min-width: 0;
  flex: 1 1 240px;
  overflow-wrap: anywhere;
}

.chat-error-action,
.chat-error-dismiss {
  flex: none;
  border-radius: var(--radius-sm);
  color: var(--ds-text-primary);
  transition:
    background var(--motion-duration-fast) var(--motion-ease-out),
    color var(--motion-duration-fast) var(--motion-ease-out),
    transform var(--motion-duration-fast) var(--motion-ease-out);
}

.chat-error-action {
  padding: 4px 8px;
  background: var(--ds-tile-deep);
  font-size: var(--text-sm-plus);
}

.chat-error-dismiss {
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  color: var(--ds-text-secondary);
}

.chat-error-action:hover,
.chat-error-dismiss:hover {
  background: var(--ds-bg-hover);
  color: var(--ds-text-primary);
}

@keyframes notice-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.lifecycle-confirmation-overlay {
  z-index: 65;
}

.lifecycle-confirmation-dialog {
  width: min(100%, 420px);
}

.lifecycle-confirmation-heading {
  min-width: 0;
  overflow-wrap: anywhere;
}

.lifecycle-confirmation-heading h2 {
  margin: 0;
  color: var(--ds-text-primary);
  font-size: var(--text-lg);
  font-weight: var(--font-weight-strong);
  line-height: var(--leading-heading);
}

.lifecycle-confirmation-heading p {
  margin: 8px 0 0;
  color: var(--ds-text-secondary);
  font-size: var(--text-sm-plus);
  line-height: var(--leading-body);
}

.lifecycle-confirmation-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}