A new send-message module owns everything a dashboard sends: the PIN
(switchable off in admin), the unlock tokens, the Send message and Quick
replies tiles, the quick replies and quick emojis. It opens no upstream
connection of its own — it finds every module declaring
provides: ["messaging"] through the shell's module list and hands each
message to that module's POST /messaging/send over loopback, so Slack keeps
its one Slack connection and ProdCom its one ProdCom connection. Providers
check the browser's unlock token with GET /verify over loopback before
touching their upstream, so no browser on the network can post as the
location without having entered the PIN here.
Slack 1.3.0 is view-only plus reactions: the Sending group, PIN, send tiles
and quick replies are gone; it serves the messaging descriptor (channels as
recipients) and its reactions ride on the Send Message unlock. A layout's
old Send message / Quick replies tiles draw nothing until removed.
ProdCom 1.4.0 serves the descriptor as identities — only channels with
typingEnabled, since typed text goes out *as* a channel — and posts with
POST /api/v1/channels/{id}/send. Its tile is a click-to-target like Slack's
(accent stripe along the bottom), and typed entries carry a keyboard mark.
The tiles: click any Slack or ProdCom transcript to point sends there; a
Send as menu (only for platforms with identities, hidden otherwise) picks
the ProdCom channel to speak as; the choice is saved with the tile so named
layouts remember it. Wording follows the role — "Send message to #ops…" /
"Send message to ProdCom as FOH…". The PIN pad's dots ride on a real
numeric input so a phone's keyboard appears. Outcome is an icon beside
Send (check / blocked, five seconds, sentence as tooltip). A pill on the
box's bottom edge trades box height for rows of quick-emoji keys, a row
at a time; the single row scrolls sideways on a narrow tile with Send
pinned in place.
The module guide documents the provider contract and the page bus
(window.proddashMessaging + proddash:messaging:* events) the tiles share;
the ProdCom mock gained the send route.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
388 lines
11 KiB
CSS
388 lines
11 KiB
CSS
/* Slack module — scoped to its tiles, shell variables only.
|
||
--sl-size (per tile, from the header's A− / A+) drives every font size.
|
||
Transcript rows follow the ProdCom transcript's layout: a square picture,
|
||
then a name line with the time, the text, the reactions. The send tiles
|
||
and the PIN pad moved to the Send Message module in 1.3.0. */
|
||
|
||
[data-module="slack"] .sl-wrap {
|
||
--sl-size: 14px;
|
||
position: absolute;
|
||
inset: 0;
|
||
display: flex;
|
||
flex-direction: column;
|
||
container-type: size;
|
||
font-size: var(--sl-size);
|
||
color: var(--text);
|
||
}
|
||
[data-module="slack"] .sl-wrap:focus { outline: none; }
|
||
[data-module="slack"] [hidden] { display: none !important; }
|
||
|
||
/* ── degraded banner (transcript) ── */
|
||
|
||
[data-module="slack"] .sl-banner {
|
||
flex: none;
|
||
padding: 4px 10px;
|
||
font-size: 0.8em;
|
||
color: var(--warn);
|
||
background: color-mix(in srgb, var(--warn) 12%, transparent);
|
||
border-bottom: 1px solid color-mix(in srgb, var(--warn) 35%, var(--border));
|
||
}
|
||
[data-module="slack"] .sl-banner.is-error {
|
||
color: var(--danger);
|
||
background: color-mix(in srgb, var(--danger) 12%, transparent);
|
||
border-bottom-color: color-mix(in srgb, var(--danger) 35%, var(--border));
|
||
}
|
||
|
||
/* ── the send target ── */
|
||
|
||
/* A click anywhere in a transcript's body makes its channel the one the
|
||
Send Message module's tiles post to. The chosen one carries a 3px accent
|
||
stripe along the bottom edge of the tile body — drawn just inside our
|
||
root, since the tile chrome around it belongs to the shell. The others
|
||
hint at it faintly on hover. */
|
||
[data-module="slack"] .sl-transcript::after {
|
||
content: "";
|
||
position: absolute;
|
||
left: 0;
|
||
right: 0;
|
||
bottom: 0;
|
||
height: 3px;
|
||
background: var(--accent);
|
||
opacity: 0;
|
||
pointer-events: none;
|
||
z-index: 3;
|
||
transition: opacity 0.15s ease;
|
||
}
|
||
[data-module="slack"] .sl-transcript:hover::after { opacity: 0.3; }
|
||
[data-module="slack"] .sl-transcript.is-target::after { opacity: 1; }
|
||
|
||
/* ── transcript stream ── */
|
||
|
||
[data-module="slack"] .sl-stream {
|
||
flex: 1;
|
||
min-height: 0;
|
||
overflow-y: auto;
|
||
overflow-x: hidden;
|
||
padding: 6px 10px 10px;
|
||
overscroll-behavior: contain;
|
||
}
|
||
|
||
[data-module="slack"] .sl-empty {
|
||
color: var(--muted);
|
||
font-size: 0.9em;
|
||
text-align: center;
|
||
padding: 14% 10px 0;
|
||
line-height: 1.45;
|
||
}
|
||
[data-module="slack"] .sl-empty.is-error { color: var(--danger); }
|
||
|
||
[data-module="slack"] .sl-entry {
|
||
padding: 5px 6px;
|
||
border-radius: 8px;
|
||
line-height: 1.45;
|
||
}
|
||
[data-module="slack"] .sl-entry:hover { background: var(--bg); }
|
||
[data-module="slack"] .sl-entry.sl-new { animation: sl-fade-in 0.25s ease-out; }
|
||
@keyframes sl-fade-in {
|
||
from { opacity: 0; transform: translateY(4px); }
|
||
to { opacity: 1; transform: none; }
|
||
}
|
||
|
||
/* one row: the picture, then everything else (.sl-row — .sl-msg is the
|
||
send tile's status line, a different thing) */
|
||
[data-module="slack"] .sl-row,
|
||
[data-module="slack"] .sl-reply {
|
||
display: flex;
|
||
align-items: flex-start;
|
||
gap: 8px;
|
||
min-width: 0;
|
||
}
|
||
[data-module="slack"] .sl-body { flex: 1; min-width: 0; }
|
||
|
||
/* the square: a profile image, a bot's icon or emoji, or initials on a tint
|
||
of a hue the name hashes to — the same size and corner as ProdCom's */
|
||
[data-module="slack"] .sl-avatar {
|
||
flex: none;
|
||
width: calc(var(--sl-size) * 1.9);
|
||
height: calc(var(--sl-size) * 1.9);
|
||
border-radius: 26%;
|
||
overflow: hidden;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
background: hsl(var(--sl-hue, 150) 45% 50% / 0.2);
|
||
color: hsl(var(--sl-hue, 150) 55% 60%);
|
||
font-size: 0.72em;
|
||
font-weight: 700;
|
||
letter-spacing: 0.02em;
|
||
user-select: none;
|
||
-webkit-user-select: none;
|
||
}
|
||
/* "Avatars" off: the square goes and the row starts at the left edge, as in ProdCom */
|
||
[data-module="slack"] .sl-wrap.hide-avatars .sl-avatar { display: none; }
|
||
[data-module="slack"] .sl-avatar-img {
|
||
width: 100%;
|
||
height: 100%;
|
||
object-fit: cover;
|
||
display: block;
|
||
}
|
||
[data-module="slack"] .sl-avatar-emoji { font-size: 1.25em; line-height: 1; }
|
||
[data-module="slack"] .sl-reply .sl-avatar {
|
||
width: calc(var(--sl-size) * 1.5);
|
||
height: calc(var(--sl-size) * 1.5);
|
||
font-size: 0.6em;
|
||
}
|
||
|
||
[data-module="slack"] .sl-meta {
|
||
display: flex;
|
||
align-items: baseline;
|
||
gap: 8px;
|
||
min-width: 0;
|
||
margin-bottom: 2px;
|
||
}
|
||
[data-module="slack"] .sl-name {
|
||
font-weight: 700;
|
||
font-size: 0.82em;
|
||
letter-spacing: 0.01em;
|
||
color: var(--accent);
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
}
|
||
[data-module="slack"] .sl-bot .sl-name { color: var(--muted); }
|
||
[data-module="slack"] .sl-time {
|
||
flex: none;
|
||
font-size: 0.72em;
|
||
color: var(--muted);
|
||
font-variant-numeric: tabular-nums;
|
||
}
|
||
[data-module="slack"] .sl-wrap:not(.show-times) .sl-time { display: none; }
|
||
[data-module="slack"] .sl-wrap:not(.show-names) .sl-body > .sl-meta { display: none; }
|
||
[data-module="slack"] .sl-wrap.show-times:not(.show-names) .sl-body > .sl-meta { display: flex; }
|
||
[data-module="slack"] .sl-wrap.show-times:not(.show-names) .sl-name { display: none; }
|
||
[data-module="slack"] .sl-wrap:not(.show-system) .sl-entry.sl-system { display: none; }
|
||
|
||
[data-module="slack"] .sl-text {
|
||
white-space: pre-wrap;
|
||
overflow-wrap: anywhere;
|
||
color: var(--text);
|
||
}
|
||
[data-module="slack"] .sl-text b { font-weight: 700; }
|
||
[data-module="slack"] .sl-text i { font-style: italic; }
|
||
[data-module="slack"] .sl-text s { color: var(--muted); }
|
||
[data-module="slack"] .sl-code {
|
||
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||
font-size: 0.9em;
|
||
padding: 0 4px;
|
||
border-radius: 4px;
|
||
background: color-mix(in srgb, var(--text) 8%, transparent);
|
||
border: 1px solid var(--border);
|
||
}
|
||
[data-module="slack"] .sl-code.sl-block {
|
||
display: block;
|
||
padding: 4px 8px;
|
||
margin: 3px 0;
|
||
white-space: pre-wrap;
|
||
}
|
||
[data-module="slack"] .sl-edited {
|
||
font-size: 0.75em;
|
||
color: var(--muted);
|
||
white-space: nowrap;
|
||
}
|
||
|
||
/* a custom emoji is an image the size of a character */
|
||
[data-module="slack"] .sl-emoji {
|
||
display: inline-block;
|
||
width: 1.25em;
|
||
height: 1.25em;
|
||
object-fit: contain;
|
||
vertical-align: -0.28em;
|
||
}
|
||
|
||
/* reactions under a message: pills with the emoji and its count; the
|
||
location's own carry the accent — a click adds yours or takes it back */
|
||
[data-module="slack"] .sl-reactions {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
gap: 4px;
|
||
margin-top: 4px;
|
||
}
|
||
[data-module="slack"] .sl-reaction {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 4px;
|
||
padding: 1px 7px 1px 5px;
|
||
border: 1px solid var(--border);
|
||
border-radius: 999px;
|
||
background: color-mix(in srgb, var(--text) 5%, transparent);
|
||
color: var(--text);
|
||
font: inherit;
|
||
font-size: 0.78em;
|
||
line-height: 1.4;
|
||
cursor: pointer;
|
||
transition: background 0.1s, border-color 0.1s;
|
||
}
|
||
[data-module="slack"] .sl-reaction:hover { border-color: var(--accent); }
|
||
[data-module="slack"] .sl-reaction.is-me {
|
||
border-color: var(--accent);
|
||
background: color-mix(in srgb, var(--accent) 16%, transparent);
|
||
}
|
||
[data-module="slack"] .sl-reaction .sl-emoji,
|
||
[data-module="slack"] .sl-reaction .sl-emoji-char { font-size: 1.15em; line-height: 1; vertical-align: middle; }
|
||
[data-module="slack"] .sl-reaction-count {
|
||
font-variant-numeric: tabular-nums;
|
||
font-weight: 600;
|
||
color: var(--muted);
|
||
}
|
||
[data-module="slack"] .sl-reaction.is-me .sl-reaction-count { color: var(--text); }
|
||
|
||
/* thread replies nest under their parent; without them, a muted count */
|
||
[data-module="slack"] .sl-replies {
|
||
margin: 4px 0 0 10px;
|
||
padding-left: 10px;
|
||
border-left: 2px solid var(--border);
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 3px;
|
||
}
|
||
[data-module="slack"] .sl-reply { font-size: 0.92em; }
|
||
[data-module="slack"] .sl-replycount {
|
||
margin-top: 2px;
|
||
font-size: 0.75em;
|
||
color: var(--muted);
|
||
}
|
||
|
||
/* system lines: joins, leaves, topic changes */
|
||
[data-module="slack"] .sl-sysline {
|
||
display: flex;
|
||
align-items: baseline;
|
||
gap: 8px;
|
||
font-size: 0.82em;
|
||
color: var(--muted);
|
||
font-style: italic;
|
||
}
|
||
[data-module="slack"] .sl-sysline .sl-time { font-style: normal; }
|
||
|
||
[data-module="slack"] .sl-jump {
|
||
position: absolute;
|
||
left: 50%;
|
||
bottom: 10px;
|
||
transform: translateX(-50%);
|
||
padding: 5px 12px;
|
||
border: 1px solid var(--border);
|
||
border-radius: 999px;
|
||
background: var(--accent);
|
||
color: var(--accent-text);
|
||
font: inherit;
|
||
font-size: 0.8em;
|
||
font-weight: 700;
|
||
cursor: pointer;
|
||
box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
|
||
}
|
||
|
||
/* ── the reaction menu (on document.body, so nothing clips it) ── */
|
||
|
||
[data-module="slack"].sl-emoji-menu {
|
||
--sl-size: 14px;
|
||
position: fixed;
|
||
z-index: 90;
|
||
width: 292px;
|
||
max-width: calc(100vw - 16px);
|
||
max-height: calc(100vh - 16px);
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 6px;
|
||
padding: 8px;
|
||
border: 1px solid var(--border);
|
||
border-radius: 10px;
|
||
background: var(--panel);
|
||
color: var(--text);
|
||
font-size: var(--sl-size);
|
||
box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
|
||
overflow: hidden;
|
||
}
|
||
[data-module="slack"].sl-emoji-menu:focus { outline: none; }
|
||
[data-module="slack"].sl-emoji-menu.is-busy { opacity: 0.7; pointer-events: none; }
|
||
[data-module="slack"] .sl-emoji-head {
|
||
font-size: 0.8em;
|
||
color: var(--muted);
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
}
|
||
[data-module="slack"] .sl-emoji-quickrow {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
gap: 4px;
|
||
}
|
||
[data-module="slack"] .sl-emoji-quickrow:empty { display: none; }
|
||
[data-module="slack"] .sl-emoji-btn {
|
||
width: 34px;
|
||
height: 34px;
|
||
padding: 0;
|
||
border: 1px solid transparent;
|
||
border-radius: 8px;
|
||
background: none;
|
||
color: var(--text);
|
||
font: inherit;
|
||
font-size: 20px;
|
||
line-height: 1;
|
||
cursor: pointer;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
transition: background 0.1s, border-color 0.1s;
|
||
}
|
||
[data-module="slack"] .sl-emoji-quickrow .sl-emoji-btn { font-size: 22px; width: 38px; height: 38px; background: color-mix(in srgb, var(--text) 5%, var(--panel)); border-color: var(--border); }
|
||
[data-module="slack"] .sl-emoji-btn:hover { background: var(--border); border-color: var(--accent); }
|
||
[data-module="slack"] .sl-emoji-btn .sl-emoji { width: 1.1em; height: 1.1em; vertical-align: middle; }
|
||
[data-module="slack"] .sl-emoji-search {
|
||
width: 100%;
|
||
box-sizing: border-box;
|
||
padding: 6px 9px;
|
||
border: 1px solid var(--border);
|
||
border-radius: 8px;
|
||
background: var(--bg);
|
||
color: var(--text);
|
||
font: inherit;
|
||
font-size: 0.9em;
|
||
}
|
||
[data-module="slack"] .sl-emoji-search:focus { outline: none; border-color: var(--accent); }
|
||
[data-module="slack"] .sl-emoji-results {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
gap: 2px;
|
||
max-height: 150px;
|
||
overflow-y: auto;
|
||
min-height: 34px;
|
||
}
|
||
[data-module="slack"] .sl-emoji-none {
|
||
width: 100%;
|
||
padding: 8px 4px;
|
||
text-align: center;
|
||
color: var(--muted);
|
||
font-size: 0.8em;
|
||
}
|
||
[data-module="slack"] .sl-emoji-msg {
|
||
min-height: 1em;
|
||
font-size: 0.78em;
|
||
color: var(--muted);
|
||
}
|
||
[data-module="slack"] .sl-emoji-msg:empty { display: none; }
|
||
[data-module="slack"] .sl-emoji-msg.is-error { color: var(--danger); font-weight: 600; }
|
||
|
||
/* locked: the PIN is entered in the Send Message module's tile, not here */
|
||
[data-module="slack"] .sl-emoji-locked {
|
||
padding: 4px 2px 2px;
|
||
font-size: 0.86em;
|
||
line-height: 1.4;
|
||
color: var(--muted);
|
||
}
|
||
[data-module="slack"] .sl-emoji-locked b { color: var(--text); font-weight: 700; }
|
||
[data-module="slack"] .sl-emoji-reason {
|
||
display: block;
|
||
margin-top: 4px;
|
||
color: var(--warn);
|
||
font-size: 0.9em;
|
||
}
|