collabcentral/html/css/app.css
Joseph B. McQueen 524b443dce Make favorite groups editable from the compose page
Selecting a group in "Additional groups" now auto-saves it to the
caller's favorites, and each favorite gets a × affordance for one-click
removal. Favorites still live where they always have —
config.webex.bot[app].authorized[personId].groups — so nothing changes
for existing installations.

Backend
- New POST /CollabCentral/:app/user/groups/add. Body { id }. Validates
  the caller is authorized for :app, validates :id resolves to a real
  Webex group by looking it up in the cached org-wide group list
  (blocks arbitrary strings from being stuffed into config.json),
  dedups against the existing favorites array, writes config.json via
  saveConfig, and returns the updated array.
- New POST /CollabCentral/:app/user/groups/remove. Body { id }.
  Filters that id out of the caller's favorites, writes only when
  something actually changed (a remove of an unknown id no-ops instead
  of rewriting config.json), and returns the updated array.
- Both endpoints are safe against concurrent writes: index.js is
  single-process and node is single-threaded, so read/mutate/write
  runs atomically per request.
- Both log a compact audit line (last-8 of personId + group name) so
  operators can see who is curating what.

Frontend (sendMessage.html + .js + app.css)
- New "Manage favorites" chip strip renders directly under the
  Favorite Groups picker. Each favorite becomes a pill (uses .alias
  when set, otherwise .name; long labels truncate with ellipsis).
  Clicking × on a pill removes that favorite server-side and updates
  the strip locally.
- Additional Groups picker wires a 'change' listener that diffs the
  current selection against the previous one and only fires
  /user/groups/add for newly-picked ids (never re-fires on the
  reselect side of a deselect+reselect, never spams the API with the
  full selection on every keystroke).
- Client keeps favoriteGroups mirrored to every API response so the
  "already a favorite?" dedup check is a pure in-memory lookup — no
  wasted round trips when the user re-picks a group they already
  favorited.
- Transient status message ("Added to favorites." / "Removed from
  favorites." / error variants) fades under the field label; sticks
  around ~4s.
- New shared styles: .fieldLabelRow (label + inline status),
  .fieldStatus (with --error variant), .chipStrip, .chip,
  .chip__label, .chip__close (with hover/focus states).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-01 20:25:15 -04:00

609 lines
14 KiB
CSS

/* ============================================================================
CollabCentral shared UI. All three top-level pages (sendMessage, monitorJobs,
jobDetail) render on top of this stylesheet — every rule below is meant to
be reusable across pages, and per-page tweaks stay in a small `<style>` at
the top of each HTML file.
============================================================================ */
:root {
--bg: #f8fafc;
--card: #ffffff;
--border: #e5e7eb;
--border-strong: #cbd5e1;
--text: #0f172a;
--text-muted: #64748b;
--text-subtle: #94a3b8;
--accent: #2563eb;
--accent-hover: #1d4ed8;
--accent-soft: #dbeafe;
--success: #15803d;
--success-bg: #dcfce7;
--danger: #b91c1c;
--danger-bg: #fee2e2;
--warning: #a16207;
--warning-bg: #fef9c3;
--radius: 8px;
--radius-sm: 4px;
--shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
--shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
--font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
--content-max: 1100px;
}
* { box-sizing: border-box; }
html, body {
margin: 0;
padding: 0;
}
body {
background: var(--bg);
color: var(--text);
font-family: var(--font);
font-size: 15px;
line-height: 1.5;
-webkit-font-smoothing: antialiased;
}
a {
color: var(--accent);
text-decoration: none;
}
a:hover { color: var(--accent-hover); text-decoration: underline; }
.hidden { display: none !important; }
/* ------- Top nav ---------------------------------------------------------- */
.appHeader {
position: sticky;
top: 0;
z-index: 10;
background: var(--card);
border-bottom: 1px solid var(--border);
box-shadow: var(--shadow-sm);
}
.appHeader__inner {
max-width: var(--content-max);
margin: 0 auto;
padding: 0.6em 1.25em;
display: flex;
align-items: center;
gap: 1em;
}
.appHeader__brand {
display: flex;
align-items: center;
gap: 0.7em;
min-width: 0;
}
.appHeader__avatar {
width: 32px;
height: 32px;
border-radius: 50%;
background: var(--border);
background-size: cover;
background-position: center;
flex-shrink: 0;
}
.appHeader__label {
font-weight: 600;
font-size: 1rem;
color: var(--text);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.appHeader__nav {
display: flex;
gap: 0.4em;
margin-left: 1em;
}
.appHeader__nav a {
display: inline-block;
padding: 0.4em 0.85em;
border-radius: var(--radius-sm);
color: var(--text-muted);
font-size: 0.9rem;
font-weight: 500;
text-decoration: none;
}
.appHeader__nav a:hover {
background: var(--bg);
color: var(--text);
text-decoration: none;
}
.appHeader__nav a[aria-current="page"] {
background: var(--accent-soft);
color: var(--accent);
}
.appHeader__spacer { flex: 1; }
.appHeader__user {
color: var(--text-muted);
font-size: 0.9rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 20ch;
}
/* ------- Page container / cards ------------------------------------------ */
.container {
max-width: var(--content-max);
margin: 1.5em auto;
padding: 0 1.25em;
}
.card {
background: var(--card);
border: 1px solid var(--border);
border-radius: var(--radius);
box-shadow: var(--shadow-sm);
padding: 1.5em;
margin-bottom: 1.5em;
}
.card h3 { margin-top: 0; }
.pageTitle {
margin: 0 0 0.2em;
font-size: 1.35rem;
font-weight: 600;
}
.pageSubtitle {
color: var(--text-muted);
margin: 0 0 1.25em;
font-size: 0.9rem;
}
/* ------- Panels (empty state) -------------------------------------------- */
.panel {
max-width: 560px;
margin: 4em auto;
padding: 2.5em 2em;
text-align: center;
background: var(--card);
border: 1px solid var(--border);
border-radius: var(--radius);
box-shadow: var(--shadow-sm);
}
.panel h2 {
margin: 0 0 0.4em;
font-size: 1.25rem;
color: var(--text);
}
.panel p {
margin: 0;
color: var(--text-muted);
}
/* ------- Forms ----------------------------------------------------------- */
.field {
margin-bottom: 1.1em;
}
.field > label {
display: block;
margin-bottom: 0.35em;
font-weight: 500;
font-size: 0.9rem;
color: var(--text);
}
.field input[type="text"],
.field input[type="datetime-local"],
.field input[type="file"],
.field textarea,
.field select {
width: 100%;
padding: 0.55em 0.75em;
background: var(--card);
border: 1px solid var(--border-strong);
border-radius: var(--radius-sm);
font: inherit;
color: var(--text);
transition: border-color 0.15s, box-shadow 0.15s;
}
.field input[type="text"]:focus,
.field input[type="datetime-local"]:focus,
.field textarea:focus,
.field select:focus {
outline: none;
border-color: var(--accent);
box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.field .hint {
display: block;
margin-top: 0.3em;
color: var(--text-muted);
font-size: 0.82rem;
}
/* Label row: puts the label and an inline transient status message on the
same line without disturbing the vertical rhythm of surrounding fields. */
.fieldLabelRow {
display: flex;
align-items: baseline;
justify-content: space-between;
gap: 0.75em;
margin-bottom: 0.35em;
}
.fieldLabelRow > label {
margin-bottom: 0;
font-weight: 500;
font-size: 0.9rem;
color: var(--text);
}
.fieldStatus {
font-size: 0.8rem;
color: var(--accent, #2563eb);
opacity: 0;
transition: opacity 0.2s;
min-height: 1em;
}
.fieldStatus:not(:empty) {
opacity: 1;
}
.fieldStatus--error {
color: #b91c1c;
}
/* Chip strip: compact list of removable pills used by the "Manage
favorites" affordance below the favorite-groups picker. Chips are
click-target friendly on touch (min 32px tall) and truncate long
labels with ellipsis so a wall of group names doesn't blow out the
card width. */
.chipStrip {
display: flex;
flex-wrap: wrap;
gap: 0.4em;
margin-top: 0.55em;
}
.chip {
display: inline-flex;
align-items: center;
gap: 0.35em;
max-width: 100%;
padding: 0.3em 0.35em 0.3em 0.7em;
background: var(--surface-muted, #f1f5f9);
border: 1px solid var(--border-strong, #cbd5e1);
border-radius: 999px;
font-size: 0.82rem;
line-height: 1.3;
color: var(--text, #0f172a);
}
.chip__label {
max-width: 22ch;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.chip__close {
display: inline-flex;
align-items: center;
justify-content: center;
width: 1.35em;
height: 1.35em;
padding: 0;
border: none;
background: transparent;
color: var(--text-muted, #64748b);
font-size: 1.05rem;
line-height: 1;
border-radius: 999px;
cursor: pointer;
transition: background 0.15s, color 0.15s;
}
.chip__close:hover:not(:disabled),
.chip__close:focus-visible {
background: #fee2e2;
color: #b91c1c;
outline: none;
}
.chip__close:disabled {
opacity: 0.5;
cursor: default;
}
.field-row {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 1em;
}
/* File input tweak: browsers style these very differently; give it some room */
.field input[type="file"] {
padding: 0.4em 0.6em;
cursor: pointer;
}
/* EasyMDE overrides so it fits our neutral theme */
.EasyMDEContainer .CodeMirror {
border-color: var(--border-strong);
border-radius: var(--radius-sm);
color: var(--text);
background: var(--card);
}
.EasyMDEContainer .editor-toolbar {
border-color: var(--border-strong);
background: var(--bg);
border-top-left-radius: var(--radius-sm);
border-top-right-radius: var(--radius-sm);
}
.EasyMDEContainer .editor-preview,
.EasyMDEContainer .editor-preview-side {
background: var(--card);
color: var(--text);
}
/* Image preview */
#file-ip-1-preview {
display: block;
max-width: 100%;
max-height: 260px;
border-radius: var(--radius-sm);
margin-top: 0.4em;
object-fit: contain;
}
#file-ip-1-preview:not([src]) { display: none; }
/* ------- Buttons --------------------------------------------------------- */
.btn {
display: inline-block;
padding: 0.55em 1.1em;
border-radius: var(--radius-sm);
border: 1px solid transparent;
background: var(--card);
color: var(--text);
font: inherit;
font-weight: 500;
cursor: pointer;
transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { background: var(--bg); }
.btn:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
}
.btn-primary {
background: var(--accent);
color: white;
border-color: var(--accent);
}
.btn-primary:hover {
background: var(--accent-hover);
border-color: var(--accent-hover);
}
.btn-secondary {
background: var(--card);
color: var(--text);
border-color: var(--border-strong);
}
.btn-secondary:hover {
background: var(--bg);
border-color: var(--text-muted);
}
.btn-ghost {
background: transparent;
color: var(--text-muted);
border-color: transparent;
padding: 0.35em 0.7em;
}
.btn-ghost:hover {
background: var(--bg);
color: var(--text);
}
.formActions {
display: flex;
gap: 0.6em;
align-items: center;
margin-top: 1em;
}
/* ------- Tables (DataTables-friendly) ------------------------------------ */
table.dataTable {
width: 100% !important;
border-collapse: collapse;
font-size: 0.92rem;
}
table.dataTable thead th {
background: var(--bg);
color: var(--text-muted);
font-weight: 600;
font-size: 0.82rem;
text-transform: uppercase;
letter-spacing: 0.02em;
border-bottom: 1px solid var(--border) !important;
padding: 0.7em 0.8em !important;
text-align: left;
}
table.dataTable tbody td {
padding: 0.7em 0.8em !important;
border-bottom: 1px solid var(--border);
color: var(--text);
vertical-align: top;
white-space: pre-wrap;
word-wrap: break-word;
}
table.dataTable tbody tr:hover {
background: var(--bg);
}
table.dataTable tbody tr:last-child td {
border-bottom: none;
}
table.dataTable.no-footer { border-bottom: none; }
.dataTables_wrapper .dataTables_filter input {
padding: 0.35em 0.6em;
border: 1px solid var(--border-strong);
border-radius: var(--radius-sm);
font: inherit;
}
.dataTables_wrapper .dataTables_length select {
padding: 0.3em 0.5em;
border: 1px solid var(--border-strong);
border-radius: var(--radius-sm);
font: inherit;
}
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
color: var(--text-muted);
font-size: 0.85rem;
padding-top: 0.75em;
}
.dataTables_wrapper .paginate_button {
padding: 0.35em 0.7em !important;
margin-left: 0.15em;
border-radius: var(--radius-sm);
color: var(--text-muted) !important;
border: 1px solid transparent !important;
}
.dataTables_wrapper .paginate_button.current,
.dataTables_wrapper .paginate_button:hover {
background: var(--accent-soft) !important;
color: var(--accent) !important;
border-color: var(--accent-soft) !important;
}
/* ------- Job-detail summary grid ----------------------------------------- */
.summary-grid {
display: grid;
grid-template-columns: max-content 1fr;
gap: 0.5em 1.5em;
padding: 1.1em 1.25em;
background: var(--bg);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
margin: 0 0 1.5em;
}
.summary-grid dt {
font-weight: 500;
color: var(--text-muted);
font-size: 0.88rem;
}
.summary-grid dd {
margin: 0;
color: var(--text);
font-size: 0.92rem;
}
.section-title {
font-size: 0.9rem;
font-weight: 600;
letter-spacing: 0.02em;
text-transform: uppercase;
color: var(--text-muted);
margin: 1.5em 0 0.5em;
}
.message-preview {
padding: 1em 1.25em;
background: var(--bg);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
}
.message-preview img { max-width: 100%; height: auto; }
.message-preview p:first-child { margin-top: 0; }
.message-preview p:last-child { margin-bottom: 0; }
/* ------- Pills ----------------------------------------------------------- */
.pill {
display: inline-block;
padding: 0.15em 0.7em;
border-radius: 999px;
font-size: 0.78rem;
font-weight: 600;
letter-spacing: 0.02em;
}
.pill.ok { background: var(--success-bg); color: var(--success); }
.pill.err { background: var(--danger-bg); color: var(--danger); }
.pill.pending { background: var(--warning-bg); color: var(--warning); }
/* ------- Modal ----------------------------------------------------------- */
.overlay {
position: fixed;
inset: 0;
background: rgba(15, 23, 42, 0.4);
backdrop-filter: blur(3px);
z-index: 20;
}
.modal {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 21;
width: min(440px, 92vw);
background: var(--card);
border-radius: var(--radius);
box-shadow: var(--shadow);
padding: 1.5em 1.75em;
display: flex;
flex-direction: column;
gap: 0.6em;
}
.modal h3 { margin: 0; }
.modal p { color: var(--text-muted); margin: 0; }
.modal__close {
align-self: flex-end;
background: transparent;
border: none;
font-size: 1.2rem;
color: var(--text-muted);
cursor: pointer;
padding: 0.2em 0.4em;
border-radius: 999px;
}
.modal__close:hover { background: var(--bg); color: var(--text); }
.modal__actions {
display: flex;
gap: 0.6em;
justify-content: flex-end;
margin-top: 0.6em;
}
/* ------- Responsive ------------------------------------------------------ */
@media (max-width: 640px) {
.field-row { grid-template-columns: 1fr; }
.appHeader__inner { flex-wrap: wrap; }
.appHeader__nav { margin-left: 0; }
.container { padding: 0 1em; }
.card { padding: 1.1em; }
}