// Command palette (Ctrl+K): a panel over the page with a search row, one scrolling list grouped by // kind, a line for action results and empty states, and a footer of key chips. The panel and its // rows follow the card, the timeline's labels and the path bar's key chips. // The path bar's edit button (_shell.scss .pathbar-edit) opens it. The dialog is in the top layer, // so it sits over the page and the path bar without any positioning of its own. dialog.palette { width: min(640px, calc(100vw - 32px)); max-height: min(70vh, 560px); margin: 12vh auto 0; padding: 0; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: var(--pop-shadow); &::backdrop { background: color-mix(in srgb, var(--bg) 55%, transparent); } &[open] { display: flex; flex-direction: column; } } .palette-box { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; } // Opened from the path bar, the dialog sits under it: fixed, with its top and left set inline by // nav.js. The auto margins of a modal and its bottom inset are cleared so only those two apply. .palette.anchored { margin: 0; position: fixed; inset: auto; } // The search row is part of the palette, not a field inside it: no box, only the divider below. .palette-search { flex: none; display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 16px; color: var(--muted); border-bottom: 1px solid var(--border); &:focus-within { color: var(--accent); } } .palette-input { flex: 1 1 auto; min-width: 0; height: 48px; padding: 0; font: inherit; font-size: 15px; color: var(--text); background: transparent; border: 0; &::placeholder { color: var(--muted); } &:focus, &:focus-visible { outline: none; box-shadow: none; } } .palette-list { flex: 1 1 auto; min-height: 0; margin: 0; padding: 0 6px 6px; overflow-y: auto; list-style: none; font-size: 14px; li { margin: 0; } // Group headings: the mono label of the timeline, held at the top while its rows scroll past. .palette-head { position: sticky; top: 0; z-index: 1; height: 28px; padding: 0 10px; font-family: var(--mono); font-size: 11px; font-weight: 500; line-height: 28px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); background: var(--surface); } // Rows: one line, 36px, an icon, the label, and the reason at the right. li[role="option"] { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; color: var(--text); border-radius: var(--radius-md); cursor: pointer; min-width: 0; } // The selected row (keys or pointer): a surface step with a thin accent edge on the left. li[aria-selected="true"] { background: var(--surface-2); box-shadow: inset 2px 0 var(--accent); } li[role="option"]:hover { background: var(--surface-2); } } .palette-ico { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; } // The label: a path muted, its last segment in the text colour, each ellipsised when they overflow. .palette-label { flex: 1 1 auto; display: flex; min-width: 0; white-space: nowrap; } .palette-path, .palette-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .palette-path { flex: 0 1 auto; color: var(--muted); } .palette-name { flex: 0 1 auto; color: var(--text); } .palette-tail { font-weight: 500; } .palette-why { flex: 0 1 auto; max-width: 50%; min-width: 0; overflow: hidden; color: var(--muted); font-size: 12px; text-align: right; text-overflow: ellipsis; white-space: nowrap; } // Where a search led: the setting it found, until the next key or click. .palette-hit { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--radius-sm); } // A line above the key chips: a sent action's result, or the state of the list. Hidden otherwise. .palette-note { flex: none; margin: 0; padding: 8px 16px; border-top: 1px solid var(--border); &[hidden] { display: none; } // A sent action: done in the ok colour, a refusal in the failure colour. &.is-ok { color: var(--ok); } &.is-bad { color: var(--bad); } } // The footer's key chips, with the same key look as the path bar's Ctrl K. .palette-keys { flex: none; display: flex; align-items: center; gap: 16px; height: 36px; padding: 0 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; } kbd { flex: none; padding: 0 5px; font-family: var(--mono); font-size: 11px; line-height: 18px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); } } // Phones: the palette spans the screen width and sits at the top, with larger rows to tap. The key // chips go: a phone has no keys. @media (max-width: 600px) { dialog.palette { width: calc(100vw - 16px); max-height: calc(100vh - 16px); margin: 8px auto 0; } .palette-input { height: 52px; font-size: 16px; } .palette-search { height: 52px; } .palette-list li[role="option"] { height: 44px; padding: 0 12px; } .palette-keys { display: none; } }