big UI changes

This commit is contained in:
KingKDot
2026-08-19 11:40:36 -05:00
parent 82d6864afe
commit d2c343b2b7
18 changed files with 1045 additions and 137 deletions
+114
View File
@@ -0,0 +1,114 @@
const CONCISE_PAGE_PATHS = new Set([
"/build",
"/deploy",
"/file-share",
"/filebrowser",
"/logs",
"/metrics",
"/plugins",
"/purgatory",
"/screenshots",
"/scripts",
"/settings",
"/socks5-manager",
"/sol-publish",
"/user-client-access",
"/users",
"/voice",
"/winre",
]);
function ensureUiStyles() {
if (document.querySelector('link[href="/assets/ui.css"]')) return;
const link = document.createElement("link");
link.rel = "stylesheet";
link.href = "/assets/ui.css";
const customStyles = document.querySelector('link[href="/assets/custom.css"]');
if (customStyles) customStyles.before(link);
else document.head.appendChild(link);
}
function helpIcon(text, subject) {
const help = document.createElement("span");
help.className = "ui-help";
help.tabIndex = 0;
help.setAttribute("role", "img");
help.setAttribute("aria-label", `About ${subject}`);
help.title = text;
help.innerHTML = '<i class="fa-solid fa-circle-info" aria-hidden="true"></i>';
return help;
}
function removeRedundantPageIntro(root) {
if (!CONCISE_PAGE_PATHS.has(window.location.pathname)) return;
for (const heading of root.querySelectorAll("main h1")) {
const description = heading.nextElementSibling;
if (!(description instanceof HTMLParagraphElement)) continue;
if (description.id || description.closest("[role='alert'], dialog, [role='dialog']")) continue;
description.remove();
}
}
function convertSectionDescriptions(root) {
const descriptions = root.querySelectorAll(
"main h2 + p.text-slate-400, main h2 + p.text-slate-500",
);
for (const description of descriptions) {
if (!(description instanceof HTMLParagraphElement) || description.dataset.conciseUi === "done") continue;
if (description.id || description.closest("[role='alert'], dialog, [role='dialog']")) continue;
if (description.classList.contains("text-amber-400") || description.classList.contains("text-red-400")) continue;
const heading = description.previousElementSibling;
if (!(heading instanceof HTMLHeadingElement)) continue;
const text = description.textContent?.replace(/\s+/g, " ").trim();
if (!text) continue;
heading.classList.add("ui-heading-help");
heading.appendChild(helpIcon(text, heading.textContent?.trim() || "this section"));
description.dataset.conciseUi = "done";
description.className = "sr-only";
}
}
function convertFieldHints(root) {
if (!new Set(["/build", "/settings"]).has(window.location.pathname)) return;
const hints = root.querySelectorAll("main p.text-xs.text-slate-500:not([id])");
for (const hint of hints) {
if (!(hint instanceof HTMLParagraphElement) || hint.dataset.conciseUi === "done") continue;
if (hint.classList.contains("uppercase") || hint.closest("[role='alert'], dialog, [role='dialog']")) continue;
const container = hint.parentElement;
const control = container?.querySelector("input, select, textarea");
const text = hint.textContent?.replace(/\s+/g, " ").trim();
if (!(control instanceof HTMLElement) || !text) continue;
if (!control.title) control.title = text;
hint.dataset.conciseUi = "done";
hint.className = "sr-only";
}
}
function convertBuildOptionHints(root) {
if (window.location.pathname !== "/build") return;
const hints = root.querySelectorAll("main label span.text-xs.text-slate-500");
for (const hint of hints) {
if (!(hint instanceof HTMLSpanElement) || hint.dataset.conciseUi === "done") continue;
const label = hint.closest("label");
const text = hint.textContent?.replace(/\s+/g, " ").trim();
if (!label || !text) continue;
if (!label.title) label.title = text;
hint.dataset.conciseUi = "done";
hint.className = "sr-only";
}
}
export function applyConciseUi(root = document) {
ensureUiStyles();
removeRedundantPageIntro(root);
convertSectionDescriptions(root);
convertFieldHints(root);
convertBuildOptionHints(root);
}
+4 -1
View File
@@ -55,7 +55,10 @@ async function loadFiles() {
if (!data.files || data.files.length === 0) {
fileList.innerHTML = `<tr><td colspan="7" class="px-6 py-12 text-center text-slate-500">
<i class="fa-solid fa-folder-open text-2xl mb-2 block"></i>No files shared yet
<div class="file-share-empty inline-flex flex-col items-center gap-3">
<i class="fa-solid fa-folder-open text-2xl" aria-hidden="true"></i>
<span>No files shared yet</span>
</div>
</td></tr>`;
return;
}
+4
View File
@@ -19,6 +19,9 @@ import {
turboVisit,
} from "./turbo-navigation.js";
import { showOnboardingIfNeeded } from "./onboarding.js";
import { applyConciseUi } from "./concise-ui.js";
applyConciseUi();
const host = document.getElementById("top-nav");
if (host) {
@@ -226,6 +229,7 @@ if (host) {
onPathChange: (path) => {
applyActivePath(path);
applyBranding();
applyConciseUi();
},
});
}
+389 -1
View File
@@ -1,2 +1,390 @@
/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */
:root{--ui-canvas:#04070d;--ui-canvas-raised:#020617;--ui-surface-1:#0f172ab8;--ui-surface-2:#1e293bb3;--ui-surface-hover:#334155c7;--ui-surface-solid:#172033;--ui-surface-solid-hover:#1f2a3e;--ui-popover:#111827;--ui-popover-translucent:#0f172afa;--ui-text:#e2e8f0;--ui-text-strong:#f8fafc;--ui-text-muted:#94a3b8;--ui-text-faint:#64748b;--ui-border-subtle:#334155ad;--ui-border-strong:#475569cc;--ui-accent:#38bdf8;--ui-accent-secondary:#818cf8;--ui-success:#22c55e;--ui-warning:#fbbf24;--ui-danger:#fb7185;--ui-radius-sm:6px;--ui-radius-control:8px;--ui-radius-panel:10px;--ui-radius-full:999px;--ui-control-height:36px;--ui-space-1:4px;--ui-space-2:8px;--ui-space-3:12px;--ui-space-4:16px;--ui-motion-fast:.14s;--ui-motion-normal:.22s;--ui-ease-out:cubic-bezier(.2, .8, .2, 1)}:where(a,button,input,select,textarea,summary,[tabindex]):focus-visible{outline:2px solid var(--ui-accent)!important;outline-offset:2px!important;box-shadow:0 0 0 3px #38bdf829!important}:where(a,button,input,select,textarea,summary,[tabindex]):focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion:reduce){:where(.ui-card,.ui-button,.ui-icon-button,.ui-popover){scroll-behavior:auto;transition-duration:.01ms!important}}.ui-card{border:1px solid var(--ui-border-subtle);border-radius:var(--ui-radius-panel);background:var(--ui-surface-1);min-width:0;position:relative;overflow:hidden}.ui-card--interactive{cursor:grab}.ui-card--interactive:active{cursor:grabbing}.ui-card--interactive.is-dragging{opacity:.52;border-color:#38bdf89e}.ui-button,.ui-icon-button{border-radius:var(--ui-radius-control);background:var(--ui-surface-solid);color:#cbd5e1;cursor:pointer;border:1px solid #475569b8;transition:transform .15s,border-color .15s,background-color .15s,color .15s}.ui-button:hover,.ui-icon-button:hover{background:var(--ui-surface-solid-hover);color:var(--ui-text-strong);border-color:#818cf88c;transform:translateY(-1px)}.ui-button:disabled,.ui-icon-button:disabled{opacity:.4;cursor:not-allowed;transform:none}.ui-button{min-height:var(--ui-control-height);justify-content:center;align-items:center;gap:var(--ui-space-2);padding:0 var(--ui-space-3);font-size:.8125rem;font-weight:600;display:inline-flex}.ui-icon-button{width:var(--ui-control-height);height:var(--ui-control-height);justify-content:center;align-items:center;padding:0;display:inline-flex}.ui-icon-button[data-size=compact]{background:var(--ui-surface-2);width:34px;height:34px;color:var(--ui-text-muted);border-color:var(--ui-border-subtle)}.ui-icon-button[data-size=compact]:hover{background:var(--ui-surface-hover);color:var(--ui-text);border-color:var(--ui-border-strong);transform:none}.ui-icon-button:has(input:not(:checked)){color:var(--ui-text-faint);background:#0f172abf}.ui-icon-button input{opacity:0;pointer-events:none;position:absolute}.ui-menu[open]>.ui-icon-button{color:var(--ui-accent-secondary);background:#20294a;border-color:#818cf88c}.ui-badge{text-overflow:ellipsis;white-space:nowrap;border-radius:var(--ui-radius-full);color:#cbd5e1;font-variant-numeric:tabular-nums;background:#1e293b8c;border:1px solid #64748b40;flex-shrink:0;align-items:center;max-width:9rem;padding:3px 8px;font-size:.7rem;font-weight:700;display:inline-flex;overflow:hidden}.ui-badge[data-tone=info]{color:#bae6fd;background:#082f4952;border-color:#38bdf838}.ui-status-dot{border-radius:var(--ui-radius-full);background:var(--ui-text-faint);flex:none;width:8px;height:8px;box-shadow:0 0 0 4px #64748b1f}.ui-status-dot:is([data-state=healthy],.is-live){background:var(--ui-success);box-shadow:0 0 0 4px #22c55e21,0 0 16px #22c55e5c}.ui-status-dot:is([data-state=warning],.is-warn){background:var(--ui-warning);box-shadow:0 0 0 4px #fbbf241f,0 0 16px #fbbf244d}.ui-status-dot:is([data-state=danger],.is-bad){background:var(--ui-danger);box-shadow:0 0 0 4px #fb71851f,0 0 16px #fb71854d}.ui-status-dot:is([data-state=neutral],.is-muted){background:var(--ui-text-faint);box-shadow:0 0 0 4px #64748b1a}.ui-popover{top:calc(100% + var(--ui-space-2));z-index:40;gap:var(--ui-space-2);border:1px solid var(--ui-border-strong);border-radius:var(--ui-radius-control);background:var(--ui-popover);flex-direction:column;min-width:220px;padding:10px;display:flex;position:absolute;right:0;box-shadow:0 18px 44px #0206178c}.ui-popover[data-size=compact]{background:var(--ui-popover-translucent);border-color:#334155d1;gap:6px;width:196px;min-width:196px;display:grid;box-shadow:0 18px 38px #0206176b}.ui-toolbar{z-index:20;align-items:center;gap:10px;display:flex;position:relative}.ui-toolbar__search{flex:420px;min-width:240px}.ui-toolbar__actions{flex:none;align-items:center;gap:6px;display:inline-flex}@media (max-width:820px){.ui-toolbar{flex-direction:column;align-items:stretch}.ui-toolbar__search{flex-basis:auto;width:100%}.ui-toolbar__actions{flex-wrap:wrap;justify-content:flex-end;width:100%}}
:root {
--ui-canvas: #04070d;
--ui-canvas-raised: #020617;
--ui-surface-1: rgba(15, 23, 42, 0.72);
--ui-surface-2: rgba(30, 41, 59, 0.7);
--ui-surface-hover: rgba(51, 65, 85, 0.78);
--ui-surface-solid: #172033;
--ui-surface-solid-hover: #1f2a3e;
--ui-popover: #111827;
--ui-popover-translucent: rgba(15, 23, 42, 0.98);
--ui-text: #e2e8f0;
--ui-text-strong: #f8fafc;
--ui-text-muted: #94a3b8;
--ui-text-faint: #64748b;
--ui-border-subtle: rgba(51, 65, 85, 0.68);
--ui-border-strong: rgba(71, 85, 105, 0.8);
--ui-accent: #38bdf8;
--ui-accent-secondary: #818cf8;
--ui-success: #22c55e;
--ui-warning: #fbbf24;
--ui-danger: #fb7185;
--ui-radius-sm: 6px;
--ui-radius-control: 8px;
--ui-radius-panel: 10px;
--ui-radius-full: 999px;
--ui-control-height: 36px;
--ui-space-1: 4px;
--ui-space-2: 8px;
--ui-space-3: 12px;
--ui-space-4: 16px;
--ui-motion-fast: 140ms;
--ui-motion-normal: 220ms;
--ui-ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
outline: 2px solid var(--ui-accent) !important;
outline-offset: 2px !important;
box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.16) !important;
}
:where(a, button, input, select, textarea, summary, [tabindex]):focus:not(:focus-visible) {
outline: none;
}
@media (prefers-reduced-motion: reduce) {
:where(.ui-card, .ui-button, .ui-icon-button, .ui-popover) {
scroll-behavior: auto;
transition-duration: 0.01ms !important;
}
}
.ui-card {
position: relative;
min-width: 0;
border: 1px solid var(--ui-border-subtle);
border-radius: var(--ui-radius-panel);
background: var(--ui-surface-1);
overflow: hidden;
}
.ui-card--interactive {
cursor: grab;
}
.ui-card--interactive:active {
cursor: grabbing;
}
.ui-card--interactive.is-dragging {
opacity: 0.52;
border-color: rgba(56, 189, 248, 0.62);
}
.ui-button, .ui-icon-button {
border: 1px solid rgba(71, 85, 105, 0.72);
border-radius: var(--ui-radius-control);
background: var(--ui-surface-solid);
color: #cbd5e1;
cursor: pointer;
transition: transform 150ms ease, border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}
.ui-button:hover, .ui-icon-button:hover {
transform: translateY(-1px);
border-color: rgba(129, 140, 248, 0.55);
background: var(--ui-surface-solid-hover);
color: var(--ui-text-strong);
}
.ui-button:disabled, .ui-icon-button:disabled {
opacity: 0.4;
cursor: not-allowed;
transform: none;
}
.ui-button {
display: inline-flex;
align-items: center;
justify-content: center;
min-height: var(--ui-control-height);
gap: var(--ui-space-2);
padding: 0 var(--ui-space-3);
font-size: 0.8125rem;
font-weight: 600;
}
.ui-icon-button {
display: inline-flex;
align-items: center;
justify-content: center;
width: var(--ui-control-height);
height: var(--ui-control-height);
padding: 0;
}
.ui-icon-button[data-size="compact"] {
width: 34px;
height: 34px;
background: var(--ui-surface-2);
color: var(--ui-text-muted);
border-color: var(--ui-border-subtle);
}
.ui-icon-button[data-size="compact"]:hover {
transform: none;
background: var(--ui-surface-hover);
color: var(--ui-text);
border-color: var(--ui-border-strong);
}
.ui-icon-button:has(input:not(:checked)) {
color: var(--ui-text-faint);
background: rgba(15, 23, 42, 0.75);
}
.ui-icon-button input {
position: absolute;
opacity: 0;
pointer-events: none;
}
.ui-menu[open] > .ui-icon-button {
color: var(--ui-accent-secondary);
border-color: rgba(129, 140, 248, 0.55);
background: #20294a;
}
.ui-badge {
display: inline-flex;
align-items: center;
flex-shrink: 0;
max-width: 9rem;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
border: 1px solid rgba(100, 116, 139, 0.25);
border-radius: var(--ui-radius-full);
background: rgba(30, 41, 59, 0.55);
color: #cbd5e1;
padding: 3px 8px;
font-size: 0.7rem;
font-weight: 700;
font-variant-numeric: tabular-nums;
}
.ui-badge[data-tone="info"] {
border-color: rgba(56, 189, 248, 0.22);
background: rgba(8, 47, 73, 0.32);
color: #bae6fd;
}
.ui-status-dot {
width: 8px;
height: 8px;
flex: 0 0 auto;
border-radius: var(--ui-radius-full);
background: var(--ui-text-faint);
box-shadow: 0 0 0 4px rgba(100, 116, 139, 0.12);
}
.ui-status-dot:is([data-state="healthy"], .is-live) {
background: var(--ui-success);
box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.13), 0 0 16px rgba(34, 197, 94, 0.36);
}
.ui-status-dot:is([data-state="warning"], .is-warn) {
background: var(--ui-warning);
box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.12), 0 0 16px rgba(251, 191, 36, 0.3);
}
.ui-status-dot:is([data-state="danger"], .is-bad) {
background: var(--ui-danger);
box-shadow: 0 0 0 4px rgba(251, 113, 133, 0.12), 0 0 16px rgba(251, 113, 133, 0.3);
}
.ui-status-dot:is([data-state="neutral"], .is-muted) {
background: var(--ui-text-faint);
box-shadow: 0 0 0 4px rgba(100, 116, 139, 0.1);
}
.ui-popover {
position: absolute;
top: calc(100% + var(--ui-space-2));
right: 0;
z-index: 40;
display: flex;
flex-direction: column;
gap: var(--ui-space-2);
min-width: 220px;
padding: 10px;
border: 1px solid var(--ui-border-strong);
border-radius: var(--ui-radius-control);
background: var(--ui-popover);
box-shadow: 0 18px 44px rgba(2, 6, 23, 0.55);
}
.ui-popover[data-size="compact"] {
display: grid;
gap: 6px;
width: 196px;
min-width: 196px;
border-color: rgba(51, 65, 85, 0.82);
background: var(--ui-popover-translucent);
box-shadow: 0 18px 38px rgba(2, 6, 23, 0.42);
}
.ui-help {
display: inline-flex;
align-items: center;
justify-content: center;
width: 1.25rem;
height: 1.25rem;
flex: none;
color: var(--ui-text-muted);
font-size: 0.75rem;
border-radius: 999px;
cursor: help;
}
.ui-help:hover, .ui-help:focus-visible {
color: var(--ui-accent);
outline: none;
}
.ui-heading-help {
display: flex;
align-items: center;
gap: 0.4rem;
}
input.bg-transparent, .graph-field input {
background-color: transparent !important;
border-color: transparent !important;
box-shadow: none !important;
}
.graph-field, .graph-select {
border-color: var(--ui-border-subtle);
background: var(--ui-surface-1);
color: var(--ui-text);
}
.graph-field:focus-within, .graph-select:focus {
border-color: var(--ui-border-strong) !important;
box-shadow: none !important;
}
.graph-field input::placeholder {
color: var(--ui-text-faint);
}
#upload-file {
padding: 0 0.75rem 0 0;
overflow: hidden;
color: var(--ui-text-muted);
}
#upload-file::file-selector-button {
height: 100%;
margin-right: 0.75rem;
padding: 0 0.875rem;
border: 0;
border-right: 1px solid var(--ui-border-subtle);
border-radius: 0;
background: transparent;
color: var(--ui-text);
font: inherit;
font-weight: 600;
cursor: pointer;
}
#upload-file:hover::file-selector-button {
background: var(--ui-surface-2);
}
.ui-toolbar {
position: relative;
z-index: 20;
display: flex;
align-items: center;
gap: 10px;
}
.ui-toolbar__search {
flex: 1 1 420px;
min-width: 240px;
}
.ui-toolbar__actions {
display: inline-flex;
align-items: center;
gap: 6px;
flex: 0 0 auto;
}
@media (max-width: 820px) {
.ui-toolbar {
align-items: stretch;
flex-direction: column;
}
.ui-toolbar__search {
flex-basis: auto;
width: 100%;
}
.ui-toolbar__actions {
width: 100%;
justify-content: flex-end;
flex-wrap: wrap;
}
}
.app-notifications .notifications-shell {
gap: 1rem;
}
.app-notifications .notification-panel, .app-notifications .notification-section {
border-color: var(--ui-border);
border-radius: 0.875rem;
background: var(--ui-surface);
box-shadow: var(--ui-shadow-sm);
}
.app-notifications .notification-section {
overflow: clip;
}
.app-notifications .notification-section__summary, .app-notifications .notification-advanced > summary {
display: flex;
align-items: center;
gap: 0.625rem;
list-style: none;
cursor: pointer;
user-select: none;
}
.app-notifications .notification-section__summary {
justify-content: space-between;
min-height: 3.5rem;
padding: 0.75rem 1rem;
font-weight: 600;
}
.app-notifications .notification-section__summary::-webkit-details-marker, .app-notifications .notification-advanced > summary::-webkit-details-marker {
display: none;
}
.app-notifications .notification-section__summary:hover, .app-notifications .notification-section__summary:focus-visible {
background: rgb(30 41 59 / 0.45);
}
.app-notifications .notification-section__title {
display: inline-flex;
align-items: center;
gap: 0.625rem;
}
.app-notifications .notification-section__body {
padding: 1rem;
border-top: 1px solid var(--ui-border);
}
.app-notifications .notification-chevron {
color: var(--ui-text-muted);
font-size: 0.75rem;
transition: transform 160ms ease;
}
.app-notifications details[open] > summary > .notification-chevron {
transform: rotate(180deg);
}
.app-notifications .notification-advanced {
border-top: 1px solid var(--ui-border);
}
.app-notifications .notification-advanced > summary {
min-height: 2.75rem;
color: var(--ui-text-secondary);
font-size: 0.875rem;
font-weight: 600;
}
.app-notifications .notification-advanced > summary .notification-chevron {
margin-left: auto;
}
.app-notifications .notification-advanced__body {
padding: 0.25rem 0 0.25rem;
}
.app-notifications .notification-choice {
min-height: 2.75rem;
padding-block: 0.625rem;
}
.app-notifications .template-variables {
display: flex;
flex-wrap: wrap;
gap: 0.25rem;
margin-top: 0.375rem;
color: var(--ui-text-muted);
font-size: 0.75rem;
}
.app-notifications .template-variables code {
padding: 0.125rem 0.35rem;
border: 1px solid var(--ui-border);
border-radius: 0.25rem;
background: var(--ui-canvas);
}
@media (max-width: 640px) {
.app-notifications main {
padding-inline: 0.875rem;
}
.app-notifications #notification-search {
width: min(100%, 18rem);
}
.app-notifications .notification-section__body, .app-notifications .notification-panel {
padding: 0.875rem;
}
}
@media (max-width: 640px) {
.file-share-empty {
padding-right: 4rem;
}
}
+1 -1
View File
@@ -37,7 +37,7 @@
<div>
<label class="block text-sm font-medium text-slate-300 mb-1">File</label>
<input type="file" id="upload-file" required
class="block w-full text-sm text-slate-300 file:mr-4 file:py-2 file:px-4 file:rounded-lg file:border-0 file:text-sm file:font-medium file:bg-slate-800 file:text-slate-200 hover:file:bg-slate-700 cursor-pointer" />
class="block h-10 w-full rounded-lg border border-slate-700 text-sm text-slate-300 cursor-pointer" />
</div>
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
<div data-controller="toggle">
+141 -129
View File
@@ -15,23 +15,22 @@
<script defer src="/vendor/msgpackr/msgpackr.js"></script>
<link rel="stylesheet" href="/vendor/tabulator/tabulator_midnight.min.css" />
<link rel="stylesheet" href="/assets/main.css" />
<link rel="stylesheet" href="/assets/ui.css" />
<link rel="stylesheet" href="/assets/custom.css" />
<script defer src="/assets/toast.js"></script>
<script defer src="/assets/ripple.js"></script>
</head>
<body class="min-h-screen bg-slate-950 text-slate-100">
<body class="app-notifications min-h-screen bg-slate-950 text-slate-100">
<header id="top-nav"></header>
<main class="px-5 py-6">
<div class="max-w-7xl mx-auto flex flex-col gap-6">
<div class="notifications-shell max-w-7xl mx-auto flex flex-col gap-6">
<!-- Page header -->
<div class="flex flex-wrap items-start justify-between gap-4">
<div>
<h1 class="text-2xl font-semibold">Notifications</h1>
<p class="text-slate-400">
Active window &amp; clipboard alerts based on configured keyword patterns
</p>
<p class="text-sm text-slate-400">Rules, delivery, and history.</p>
</div>
<div class="flex flex-wrap items-center gap-3">
<span
@@ -45,43 +44,46 @@
</div>
<!-- Keyword Configuration (admin / operator only) -->
<div id="keyword-section" class="hidden bg-slate-900/60 border border-slate-800 rounded-xl p-4">
<div id="keyword-section" class="notification-panel hidden bg-slate-900/60 border border-slate-800 rounded-xl p-4">
<div class="flex items-center justify-between flex-wrap gap-3">
<div>
<h2 class="text-lg font-semibold">Keyword Configuration</h2>
<p class="text-sm text-slate-400">
One keyword per line — plain substring or <code class="text-slate-300">/regex/i</code> syntax. Changes apply to connected agents immediately. (Shared global setting)
</p>
<div class="flex items-center gap-2">
<h2 class="text-lg font-semibold">Keywords</h2>
<span class="ui-help" tabindex="0" role="img" aria-label="About keyword rules" title="One per line. Plain text and /regex/i are supported. Rules are shared and apply to connected agents immediately.">
<i class="fa-solid fa-circle-info"></i>
</span>
</div>
<button
id="save-keywords"
class="inline-flex items-center gap-2 px-3 py-2 rounded-lg bg-emerald-600 hover:bg-emerald-700 text-white"
>
<i class="fa-solid fa-save"></i>
<span>Save Keywords</span>
<span>Save</span>
</button>
</div>
<textarea
id="keyword-input"
rows="5"
rows="4"
placeholder="bank&#10;password&#10;admin&#10;/crypto|wallet/i&#10;/\b(bc1[a-z0-9]{39,59}|[13][a-km-zA-HJ-NP-Z1-9]{24,33})\b/"
class="mt-3 w-full rounded-lg bg-slate-950 border border-slate-800 text-slate-100 p-3 focus:outline-none focus:border-blue-500"
></textarea>
<label class="mt-3 inline-flex items-center gap-2 text-sm text-slate-300 cursor-pointer">
<input id="clipboard-enabled" type="checkbox" class="w-4 h-4 accent-emerald-500" />
Monitor clipboard content for keyword matches
Scan clipboard
</label>
<div class="mt-2 text-xs text-slate-500" id="keyword-hint"></div>
<!-- Anti-Spam Settings -->
<div class="mt-4 pt-4 border-t border-slate-800">
<h3 class="text-sm font-semibold text-slate-300">Anti-Spam Limits</h3>
<p class="text-xs text-slate-500 mt-1">
Block a keyword for a client when it fires too many times in a short window.
</p>
<div class="mt-3 grid grid-cols-1 sm:grid-cols-3 gap-3">
<details class="notification-advanced mt-4">
<summary>
<span>Rate limits</span>
<span class="ui-help" tabindex="0" role="img" aria-label="About rate limits" title="Temporarily suppress a keyword for a client after too many matches.">
<i class="fa-solid fa-circle-info"></i>
</span>
<i class="notification-chevron fa-solid fa-chevron-down" aria-hidden="true"></i>
</summary>
<div class="notification-advanced__body grid grid-cols-1 sm:grid-cols-3 gap-3">
<div>
<label class="block text-xs text-slate-400 mb-1">Max hits before block</label>
<label class="block text-xs text-slate-400 mb-1" title="Matches allowed before suppression">Hits</label>
<input
id="antispam-max-hits"
type="number"
@@ -91,7 +93,7 @@
/>
</div>
<div>
<label class="block text-xs text-slate-400 mb-1">Detection window (minutes)</label>
<label class="block text-xs text-slate-400 mb-1" title="Detection window in minutes">Window</label>
<input
id="antispam-window"
type="number"
@@ -101,7 +103,7 @@
/>
</div>
<div>
<label class="block text-xs text-slate-400 mb-1">Cooldown (minutes)</label>
<label class="block text-xs text-slate-400 mb-1" title="Suppression duration in minutes">Cooldown</label>
<input
id="antispam-cooldown"
type="number"
@@ -111,31 +113,35 @@
/>
</div>
</div>
</div>
</details>
</div>
<!-- Per-user Webhook Delivery -->
<div class="bg-slate-900/60 border border-slate-800 rounded-xl p-4">
<div class="flex items-center justify-between flex-wrap gap-3">
<div>
<h2 class="text-lg font-semibold">My Webhook</h2>
<p class="text-sm text-slate-400">
Your personal webhook — receives notifications only for clients you can access.
</p>
<details class="notification-section bg-slate-900/60 border border-slate-800 rounded-xl">
<summary class="notification-section__summary">
<span class="notification-section__title">
<i class="fa-solid fa-link text-indigo-400"></i>
<span>Webhook</span>
<span class="ui-help" tabindex="0" role="img" aria-label="About webhook delivery" title="Personal delivery for notifications from clients you can access.">
<i class="fa-solid fa-circle-info"></i>
</span>
</span>
<i class="notification-chevron fa-solid fa-chevron-down" aria-hidden="true"></i>
</summary>
<div class="notification-section__body">
<div class="flex items-center justify-between flex-wrap gap-3">
<label class="inline-flex items-center gap-2 text-sm text-slate-300 cursor-pointer">
<input id="webhook-enabled" type="checkbox" class="w-4 h-4 accent-emerald-500" />
Enabled
</label>
<button
id="save-webhook"
class="inline-flex items-center gap-2 px-3 py-2 rounded-lg bg-emerald-600 hover:bg-emerald-700 text-white"
>
<i class="fa-solid fa-save"></i>
<span>Save</span>
</button>
</div>
<button
id="save-webhook"
class="inline-flex items-center gap-2 px-3 py-2 rounded-lg bg-emerald-600 hover:bg-emerald-700 text-white"
>
<i class="fa-solid fa-save"></i>
<span>Save</span>
</button>
</div>
<label class="mt-4 inline-flex items-center gap-2 text-sm text-slate-300 cursor-pointer">
<input id="webhook-enabled" type="checkbox" class="w-4 h-4 accent-emerald-500" />
Enable webhook delivery
</label>
<div class="mt-3 relative">
<input
@@ -153,13 +159,20 @@
</div>
<!-- Webhook template editor -->
<div class="mt-4">
<div class="flex items-center justify-between flex-wrap gap-2 mb-1">
<span class="text-sm font-medium text-slate-300">Request Body Template</span>
<details class="notification-advanced mt-4">
<summary>
<span>Payload template</span>
<span class="ui-help" tabindex="0" role="img" aria-label="About webhook templates" title="Customize the JSON request body. Discord webhook URLs are formatted as embeds automatically.">
<i class="fa-solid fa-circle-info"></i>
</span>
<i class="notification-chevron fa-solid fa-chevron-down" aria-hidden="true"></i>
</summary>
<div class="notification-advanced__body">
<div class="flex items-center justify-end flex-wrap gap-2 mb-2">
<div class="flex gap-2">
<button id="reset-webhook-template" type="button"
class="text-xs px-2 py-1 rounded bg-slate-800 hover:bg-slate-700 text-slate-300">
Use Premade Template
Reset
</button>
<button id="format-webhook-template" type="button"
class="text-xs px-2 py-1 rounded bg-slate-800 hover:bg-slate-700 text-slate-300">
@@ -176,8 +189,8 @@
class="w-full rounded-lg bg-slate-950 border border-slate-800 text-slate-100 focus-within:border-blue-500"
style="height: 180px;"
></textarea>
<p class="mt-1 text-xs text-slate-500">
Variables: <code class="text-slate-400">{title}</code>
<div class="template-variables" aria-label="Available template variables">
<code class="text-slate-400">{title}</code>
<code class="text-slate-400">{keyword}</code>
<code class="text-slate-400">{clientId}</code>
<code class="text-slate-400">{user}</code>
@@ -186,36 +199,41 @@
<code class="text-slate-400">{os}</code>
<code class="text-slate-400">{pid}</code>
<code class="text-slate-400">{ts}</code>
&nbsp;&mdash; Discord webhook URLs auto-format as embeds.
</p>
</div>
<div id="webhook-template-preview"
class="hidden mt-3 bg-slate-950 border border-slate-700 rounded-lg p-3 text-xs font-mono text-slate-300 whitespace-pre-wrap max-h-48 overflow-y-auto">
</div>
</div>
</details>
</div>
</div>
</details>
<!-- Per-user Telegram Bot Delivery -->
<div class="bg-slate-900/60 border border-slate-800 rounded-xl p-4">
<div class="flex items-center justify-between flex-wrap gap-3">
<div>
<h2 class="text-lg font-semibold">My Telegram Bot</h2>
<p class="text-sm text-slate-400">
Your personal Telegram bot — receives notifications only for clients you can access.
</p>
<details class="notification-section bg-slate-900/60 border border-slate-800 rounded-xl">
<summary class="notification-section__summary">
<span class="notification-section__title">
<i class="fa-brands fa-telegram text-sky-400"></i>
<span>Telegram</span>
<span class="ui-help" tabindex="0" role="img" aria-label="About Telegram delivery" title="Personal delivery for notifications from clients you can access.">
<i class="fa-solid fa-circle-info"></i>
</span>
</span>
<i class="notification-chevron fa-solid fa-chevron-down" aria-hidden="true"></i>
</summary>
<div class="notification-section__body">
<div class="flex items-center justify-between flex-wrap gap-3">
<label class="inline-flex items-center gap-2 text-sm text-slate-300 cursor-pointer">
<input id="telegram-enabled" type="checkbox" class="w-4 h-4 accent-emerald-500" />
Enabled
</label>
<button
id="save-telegram"
class="inline-flex items-center gap-2 px-3 py-2 rounded-lg bg-emerald-600 hover:bg-emerald-700 text-white"
>
<i class="fa-solid fa-save"></i>
<span>Save</span>
</button>
</div>
<button
id="save-telegram"
class="inline-flex items-center gap-2 px-3 py-2 rounded-lg bg-emerald-600 hover:bg-emerald-700 text-white"
>
<i class="fa-solid fa-save"></i>
<span>Save</span>
</button>
</div>
<label class="mt-4 inline-flex items-center gap-2 text-sm text-slate-300 cursor-pointer">
<input id="telegram-enabled" type="checkbox" class="w-4 h-4 accent-emerald-500" />
Enable Telegram delivery
</label>
<div class="mt-3 grid grid-cols-1 gap-3 sm:grid-cols-2">
<div class="relative">
@@ -249,13 +267,20 @@
</div>
<!-- Telegram template editor -->
<div class="mt-4">
<div class="flex items-center justify-between flex-wrap gap-2 mb-1">
<span class="text-sm font-medium text-slate-300">Message Template</span>
<details class="notification-advanced mt-4">
<summary>
<span>Message template</span>
<span class="ui-help" tabindex="0" role="img" aria-label="About Telegram templates" title="Customize the Telegram message using notification variables.">
<i class="fa-solid fa-circle-info"></i>
</span>
<i class="notification-chevron fa-solid fa-chevron-down" aria-hidden="true"></i>
</summary>
<div class="notification-advanced__body">
<div class="flex items-center justify-end flex-wrap gap-2 mb-2">
<div class="flex gap-2">
<button id="reset-telegram-template" type="button"
class="text-xs px-2 py-1 rounded bg-slate-800 hover:bg-slate-700 text-slate-300">
Use Premade Template
Reset
</button>
<button id="preview-telegram-template" type="button"
class="text-xs px-2 py-1 rounded bg-blue-700 hover:bg-blue-600 text-white">
@@ -269,8 +294,8 @@
placeholder="Premade template will be loaded automatically"
class="w-full rounded-lg bg-slate-950 border border-slate-800 text-slate-100 p-3 font-mono text-xs focus:outline-none focus:border-blue-500"
></textarea>
<p class="mt-1 text-xs text-slate-500">
Variables: <code class="text-slate-400">{title}</code>
<div class="template-variables" aria-label="Available template variables">
<code class="text-slate-400">{title}</code>
<code class="text-slate-400">{keyword}</code>
<code class="text-slate-400">{clientId}</code>
<code class="text-slate-400">{user}</code>
@@ -279,21 +304,23 @@
<code class="text-slate-400">{os}</code>
<code class="text-slate-400">{pid}</code>
<code class="text-slate-400">{ts}</code>
</p>
</div>
<div id="telegram-template-preview"
class="hidden mt-3 bg-slate-950 border border-slate-700 rounded-lg p-3 text-xs font-mono text-slate-300 whitespace-pre-wrap max-h-48 overflow-y-auto">
</div>
</div>
</details>
</div>
</div>
</details>
<!-- Desktop Event Notifications -->
<div class="bg-slate-900/60 border border-slate-800 rounded-xl p-4">
<div class="notification-panel bg-slate-900/60 border border-slate-800 rounded-xl p-4">
<div class="flex items-center justify-between flex-wrap gap-3 mb-4">
<div>
<h2 class="text-lg font-semibold">Desktop Event Notifications</h2>
<p class="text-sm text-slate-400">
Choose which client events trigger a desktop (OS) notification.
</p>
<div class="flex items-center gap-2">
<h2 class="text-lg font-semibold">Desktop alerts</h2>
<span class="ui-help" tabindex="0" role="img" aria-label="About desktop alerts" title="Choose which client events create an operating-system notification.">
<i class="fa-solid fa-circle-info"></i>
</span>
</div>
<button
id="save-event-notifs"
@@ -323,38 +350,29 @@
</div>
<div class="grid grid-cols-1 sm:grid-cols-3 gap-3 text-sm">
<label class="flex items-center gap-3 rounded-lg bg-slate-950 border border-slate-800 px-4 py-3 cursor-pointer hover:border-slate-600 transition-colors">
<label title="Notify when a client connects" class="notification-choice flex items-center gap-3 rounded-lg bg-slate-950 border border-slate-800 px-4 py-3 cursor-pointer hover:border-slate-600 transition-colors">
<input id="event-notif-online" type="checkbox" class="h-4 w-4 accent-emerald-500 shrink-0" />
<span class="flex flex-col gap-0.5">
<span class="text-slate-200 font-medium">&#x1F7E2; Client Online</span>
<span class="text-slate-500 text-xs">Fire when a client connects</span>
</span>
<span class="text-slate-200 font-medium"><i class="fa-solid fa-circle text-emerald-400 text-[0.55rem] mr-1.5"></i>Online</span>
</label>
<label class="flex items-center gap-3 rounded-lg bg-slate-950 border border-slate-800 px-4 py-3 cursor-pointer hover:border-slate-600 transition-colors">
<label title="Notify when a client disconnects" class="notification-choice flex items-center gap-3 rounded-lg bg-slate-950 border border-slate-800 px-4 py-3 cursor-pointer hover:border-slate-600 transition-colors">
<input id="event-notif-offline" type="checkbox" class="h-4 w-4 accent-red-500 shrink-0" />
<span class="flex flex-col gap-0.5">
<span class="text-slate-200 font-medium">&#x1F534; Client Offline</span>
<span class="text-slate-500 text-xs">Fire when a client disconnects</span>
</span>
<span class="text-slate-200 font-medium"><i class="fa-solid fa-circle text-red-400 text-[0.55rem] mr-1.5"></i>Offline</span>
</label>
<label class="flex items-center gap-3 rounded-lg bg-slate-950 border border-slate-800 px-4 py-3 cursor-pointer hover:border-slate-600 transition-colors">
<label title="Notify when a client awaits approval" class="notification-choice flex items-center gap-3 rounded-lg bg-slate-950 border border-slate-800 px-4 py-3 cursor-pointer hover:border-slate-600 transition-colors">
<input id="event-notif-purgatory" type="checkbox" class="h-4 w-4 accent-yellow-500 shrink-0" />
<span class="flex flex-col gap-0.5">
<span class="text-slate-200 font-medium">&#x1F7E1; Client in Purgatory</span>
<span class="text-slate-500 text-xs">Fire when a client awaits approval</span>
</span>
<span class="text-slate-200 font-medium"><i class="fa-solid fa-circle text-amber-400 text-[0.55rem] mr-1.5"></i>Purgatory</span>
</label>
</div>
</div>
<!-- Client Event Delivery Channels -->
<div class="bg-slate-900/60 border border-slate-800 rounded-xl p-4">
<div class="notification-panel bg-slate-900/60 border border-slate-800 rounded-xl p-4">
<div class="flex items-center justify-between flex-wrap gap-3 mb-4">
<div>
<h2 class="text-lg font-semibold">Client Event Delivery Channels</h2>
<p class="text-sm text-slate-400">
Choose which channels receive client lifecycle events (online, offline, purgatory).
</p>
<div class="flex items-center gap-2">
<h2 class="text-lg font-semibold">Event delivery</h2>
<span class="ui-help" tabindex="0" role="img" aria-label="About event delivery" title="Send online, offline, and purgatory events through these channels.">
<i class="fa-solid fa-circle-info"></i>
</span>
</div>
<button
id="save-event-channels"
@@ -366,26 +384,17 @@
</div>
<div class="grid grid-cols-1 sm:grid-cols-3 gap-3 text-sm">
<label class="flex items-center gap-3 rounded-lg bg-slate-950 border border-slate-800 px-4 py-3 cursor-pointer hover:border-slate-600 transition-colors">
<label title="Send client events to your webhook" class="notification-choice flex items-center gap-3 rounded-lg bg-slate-950 border border-slate-800 px-4 py-3 cursor-pointer hover:border-slate-600 transition-colors">
<input id="client-event-webhook" type="checkbox" class="h-4 w-4 accent-indigo-500 shrink-0" />
<span class="flex flex-col gap-0.5">
<span class="text-slate-200 font-medium"><i class="fa-brands fa-discord mr-1"></i> Discord Webhook</span>
<span class="text-slate-500 text-xs">Send client events to your webhook</span>
</span>
<span class="text-slate-200 font-medium"><i class="fa-solid fa-link text-indigo-400 mr-1.5"></i>Webhook</span>
</label>
<label class="flex items-center gap-3 rounded-lg bg-slate-950 border border-slate-800 px-4 py-3 cursor-pointer hover:border-slate-600 transition-colors">
<label title="Send client events to Telegram" class="notification-choice flex items-center gap-3 rounded-lg bg-slate-950 border border-slate-800 px-4 py-3 cursor-pointer hover:border-slate-600 transition-colors">
<input id="client-event-telegram" type="checkbox" class="h-4 w-4 accent-sky-500 shrink-0" />
<span class="flex flex-col gap-0.5">
<span class="text-slate-200 font-medium"><i class="fa-brands fa-telegram mr-1"></i> Telegram Bot</span>
<span class="text-slate-500 text-xs">Send client events to your Telegram</span>
</span>
<span class="text-slate-200 font-medium"><i class="fa-brands fa-telegram text-sky-400 mr-1.5"></i>Telegram</span>
</label>
<label class="flex items-center gap-3 rounded-lg bg-slate-950 border border-slate-800 px-4 py-3 cursor-pointer hover:border-slate-600 transition-colors">
<label title="Send client events through browser push" class="notification-choice flex items-center gap-3 rounded-lg bg-slate-950 border border-slate-800 px-4 py-3 cursor-pointer hover:border-slate-600 transition-colors">
<input id="client-event-push" type="checkbox" class="h-4 w-4 accent-emerald-500 shrink-0" />
<span class="flex flex-col gap-0.5">
<span class="text-slate-200 font-medium"><i class="fa-solid fa-bell mr-1"></i> Push Notifications</span>
<span class="text-slate-500 text-xs">Send client events via browser push</span>
</span>
<span class="text-slate-200 font-medium"><i class="fa-solid fa-bell text-emerald-400 mr-1.5"></i>Push</span>
</label>
</div>
</div>
@@ -393,12 +402,15 @@
<!-- Notification feed -->
<div
id="notification-panel"
class="bg-slate-900/60 border border-slate-800 rounded-xl p-4"
class="notification-panel bg-slate-900/60 border border-slate-800 rounded-xl p-4"
>
<div class="flex items-center justify-between flex-wrap gap-3 mb-3">
<div>
<h2 class="text-lg font-semibold">Notifications</h2>
<p id="notification-scope-hint" class="text-xs text-slate-500 mt-0.5">
<div class="flex items-center gap-2">
<h2 class="text-lg font-semibold">History</h2>
<span class="ui-help" tabindex="0" role="img" aria-label="About notification history" title="Shows notifications for clients you can access.">
<i class="fa-solid fa-circle-info"></i>
</span>
<p id="notification-scope-hint" class="sr-only">
Showing notifications for your accessible clients.
</p>
</div>
@@ -408,7 +420,7 @@
<input
id="notification-search"
type="search"
placeholder="Search notifications..."
placeholder="Search"
class="w-64 sm:w-72 rounded-lg bg-slate-950 border border-slate-800 text-slate-100 pl-8 pr-3 py-2 text-sm focus:outline-none focus:border-blue-500"
/>
</div>
@@ -420,7 +432,7 @@
id="empty-state"
class="py-6 text-center text-slate-400"
>
No notifications yet.
No notifications.
</div>
</div>
+4 -1
View File
@@ -4,5 +4,8 @@
@import "./web/styles/primitives/buttons.css";
@import "./web/styles/primitives/badges.css";
@import "./web/styles/primitives/popovers.css";
@import "./web/styles/primitives/help.css";
@import "./web/styles/primitives/fields.css";
@import "./web/styles/patterns/toolbars.css";
@import "./web/styles/features/notifications.css";
@import "./web/styles/features/file-share.css";
-1
View File
@@ -15,4 +15,3 @@
transition-duration: 0.01ms !important;
}
}
@@ -0,0 +1,5 @@
@media (max-width: 640px) {
.file-share-empty {
padding-right: 4rem;
}
}
@@ -0,0 +1,118 @@
.app-notifications .notifications-shell {
gap: 1rem;
}
.app-notifications .notification-panel,
.app-notifications .notification-section {
border-color: var(--ui-border);
border-radius: 0.875rem;
background: var(--ui-surface);
box-shadow: var(--ui-shadow-sm);
}
.app-notifications .notification-section {
overflow: clip;
}
.app-notifications .notification-section__summary,
.app-notifications .notification-advanced > summary {
display: flex;
align-items: center;
gap: 0.625rem;
list-style: none;
cursor: pointer;
user-select: none;
}
.app-notifications .notification-section__summary {
justify-content: space-between;
min-height: 3.5rem;
padding: 0.75rem 1rem;
font-weight: 600;
}
.app-notifications .notification-section__summary::-webkit-details-marker,
.app-notifications .notification-advanced > summary::-webkit-details-marker {
display: none;
}
.app-notifications .notification-section__summary:hover,
.app-notifications .notification-section__summary:focus-visible {
background: rgb(30 41 59 / 0.45);
}
.app-notifications .notification-section__title {
display: inline-flex;
align-items: center;
gap: 0.625rem;
}
.app-notifications .notification-section__body {
padding: 1rem;
border-top: 1px solid var(--ui-border);
}
.app-notifications .notification-chevron {
color: var(--ui-text-muted);
font-size: 0.75rem;
transition: transform 160ms ease;
}
.app-notifications details[open] > summary > .notification-chevron {
transform: rotate(180deg);
}
.app-notifications .notification-advanced {
border-top: 1px solid var(--ui-border);
}
.app-notifications .notification-advanced > summary {
min-height: 2.75rem;
color: var(--ui-text-secondary);
font-size: 0.875rem;
font-weight: 600;
}
.app-notifications .notification-advanced > summary .notification-chevron {
margin-left: auto;
}
.app-notifications .notification-advanced__body {
padding: 0.25rem 0 0.25rem;
}
.app-notifications .notification-choice {
min-height: 2.75rem;
padding-block: 0.625rem;
}
.app-notifications .template-variables {
display: flex;
flex-wrap: wrap;
gap: 0.25rem;
margin-top: 0.375rem;
color: var(--ui-text-muted);
font-size: 0.75rem;
}
.app-notifications .template-variables code {
padding: 0.125rem 0.35rem;
border: 1px solid var(--ui-border);
border-radius: 0.25rem;
background: var(--ui-canvas);
}
@media (max-width: 640px) {
.app-notifications main {
padding-inline: 0.875rem;
}
.app-notifications #notification-search {
width: min(100%, 18rem);
}
.app-notifications .notification-section__body,
.app-notifications .notification-panel {
padding: 0.875rem;
}
}
@@ -50,4 +50,3 @@
background: var(--ui-text-faint);
box-shadow: 0 0 0 4px rgba(100, 116, 139, 0.1);
}
@@ -19,4 +19,3 @@
opacity: 0.52;
border-color: rgba(56, 189, 248, 0.62);
}
@@ -0,0 +1,48 @@
/* Inputs nested inside a styled shell should not paint a second surface. */
input.bg-transparent,
.graph-field input {
background-color: transparent !important;
border-color: transparent !important;
box-shadow: none !important;
}
.graph-field,
.graph-select {
border-color: var(--ui-border-subtle);
background: var(--ui-surface-1);
color: var(--ui-text);
}
.graph-field:focus-within,
.graph-select:focus {
border-color: var(--ui-border-strong) !important;
box-shadow: none !important;
}
.graph-field input::placeholder {
color: var(--ui-text-faint);
}
#upload-file {
padding: 0 0.75rem 0 0;
overflow: hidden;
color: var(--ui-text-muted);
}
#upload-file::file-selector-button {
height: 100%;
margin-right: 0.75rem;
padding: 0 0.875rem;
border: 0;
border-right: 1px solid var(--ui-border-subtle);
border-radius: 0;
background: transparent;
color: var(--ui-text);
font: inherit;
font-weight: 600;
cursor: pointer;
}
#upload-file:hover::file-selector-button {
background: var(--ui-surface-2);
}
@@ -0,0 +1,24 @@
.ui-help {
display: inline-flex;
align-items: center;
justify-content: center;
width: 1.25rem;
height: 1.25rem;
flex: none;
color: var(--ui-text-muted);
font-size: 0.75rem;
border-radius: 999px;
cursor: help;
}
.ui-help:hover,
.ui-help:focus-visible {
color: var(--ui-accent);
outline: none;
}
.ui-heading-help {
display: flex;
align-items: center;
gap: 0.4rem;
}
@@ -0,0 +1,68 @@
import { expect, test } from "@playwright/test";
import { collectBrowserIssues, login } from "./helpers";
test.describe("concise UI conventions", () => {
test("removes redundant page copy and promotes section help", async ({ page }) => {
const browserIssues = collectBrowserIssues(page);
await login(page);
await page.goto("/logs");
await expect(page.getByRole("heading", { name: "Client Connection Logs" })).toBeVisible();
await expect(page.getByText("Review connection lifecycle activity across enrolled clients.")).toHaveCount(0);
const filterHelp = page.locator("h2", { hasText: "Filter activity" }).locator(".ui-help");
await expect(filterHelp).toHaveAttribute("title", "Narrow results by client, time range, or event type.");
await expect(page.getByText("Narrow results by client, time range, or event type.")).toHaveClass("sr-only");
await page.goto("/plugins");
await expect(page.getByRole("heading", { name: "Plugins", exact: true })).toBeVisible();
await expect(page.getByText("Upload zip bundles and manage client plugins or server extensions")).toHaveCount(0);
await expect(page.locator("h2", { hasText: "Upload" }).locator(".ui-help")).toHaveAttribute(
"title",
"Drag a plugin zip here or click to browse",
);
await page.goto("/settings");
await expect(page.getByRole("heading", { name: "Settings", exact: true })).toBeVisible();
await expect(page.getByText("Manage your account preferences, operational tools, and admin configuration.")).toHaveCount(0);
await expect(page.locator("#section-account h2 .ui-help")).toHaveAttribute(
"title",
"View your account info and update your password.",
);
await expect(page.locator("#chat-retention-days")).toHaveAttribute(
"title",
"Messages older than this will be automatically deleted. Set to 0 to keep messages forever. Max 365 days.",
);
await page.waitForLoadState("networkidle");
await page.goto("/build");
await expect(page.getByText("Build customized Overlord client agents")).toHaveCount(0);
const obfuscateOption = page.locator('label:has(input[name="obfuscate"])').first();
await expect(obfuscateOption).toHaveAttribute("title", "Build with garble for code obfuscation");
await expect(obfuscateOption.locator("span.sr-only")).toContainText("Build with garble");
await page.waitForLoadState("networkidle");
await page.goto("/purgatory");
await page.locator("#auto-accept-toggle").click({ force: true });
await expect(page.getByText("This disables all enrollment security.")).toBeVisible();
await page.locator("#auto-accept-modal-cancel").click();
expect(browserIssues).toEqual([]);
});
test("keeps compact help and controls usable at phone width", async ({ page }) => {
await page.setViewportSize({ width: 390, height: 844 });
const browserIssues = collectBrowserIssues(page);
await login(page);
await page.goto("/settings");
await expect(page.locator("#section-account h2 .ui-help")).toBeVisible();
await page.locator("#section-account h2 .ui-help").focus();
const overflow = await page.evaluate(() => ({
body: document.body.scrollWidth - document.body.clientWidth,
root: document.documentElement.scrollWidth - document.documentElement.clientWidth,
}));
expect(overflow.body).toBeLessThanOrEqual(1);
expect(overflow.root).toBeLessThanOrEqual(1);
expect(browserIssues).toEqual([]);
});
});
+5 -1
View File
@@ -18,7 +18,11 @@ export async function login(
export async function navigateFromMenu(page: Page, linkId: string): Promise<void> {
const link = page.locator(`#${linkId}`);
const wrapper = link.locator("xpath=ancestor::*[contains(@class, 'nav-dd-wrapper')][1]");
await wrapper.locator(":scope > .nav-dd-group-btn").click();
const groupButton = wrapper.locator(":scope > .nav-dd-group-btn");
if (!(await groupButton.isVisible())) {
await page.locator("#topbar-nav-toggle").click();
}
await groupButton.click();
await expect(link).toBeVisible();
await link.click();
}
@@ -0,0 +1,54 @@
import { expect, test } from "@playwright/test";
import { collectBrowserIssues, login } from "./helpers";
test.describe("compact notifications layout", () => {
test("keeps common settings visible and advanced delivery collapsed", async ({ page }) => {
const browserIssues = collectBrowserIssues(page);
await login(page);
await page.goto("/notifications");
await expect(page.getByRole("heading", { name: "Keywords" })).toBeVisible();
await expect(page.locator("#keyword-input")).toBeVisible();
await expect(page.getByRole("heading", { name: "Desktop alerts" })).toBeVisible();
await expect(page.getByRole("heading", { name: "Event delivery" })).toBeVisible();
const deliverySections = page.locator("details.notification-section");
await expect(deliverySections).toHaveCount(2);
await expect(deliverySections.nth(0)).not.toHaveAttribute("open", "");
await expect(deliverySections.nth(1)).not.toHaveAttribute("open", "");
await expect(page.locator("#save-webhook")).not.toBeVisible();
await expect(page.locator("#save-telegram")).not.toBeVisible();
await deliverySections.nth(0).locator(":scope > summary").click();
await expect(page.locator("#save-webhook")).toBeVisible();
await expect(page.locator("#webhook-url")).toBeVisible();
await expect(page.locator("#webhook-template")).not.toBeVisible();
await deliverySections.nth(0).locator("details.notification-advanced > summary").click();
await expect(page.getByRole("textbox", { name: "Editor content" })).toBeVisible();
await expect(page.locator(".ui-help[title]")).toHaveCount(9);
await expect(page.getByText("Fire when a client connects")).toHaveCount(0);
await expect(page.getByText("Your personal webhook")).toHaveCount(0);
expect(browserIssues).toEqual([]);
});
test("fits opened settings on a phone viewport", async ({ page }) => {
await page.setViewportSize({ width: 390, height: 844 });
const browserIssues = collectBrowserIssues(page);
await login(page);
await page.goto("/notifications");
const webhook = page.locator("details.notification-section").first();
await webhook.locator(":scope > summary").click();
await webhook.locator("details.notification-advanced > summary").click();
await expect(page.getByRole("textbox", { name: "Editor content" })).toBeVisible();
const overflow = await page.evaluate(() => ({
body: document.body.scrollWidth - document.body.clientWidth,
root: document.documentElement.scrollWidth - document.documentElement.clientWidth,
}));
expect(overflow.body).toBeLessThanOrEqual(1);
expect(overflow.root).toBeLessThanOrEqual(1);
expect(browserIssues).toEqual([]);
});
});
+66
View File
@@ -0,0 +1,66 @@
import { expect, test } from "@playwright/test";
import { collectBrowserIssues, login } from "./helpers";
test.describe("cross-page UI polish", () => {
test("rounds notification panels and normalizes graph fields", async ({ page }) => {
const browserIssues = collectBrowserIssues(page);
await login(page);
await page.goto("/notifications");
const notificationRadius = await page.locator("#keyword-section").evaluate((element) =>
Number.parseFloat(getComputedStyle(element).borderTopLeftRadius),
);
const deliveryRadius = await page.locator("details.notification-section").first().evaluate((element) =>
Number.parseFloat(getComputedStyle(element).borderTopLeftRadius),
);
expect(notificationRadius).toBeGreaterThanOrEqual(14);
expect(deliveryRadius).toBeGreaterThanOrEqual(14);
await page.goto("/graph");
const graphColors = await page.evaluate(() => {
const field = document.querySelector(".graph-field");
const input = document.querySelector("#graph-search");
const select = document.querySelector("#graph-status");
if (!field || !input || !select) throw new Error("Graph controls are missing");
return {
field: getComputedStyle(field).backgroundColor,
input: getComputedStyle(input).backgroundColor,
select: getComputedStyle(select).backgroundColor,
};
});
expect(graphColors.input).toBe("rgba(0, 0, 0, 0)");
expect(graphColors.field).toBe(graphColors.select);
await page.locator("#graph-search").fill("example");
await expect(page.locator("#graph-search")).toHaveValue("example");
expect(browserIssues).toEqual([]);
});
test("spaces the File Share empty state and fits on mobile", async ({ page }) => {
await page.setViewportSize({ width: 390, height: 844 });
const browserIssues = collectBrowserIssues(page);
await login(page);
await page.goto("/file-share");
const emptyState = page.locator(".file-share-empty");
await expect(emptyState).toBeVisible();
const filePickerColors = await page.locator("#upload-file").evaluate((element) => ({
field: getComputedStyle(element).backgroundColor,
button: getComputedStyle(element, "::file-selector-button").backgroundColor,
}));
expect(filePickerColors.button).toBe("rgba(0, 0, 0, 0)");
expect(filePickerColors.field).not.toBe(filePickerColors.button);
await page.locator("#upload-file").hover();
const iconBox = await emptyState.locator("i").boundingBox();
const labelBox = await emptyState.locator("span").boundingBox();
expect(iconBox).not.toBeNull();
expect(labelBox).not.toBeNull();
expect(labelBox!.y - (iconBox!.y + iconBox!.height)).toBeGreaterThanOrEqual(11);
const overflow = await page.evaluate(() =>
document.documentElement.scrollWidth - document.documentElement.clientWidth,
);
expect(overflow).toBeLessThanOrEqual(1);
expect(browserIssues).toEqual([]);
});
});