Skip to content

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

19.8 KB
Raw Blame
/*
  Settings → Project archive — one toolbar (sort, search, add project) and a
  one-column workbench (D455). Nothing is expanded until a row is clicked, and
  clicking that row again closes it.

  The workbench is an iOS-style inset grouped index: a quiet section label, then
  rows that read left-to-right as identity (glyph, name, path) and right-to-left
  as detail (sessions, last active, disclosure). The open row is the header of
  its own card, so its detail opens under the row and never repeats the name.
  Separators are spacing, never rules — tiles carry the structure (D297).
*/

/* ---------- Settings → Project archive ---------- */

/*
  One toolbar owns sort, search, the live match count, and the primary action.
  The controls come from three places, so the row height is stated once here
  rather than derived from each one's padding.
*/
.projects-toolbar {
  --projects-control-height: 32px;

  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 1px;
}

.projects-toolbar-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/*
  The shared `.btn` runs a step larger than this toolbar's controls, so state
  the toolbar geometry here rather than resizing the shared button everywhere.
*/
.projects-toolbar-actions > .btn {
  min-height: var(--projects-control-height);
  padding: 5px 11px;
  font-size: var(--text-sm);
}

.projects-result-count {
  flex: 0 0 auto;
  color: var(--ds-text-muted);
  font-size: var(--text-xs-plus);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/*
  Sort is the shared `.settings-segment`, which already carries both theme
  pairs; only the toolbar-scale sizing is local.
*/
.settings-segment.projects-sort {
  height: var(--projects-control-height);
  flex: 0 0 auto;
}

/*
  Compound selector on purpose: providers.css defines `.settings-segment-item`
  and imports after this file, so a bare `.projects-sort-btn` would lose the
  cascade and these declarations would silently do nothing.
*/
.settings-segment-item.projects-sort-btn {
  display: inline-flex;
  height: 100%;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  line-height: var(--leading-none);
  white-space: nowrap;
}

.projects-sort-btn.active {
  color: var(--ds-text-primary);
}

.projects-sort-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--ds-accent) 22%, transparent);
}

/*
  One search field for the whole index. The fill lives on the wrapper because
  the clear button sits inside it, matching `.agent-capability-search-wrap`.
  Filled at rest, accent ring only while focused (D297/D297 search language).
*/
.projects-search-wrap {
  display: inline-flex;
  height: var(--projects-control-height);
  min-width: 0;
  flex: 1 1 180px;
  max-width: 320px;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-full);
  background: var(--ds-field-inset-bg);
  padding: 0 11px;
  color: var(--ds-text-muted);
  transition:
    background var(--motion-duration-fast) var(--motion-ease-out),
    box-shadow var(--motion-duration-fast) var(--motion-ease-out);
}

.projects-search-wrap:focus-within {
  background: var(--ds-field-inset-focus-bg);
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--ds-accent) 45%, transparent);
}

.projects-search-wrap > svg {
  flex: 0 0 auto;
}

.projects-search {
  min-width: 0;
  height: 100%;
  flex: 1;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--ds-text-primary);
  font-family: inherit;
  font-size: var(--text-sm);
  outline: none;
}

.projects-search::placeholder {
  color: var(--ds-text-faint);
}

.projects-search:focus-visible {
  outline: none;
}

/* Quiet until pointed at. */
.projects-search-clear {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--ds-text-muted);
  cursor: pointer;
  transition:
    background var(--motion-duration-fast) var(--motion-ease-out),
    color var(--motion-duration-fast) var(--motion-ease-out);
}

.projects-search-clear:hover {
  background: color-mix(in oklab, var(--ds-text-primary) 10%, transparent);
  color: var(--ds-text-primary);
}

/* Section label above its rows: Pinned, All projects, Archived — and how many.
   One quiet label line, never a tinted band (D297). */
.projects-group-head {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding: 0 4px 6px;
}

.projects-group-label {
  flex: 0 0 auto;
  color: var(--ds-text-secondary);
  font-size: var(--text-2xs);
  font-weight: var(--font-weight-strong);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  white-space: nowrap;
}

:lang(zh-CN) .projects-group-label,
:lang(zh-TW) .projects-group-label,
:lang(zh-CN) .projects-detail-label,
:lang(zh-TW) .projects-detail-label {
  letter-spacing: var(--tracking-normal);
  text-transform: none;
}

.projects-group-count {
  flex: 0 0 auto;
  border-radius: var(--radius-full);
  background: color-mix(in oklab, var(--ds-text-primary) 8%, transparent);
  padding: 1px 7px;
  color: var(--ds-text-muted);
  font-size: var(--text-3xs);
  font-variant-numeric: tabular-nums;
  line-height: var(--leading-normal);
}

.projects-workbench {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.projects-workbench:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--ds-accent) 80%, transparent);
}

.projects-index {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 16px;
  outline: none;
}

.projects-group,
.projects-group-rows {
  min-width: 0;
}

.projects-group-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* One project is one tile; selecting it grows the tile into the card that
   carries its detail below the row. */
.projects-row-block {
  position: relative;
  border-radius: var(--radius-md-plus);
  background: var(--ds-tile);
  transition:
    background var(--motion-duration-fast) var(--motion-ease-out),
    box-shadow var(--motion-duration-fast) var(--motion-ease-out);
}

.projects-row-block:hover,
.projects-row-block:focus-within {
  background: var(--ds-tile-hover);
}

/* The live project is the deepest tile; the row whose card is open carries a
   quiet accent ring. Nothing else is highlighted, so a closed index is quiet. */
.projects-row-block.active {
  background: var(--ds-tile-deep);
}

.projects-row-block.open {
  background: var(--ds-tile-deep);
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--ds-accent) 34%, transparent);
}

/* Archived rows stay listed; the section label carries the state, so the row is
   only softened rather than dimmed to the edge of legibility. */
.projects-row-block.archived .projects-glyph {
  opacity: 0.5;
}

.projects-row-block.archived .projects-name-title {
  color: var(--ds-text-secondary);
}

.projects-row {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 8px 14px;
  text-align: left;
  border-radius: var(--radius-md-plus);
  cursor: pointer;
}

.projects-row:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px color-mix(in oklab, var(--ds-accent) 80%, transparent);
}

.projects-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-2xs);
  color: var(--ds-text-faint);
  flex: 0 0 auto;
  cursor: pointer;
  transition:
    background var(--motion-duration-fast) var(--motion-ease-out),
    color var(--motion-duration-fast) var(--motion-ease-out);
}

.projects-icon-btn:hover {
  background: color-mix(in oklab, var(--ds-text-primary) 8%, transparent);
  color: var(--ds-text-primary);
}

.projects-glyph {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--gray-0);
  flex: 0 0 auto;
}

.projects-name-copy {
  min-width: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1px;
}

.projects-name-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--ds-text-primary);
  font-size: var(--text-md);
  font-weight: var(--font-weight-medium);
  line-height: var(--leading-tight);
}

.projects-name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The path is the row's second line: it is what disambiguates two projects with
   the same display name, so it is readable without selecting the row. */
.projects-name-path {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ds-text-muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs-plus);
  line-height: var(--leading-normal);
}

/* Trailing detail column, mirrored against the identity column. */
/* Trailing detail is one line, mirrored against the identity column. */
.projects-row-meta {
  display: flex;
  min-width: 0;
  flex: 0 0 auto;
  align-items: baseline;
  gap: 8px;
  margin-left: 4px;
}

.projects-name-sessions,
.projects-updated {
  white-space: nowrap;
  font-size: var(--text-xs-plus);
  line-height: var(--leading-normal);
  font-variant-numeric: tabular-nums;
}

.projects-name-sessions {
  color: var(--ds-text-muted);
}

/*
  Muted, not faint: `--ds-text-faint` is #afafaf in light mode, which lands at
  2.2:1 on the card and makes a timestamp the user actually reads unreadable.
  Quietness comes from size and the trailing column instead.
*/
.projects-updated {
  color: var(--ds-text-muted);
}

/* Disclosure indicator: points at the row, turns down once its detail is open. */
.projects-row-disclosure {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  color: var(--ds-text-muted);
  transition: transform var(--motion-duration-fast) var(--motion-ease-out);
}

/* Keyed on the open card, not on selection: a selected row whose card was
   closed again must point right, or the indicator lies about the state. */
.projects-row-block.open .projects-row-disclosure {
  transform: rotate(90deg);
}

.projects-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  border-radius: var(--radius-full);
  background: color-mix(in oklab, var(--ds-text-primary) 8%, transparent);
  color: var(--ds-text-secondary);
  font-size: var(--text-3xs);
  font-weight: var(--font-weight-medium);
  padding: 1px 7px;
  line-height: var(--leading-normal);
}

.projects-tag.is-active {
  background: color-mix(in oklab, var(--ds-accent) 16%, transparent);
  color: var(--ds-accent);
}

.projects-tag.is-archived {
  background: var(--ds-tile-deep);
  color: var(--ds-text-muted);
}

/* ---------- Selected project card ---------- */

/*
  The detail panel is inset to the row's text column, so its sections read as
  children of the project above them rather than as a second surface.
*/
.projects-inspector {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
  padding: 0 14px 12px 54px;
  animation: projects-detail-in var(--motion-duration-fast) var(--motion-ease-out);
}

@keyframes projects-detail-in {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Actions sit on one quiet bar above the read-only facts. */
.projects-detail-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-height: 26px;
  min-width: 0;
}

.projects-detail-facts {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
}

.projects-detail-roots {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.projects-detail-root {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 5px;
  color: var(--ds-text-muted);
  font-size: var(--text-xs);
}

.projects-detail-root.is-branch {
  font-family: var(--font-mono);
}

.projects-detail-root span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.projects-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 20px;
  margin-top: 2px;
}

.projects-detail-label {
  color: var(--ds-text-muted);
  font-size: var(--text-2xs);
  font-weight: var(--font-weight-strong);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.projects-detail-new,
.projects-detail-more {
  color: var(--ds-text-secondary);
}

.projects-detail-more {
  align-self: flex-start;
  margin-top: 2px;
}

.projects-detail-empty {
  padding: 2px 2px 4px;
  color: var(--ds-text-muted);
  font-size: var(--text-sm-plus);
}

.projects-detail-tasks {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.projects-detail-task-row {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  border-radius: var(--radius-2xs);
}

.projects-detail-task {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 9px;
  text-align: left;
  border-radius: var(--radius-2xs);
  padding: 6px 8px;
  color: var(--ds-text-secondary);
  font-size: var(--text-sm-plus);
  cursor: pointer;
  transition:
    background var(--motion-duration-fast) var(--motion-ease-out),
    color var(--motion-duration-fast) var(--motion-ease-out);
}

.projects-detail-task-icon {
  flex: 0 0 auto;
  color: var(--ds-text-faint);
}

.projects-detail-task-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.projects-detail-task-updated {
  flex: 0 0 auto;
  margin-left: auto;
  padding-left: 10px;
  color: var(--ds-text-faint);
  font-size: var(--text-xs-plus);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.projects-detail-task:hover {
  background: var(--ds-bg-hover);
  color: var(--ds-text-primary);
}

.projects-detail-task:hover .projects-detail-task-icon {
  color: var(--ds-text-muted);
}

.projects-detail-task:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px color-mix(in oklab, var(--ds-accent) 70%, transparent);
}

.projects-detail-task-rename {
  display: inline-flex;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-2xs);
  color: var(--ds-text-muted);
  opacity: 0;
  cursor: pointer;
  transition:
    background var(--motion-duration-fast) var(--motion-ease-out),
    color var(--motion-duration-fast) var(--motion-ease-out),
    opacity var(--motion-duration-fast) var(--motion-ease-out);
}

.projects-detail-task-row:hover .projects-detail-task-rename,
.projects-detail-task-row:focus-within .projects-detail-task-rename,
.projects-detail-task-rename:focus-visible {
  opacity: 1;
}

.projects-detail-task-rename:hover {
  background: var(--ds-bg-hover);
  color: var(--ds-text-primary);
}

/* ---------- Index menu ---------- */

.projects-menu-wrap {
  position: relative;
}

.projects-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: auto;
  bottom: auto;
  z-index: 20;
  min-width: 196px;
  border-radius: var(--radius-md-plus);
  background: var(--ds-bg-elevated-opaque, var(--ds-bg-primary));
  box-shadow: 0 0 0 0.5px var(--ds-border-default), 0 12px 32px rgba(0, 0, 0, 0.2);
  padding: 5px;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.projects-menu.is-open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  animation: projects-menu-in var(--motion-duration-fast) var(--motion-ease-out) both;
}

@keyframes projects-menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.projects-menu button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 9px;
  text-align: left;
  border-radius: var(--radius-2xs);
  padding: 7px 10px;
  color: var(--ds-text-primary);
  font-size: var(--text-sm-plus);
  cursor: pointer;
  transition: background var(--motion-duration-fast) var(--motion-ease-out);
}

.projects-menu button > svg {
  color: var(--ds-text-muted);
  flex: 0 0 auto;
}

.projects-menu button:hover {
  background: var(--ds-bg-hover);
}

.projects-menu button.danger,
.projects-menu button.danger > svg {
  color: var(--ds-error);
}

.projects-menu button.danger:hover {
  background: color-mix(in oklab, var(--ds-error) 12%, transparent);
}

/* An armed delete item names its second click, so the swap stays obvious. */
.projects-menu button.danger.is-armed {
  background: color-mix(in oklab, var(--ds-error) 14%, transparent);
}

/* Menu sections are separated by space, not a rule (D297). */
.projects-menu-sep {
  height: 6px;
}

/* Quiet in-panel empty state: centered glyph + copy, no decorative frame. */
.projects-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 38px 20px;
  color: var(--ds-text-muted);
  font-size: var(--text-sm-plus);
  text-align: center;
}

.projects-empty-icon {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--ds-bg-chip);
  color: var(--ds-text-faint);
  margin-bottom: 0;
}

.projects-empty-title {
  color: var(--ds-text-secondary);
  font-size: var(--text-md);
  font-weight: var(--font-weight-medium);
}

.projects-empty-body {
  margin: 0 auto;
  max-width: 44ch;
  color: var(--ds-text-faint);
  font-size: var(--text-sm);
  line-height: var(--leading-compact);
}

.projects-empty .btn {
  margin-top: 3px;
}

/* Narrow content panes stack the toolbar above the workbench. */
@media (max-width: 720px) {
  .projects-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  /* Compound for the same reason as above: providers.css imports later. */
  .settings-segment.projects-sort {
    justify-content: space-between;
  }

  .settings-segment-item.projects-sort-btn {
    flex: 1;
    justify-content: center;
  }

  .projects-search-wrap {
    flex: 0 0 auto;
    max-width: none;
  }

  /* Stacked toolbar: actions lead their own row instead of trailing the search. */
  .projects-toolbar-actions {
    margin-left: 0;
  }

  .projects-row-meta {
    display: none;
  }

  .projects-inspector {
    padding-left: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .projects-row-block,
  .projects-icon-btn,
  .projects-search-wrap,
  .projects-row-disclosure,
  .projects-detail-task,
  .projects-detail-task-rename {
    transition: none;
  }

  .projects-inspector,
  .projects-menu.is-open {
    animation: none;
  }
}

/*
  Destructive project deletion reuses the project-instructions dialog shell;
  only the width, the warning line, and the confirm button are specific here.
  The width rule is compound because providers.css imports later.
*/
.dialog.project-delete-dialog {
  width: min(100%, 480px);
}

.project-delete-dialog .project-instructions-dialog-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.project-delete-dialog-body {
  overflow-wrap: anywhere;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-delete-dialog-warning {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  color: var(--ds-error);
  font-size: var(--text-sm);
  line-height: var(--leading-body);
}

.project-delete-dialog-warning svg {
  flex: 0 0 auto;
  margin-top: 2px;
}

/*
  The running-session line is a "these will be stopped" notice, not the
  destructive warning above it, so it carries the warning tone.
*/
.project-delete-dialog-running {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  color: var(--ds-warning);
  font-size: var(--text-sm);
  line-height: var(--leading-body);
}

.project-delete-dialog-running svg {
  flex: 0 0 auto;
  margin-top: 2px;
}

.project-delete-dialog-confirm {
  background: var(--ds-error);
  border-color: var(--ds-error);
  color: var(--ds-bg-primary);
}

.project-delete-dialog-confirm:hover:not(:disabled) {
  background: color-mix(in oklab, var(--ds-error) 85%, black);
}