Skip to content

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

13.1 KB
Raw Blame
/*
  Sidebar thread rows — session row pitch, titles, status dots, and group
  headers. More sidebar session management (lists, popovers, sort, disclosure)
  lives in sessions.css.
*/

.thread-item,
.sidebar-session-group-header {
  min-height: 28px;
  border-radius: var(--radius-sm);
  color: var(--ds-text-secondary);
  transition: background var(--motion-duration-fast) var(--motion-ease-out), color var(--motion-duration-fast) var(--motion-ease-out);
}

.thread-item {
  position: relative;
  display: flex;
  width: 100%;
  align-items: center;
  gap: 2px;
  overflow: hidden;
  padding: 0 2px 0 0;
}

.thread-item-main {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 5px;
  padding: 5px 6px 5px 20px;
  text-align: left;
  color: inherit;
}

.thread-item-title {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  font-size: var(--text-md); /* session titles stay compact within the sidebar */
  line-height: var(--leading-row);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Source tags (Pi, Remote) are badges: they never shrink or wrap into stacked
   words in a narrow sidebar — the title next to them truncates instead. */
.thread-item-source {
  flex: 0 0 auto;
  color: var(--ds-text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-row);
  white-space: nowrap;
}

.thread-item-meta {
  /* The action and date overlap in one slot; opacity keeps its width stable. */
  display: grid;
  width: max-content;
  flex: 0 0 auto;
  align-items: center;
  justify-items: end;
}

.thread-item-meta > * {
  grid-area: 1 / 1;
}

.thread-item-last-reply {
  color: var(--ds-text-muted);
  font-size: var(--text-sm);
  white-space: nowrap;
  transition:
    opacity var(--motion-duration-fast) var(--motion-ease-out),
    visibility var(--motion-duration-fast) var(--motion-ease-out);
}

.thread-item:hover .thread-item-last-reply,
.thread-item:focus-within .thread-item-last-reply {
  opacity: 0;
  visibility: hidden;
}

.thread-item-meta.is-menu-open .thread-item-last-reply {
  opacity: 0;
  visibility: hidden;
}

.thread-item:hover,
.thread-item.active,
.project-group > .sidebar-session-group-header:hover {
  background: var(--ds-bg-hover);
  color: var(--ds-text-primary);
}

/* Window blur releases hover, not selection or drag feedback. */
.sidebar[data-window-blur="true"] .thread-item:hover:not(.active),
.sidebar[data-window-blur="true"] .project-group:not(.is-drop-target) > .sidebar-session-group-header:hover {
  background: transparent;
  color: var(--ds-text-secondary);
}

.thread-item.active {
  background: var(--ds-bg-active);
}

.sidebar-session-groups {
  display: flex;
  /* Keep room for a project header and one conversation row with their insets. */
  min-height: 60px;
  /* Basis 0, not auto: with a content-derived basis the scroller's resolved
     height is re-solved from its own content, so collapsing the first project
     nudges the whole list up a few pixels before it settles back. */
  flex: 1 1 0;
  flex-direction: column;
  /* Baseline of the group ladder: adjacent rows and group headers sit 1px
     apart. The extra air around an expanded group belongs to the group itself
     (see `.sidebar-session-group-body.project`), so this gap stays uniform and
     a collapsed group cannot fork the spacing on its neighbour's state. */
  gap: 1px;
  overflow-x: hidden;
  overflow-y: auto;
  padding-top: 2px;
}

.sidebar-session-group {
  min-width: 0;
}

.sidebar-session-group.project-group {
  position: relative;
}

.sidebar-session-group-header {
  display: flex;
  min-height: 28px;
  align-items: center;
  gap: 2px;
  padding: 0 2px;
}

.project-group.is-dragging {
  opacity: 0.5;
}

.sidebar-session-group-title.project-toggle {
  cursor: grab;
}

.project-group.is-dragging .sidebar-session-group-title {
  cursor: grabbing;
}

.project-group.is-drop-before::before,
.project-group.is-drop-after::after {
  position: absolute;
  right: 8px;
  left: 8px;
  z-index: 1;
  height: 2px;
  border-radius: var(--radius-round);
  background: var(--ds-accent);
  content: "";
  pointer-events: none;
}

.project-group.is-drop-before::before {
  top: -1px;
}

.project-group.is-drop-after::after {
  bottom: -1px;
}

.project-group.is-drop-target > .sidebar-session-group-header {
  outline: 1px solid var(--ds-accent);
  outline-offset: -1px;
  background: color-mix(in oklab, var(--ds-accent) 12%, transparent);
}
.sidebar-session-group-title {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 5px;
  border-radius: var(--radius-sm);
  padding: 5px 6px;
  background: transparent;
  color: inherit;
  font-size: var(--text-md); /* project/group labels one step quieter than sessions */
  font-weight: var(--font-weight-medium);
  line-height: var(--leading-compact);
  text-align: left;
  user-select: none;
  touch-action: pan-y;
}

.sidebar-session-group-title:focus-visible {
  color: var(--ds-text-primary);
}

.sidebar-session-group-title svg {
  flex: 0 0 auto;
  color: var(--ds-text-muted);
}

.sidebar-session-group-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-session-group-add {
  display: inline-flex;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-2xs);
  color: var(--ds-text-muted);
  opacity: 0;
  transition:
    opacity var(--motion-duration-fast) var(--motion-ease-out),
    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);
}

.sidebar-session-group-add:hover {
  background: var(--ds-bg-hover);
  color: var(--ds-text-primary);
}

.sidebar-session-group-body {
  display: flex;
  flex-direction: column;
  /* One hairline between list rows: adjacent rounded row fills read as
     separate rows instead of one block. The load-more affordance follows the
     same rhythm. */
  gap: 1px;
  overflow: hidden;
}

/* Nested session rows read as children through the indent alone; the tree
   rail is gone (D297). */
.sidebar-session-group-body.project {
  /* A one-row grid: the fold is a real fraction of the measured content, and
     `opacity` stays 1 — the rows are clipped, never faded. */
  display: grid;
  grid-template-rows: 1fr;
  margin-left: 13px;
  padding-left: 9px;
  transition: grid-template-rows var(--motion-duration-normal) var(--motion-ease-out);
}

.sidebar-session-group-body.project.collapsed {
  grid-template-rows: 0fr;
  pointer-events: none;
}

/* The `0fr` row closes only if the clip can shrink below its content. */
.sidebar-session-group-clip {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

/* The group's inset: 2px between the header and the first row, 7px after the
   last one, so the container's 1px gap completes the 8px before the next group.
   Vertical padding on the animating box instead would hold a `0fr` row open. */
.sidebar-session-group-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-top: 2px;
  padding-bottom: 7px;
}

.sidebar-session-group-body.temporary {
  margin-left: 13px;
  padding-left: 9px;
}

.sidebar-load-more {
  display: flex;
  width: 100%;
  align-items: center;
  padding: 4px 6px 4px 20px;
  border-radius: var(--radius-sm);
  color: var(--ds-text-muted);
  font-size: var(--text-xs-plus);
  text-align: left;
  transition: background var(--motion-duration-fast) var(--motion-ease-out), color var(--motion-duration-fast) var(--motion-ease-out);
}

.sidebar-load-more:hover {
  background: var(--ds-bg-hover);
  color: var(--ds-text-secondary);
}

.sidebar-session-group-body.standalone {
  /* Ten compact 28px rows plus the nine 1px gaps between them, and the 2px
     label inset, before the Recent list starts scrolling internally. */
  max-height: 291px;
  overflow-x: hidden;
  overflow-y: auto;
  /* 2px below the section label, matching every label-to-content pair. */
  padding: 2px 2px 0;
}

.sidebar-standalone-sessions,
.sidebar-pinned-sessions {
  display: grid;
  min-width: 0;
  /* Allow shrinking below the list's intrinsic height while keeping its label
     and a compact row reachable. */
  min-height: 60px;
  flex: 0 1 auto;
  grid-template-rows: auto minmax(30px, 1fr);
}

/* Projects hidden in Settings: the session list takes the freed height. */
.sidebar-standalone-sessions.is-fill {
  flex: 1 1 auto;
}

.sidebar-standalone-sessions.is-fill .sidebar-session-group-body.standalone {
  max-height: none;
}

.sidebar-session-empty {
  padding: 5px 8px;
  color: var(--ds-text-muted);
  font-size: var(--text-md); /* empty-state copy tracks group titles */
  line-height: var(--leading-compact);
}

.sidebar-session-group-body.pinned {
  /* Eight compact 28px rows plus their seven 1px gaps, and the 2px label
     inset. */
  max-height: min(233px, 30vh);
  overflow-x: hidden;
  overflow-y: auto;
  /* 2px below the section label, matching every label-to-content pair. */
  padding: 2px 2px 0;
}

.sidebar-pinned-sessions .thread-item-title {
  min-width: 0;
  flex: 1;
}

.thread-item-project {
  min-width: 0;
  max-width: 40%;
  margin-left: auto;
  overflow: hidden;
  color: var(--ds-text-muted);
  font-size: var(--text-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Recent rows share one line between task and project identity. Let a long
   task title take only the space left after the project label. */
.thread-item.recent-project-session .thread-item-project {
  flex: 0 0 auto;
}

/* Multi-select highlight: visually distinct from the single active row. */
.thread-item.selected {
  background: color-mix(in oklab, var(--ds-accent) 12%, transparent);
  color: var(--ds-text-primary);
}

.thread-item.selected.active {
  background: var(--ds-bg-active);
}



/* ============================================================
   Project-level running affordances: count badge + activity rail.

   Both hang off the project group *header* rather than the session rows.
   `.sidebar-session-group-body.project.collapsed` folds to `0fr` and is
   `inert`, so a row-level status dot vanishes exactly when the question
   "is anything running under here?" matters most; the header survives both
   states.

   Every colour resolves through a `--ds-*` surface token, so light, dark,
   and contributed themes recolor them; nothing here pins a literal. Motion
   is decorative only — the static shapes stay legible without it (see the
   reduced-motion block at the end).
   ============================================================ */

.project-run-badges,
.project-run-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

/* Badge and pip share one quiet shape: a 6px dot followed by a muted figure.
   No capsule, no outline — colour on the dot alone carries the meaning, and
   the number stays neutral ink so it keeps contrast in every theme. */
.project-run-badge,
.project-run-pip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ds-text-muted);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  font-variant-numeric: tabular-nums;
  line-height: var(--leading-none, 1);
}

.project-run-badge-dot,
.project-run-pip::before {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: var(--radius-round);
  background: var(--ds-warning);
}

.project-run-pip::before {
  content: "";
}

/* Running breathes gently; waiting stays still so a long permission prompt
   never keeps the window repainting. */
.project-run-badge.running .project-run-badge-dot,
.project-run-pip.running::before {
  animation: project-run-breathe 1.8s ease-in-out infinite;
}

.project-run-badge.waiting .project-run-badge-dot,
.project-run-pip.waiting::before {
  background: var(--ds-purple);
}

/* A collapsed group is where the figure matters most, so it gains ink. */
.project-group.is-collapsed .project-run-badge,
.project-group.is-collapsed .project-run-pip {
  color: var(--ds-text-secondary);
}

/*
  The rail spans the group box, so it covers the opened session list and
  shrinks to just the header when the group is collapsed — the same element
  answers in both states without a special case.
*/
.project-run-rail {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 0;
  width: 2px;
  overflow: hidden;
  border-radius: var(--radius-full);
  background: color-mix(in oklab, var(--ds-warning) 14%, transparent);
  pointer-events: none;
}

.project-run-rail-pulse {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 40%;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    transparent,
    color-mix(in oklab, var(--ds-warning) 70%, transparent),
    transparent
  );
  animation: project-run-flow 2.8s ease-in-out infinite;
}

@keyframes project-run-breathe {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

@keyframes project-run-flow {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(250%);
  }
}

/*
  Motion is decoration, never the message: without it the dot stays solid and
  the soft segment rests at the top of the track, so both still read as live.
*/
@media (prefers-reduced-motion: reduce) {
  .project-run-badge-dot,
  .project-run-pip::before,
  .project-run-rail-pulse {
    animation: none;
  }
}