Build ErsatzTV Image / Docs update reminder (push) Has been skipped
Build ErsatzTV Image / decisions.md append-only (push) Has been skipped
Build ErsatzTV Image / API docs in sync (OpenAPI + endpoint index) (push) Has been skipped
Build ErsatzTV Image / Formatting (changed .cs conform to .editorconfig) (push) Has been skipped
Build ErsatzTV Image / Functional E2E (curl contracts) (push) Successful in 4m46s
Build ErsatzTV Image / Build & test (.NET) (push) Successful in 11m26s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (push) Successful in 13m34s
Build ErsatzTV Image / Build & push image (amd64) (push) Failing after 16s
Bulk mirror sweep (#388): author/rebuild a prototype mockup for every shipped SPA screen so the Claude Design project (eb3b6122 / local design-system/) faithfully reflects prod. - 40 screens authored (mockups: visual/layout parity, no logic) via a fan-out workflow; 8 stale prototypes rebuilt (Dashboard, ChannelBuilder, Guide, Schedules, Playouts, Settings, …), 32 net-new (media/sources/system/auth). Retired Epg/ScheduleEditor/ScheduleLibrary. - New screens.js = single source of truth for the inventory; Shell.jsx nav + app.html screen map both build from it (nav groups mirror web/src/app/routes.tsx). app.html is now hash-routed. - All 42 views verified rendering headlessly across the 3 themes (126/126, 0 real errors). - design-sync-reminder.sh hook (+ settings.json): mechanical, fail-open, once/session nudge to pull-first (PreToolUse Write|Edit on web/src/**.{tsx,css}) and mirror/push-back (Stop) — keeps the design system from drifting from prod going forward. - docs/design-sync.md: document the bulk-sweep structure + the reminder hook. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
136 lines
8.9 KiB
React
136 lines
8.9 KiB
React
// App shell: left sidebar + compact top bar. Composes DS NavItem/NavSection.
|
|
(function () {
|
|
const NS = window.ChicoryTVDesignSystem_eb3b61;
|
|
const { NavItem, NavSection, Input, IconButton, StatusDot, Button } = NS;
|
|
const Ico = window.Ico;
|
|
|
|
// Nav is built from the canonical inventory (screens.js) so it can never drift from the
|
|
// screen map in app.html. A per-nav badge on "playouts" is kept as a demo affordance.
|
|
const SCREENS = window.CTV_SCREENS || [];
|
|
const GROUPS = window.CTV_NAV_GROUPS || [{ key: "primary", label: null }];
|
|
const BADGES = { playouts: 3 };
|
|
|
|
function Sidebar({ view, setView }) {
|
|
return (
|
|
<aside style={{
|
|
width: "var(--sidebar-w)", flex: "0 0 auto", height: "100%",
|
|
background: "var(--surface-card)", borderRight: "1px solid var(--border-hairline)",
|
|
display: "flex", flexDirection: "column",
|
|
}}>
|
|
<div style={{ display: "flex", alignItems: "center", gap: 10, height: "var(--topbar-h)", padding: "0 14px", borderBottom: "1px solid var(--border-hairline)" }}>
|
|
<img src="../../assets/chicory-mark.svg" width="24" height="24" alt="" />
|
|
<span style={{ font: "var(--weight-semibold) 16px/1 var(--font-sans)", letterSpacing: "-0.3px", color: "var(--text-primary)" }}>
|
|
Chicory<span style={{ color: "var(--ctv-accent)" }}>TV</span>
|
|
</span>
|
|
</div>
|
|
<nav className="ctv-hide-sb" style={{ flex: 1, overflow: "auto", padding: "8px 8px 16px" }}>
|
|
{GROUPS.map((g) => {
|
|
const items = SCREENS.filter((s) => s.group === g.key);
|
|
if (!items.length) return null;
|
|
return (
|
|
<React.Fragment key={g.key}>
|
|
{g.label ? <NavSection>{g.label}</NavSection> : null}
|
|
{items.map((n) => (
|
|
<NavItem key={n.id} icon={<Ico n={n.icon} />} label={n.title} active={view === n.id}
|
|
badge={BADGES[n.id]} badgeTone="warn" onClick={() => setView(n.id)} />
|
|
))}
|
|
</React.Fragment>
|
|
);
|
|
})}
|
|
</nav>
|
|
<div style={{ padding: "12px 14px", borderTop: "1px solid var(--border-hairline)", display: "flex", alignItems: "center", justifyContent: "space-between" }}>
|
|
<div style={{ display: "flex", flexDirection: "column", gap: 2 }}>
|
|
<span style={{ font: "var(--text-2xs)/1 var(--font-sans)", color: "var(--text-disabled)" }}>ChicoryTV</span>
|
|
<span style={{ font: "var(--text-2xs)/1 var(--font-mono)", color: "var(--text-secondary)" }}>v26.4.0</span>
|
|
</div>
|
|
<StatusDot status="ok" label="Healthy" />
|
|
</div>
|
|
</aside>
|
|
);
|
|
}
|
|
|
|
function TopBar({ title, actions }) {
|
|
return (
|
|
<header style={{
|
|
display: "flex", alignItems: "center", gap: 16, height: "var(--topbar-h)", flex: "0 0 auto",
|
|
padding: "0 20px", background: "var(--surface-app)", borderBottom: "1px solid var(--border-hairline)",
|
|
}}>
|
|
<h1 style={{ margin: 0, width: 150, flex: "0 0 auto", whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", font: "var(--weight-semibold) var(--text-lg)/1 var(--font-sans)", letterSpacing: "-0.01em", color: "var(--text-primary)" }}>{title}</h1>
|
|
<div style={{ width: 300 }}>
|
|
<Input size="sm" leadingIcon={<Ico n="Search" s={15} />} placeholder="Search channels, schedules…" />
|
|
</div>
|
|
<div style={{ flex: 1 }} />
|
|
<div style={{ display: "flex", alignItems: "center", gap: 6 }}>
|
|
<ConnectMenu />
|
|
<span style={{ width: 1, height: 18, background: "var(--border-hairline)", margin: "0 4px" }} />
|
|
<IconButton title="Documentation"><Ico n="CircleHelp" s={17} /></IconButton>
|
|
<IconButton title="Notifications"><Ico n="Bell" s={17} /></IconButton>
|
|
<div style={{ width: 28, height: 28, marginLeft: 4, borderRadius: "50%", background: "var(--ctv-accent-soft)", border: "1px solid rgba(91,124,250,.35)", display: "flex", alignItems: "center", justifyContent: "center", font: "var(--weight-semibold) 11px/1 var(--font-mono)", color: "var(--ctv-accent)" }}>TB</div>
|
|
</div>
|
|
{actions}
|
|
</header>
|
|
);
|
|
}
|
|
|
|
// GROUND-UP: replaces the two raw "M3U"/"XMLTV" endpoint links with a real
|
|
// "connect your player" surface — copyable URLs, a scan tile, and options.
|
|
function EndpointRow({ icon, label, url }) {
|
|
const [copied, setCopied] = React.useState(false);
|
|
const copy = () => {
|
|
try { navigator.clipboard && navigator.clipboard.writeText(url); } catch (e) {}
|
|
setCopied(true); setTimeout(() => setCopied(false), 1400);
|
|
};
|
|
return (
|
|
<div style={{ display: "flex", alignItems: "center", gap: 10, padding: "10px 11px", borderRadius: "var(--radius-sm)", background: "var(--ctv-bg-sunken)", border: "1px solid var(--border-hairline)" }}>
|
|
<span style={{ display: "inline-flex", alignItems: "center", justifyContent: "center", width: 30, height: 30, borderRadius: "var(--radius-xs)", background: "var(--ctv-surface-3)", color: "var(--ctv-accent)", flex: "0 0 auto" }}><Ico n={icon} s={15} /></span>
|
|
<div style={{ flex: 1, minWidth: 0 }}>
|
|
<div style={{ font: "var(--weight-medium) var(--text-xs)/1 var(--font-sans)", color: "var(--text-primary)" }}>{label}</div>
|
|
<div style={{ marginTop: 3, font: "var(--text-2xs)/1 var(--font-mono)", color: "var(--text-secondary)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{url}</div>
|
|
</div>
|
|
<button type="button" onClick={copy} title="Copy" style={{ display: "inline-flex", alignItems: "center", gap: 5, padding: "5px 8px", flex: "0 0 auto", border: "1px solid var(--border-control)", borderRadius: "var(--radius-xs)", background: copied ? "var(--ctv-ok-soft)" : "var(--ctv-surface-2)", color: copied ? "var(--status-ok)" : "var(--text-secondary)", cursor: "pointer", font: "var(--weight-medium) var(--text-2xs)/1 var(--font-sans)" }}>
|
|
<Ico n={copied ? "Check" : "Copy"} s={12} />{copied ? "Copied" : "Copy"}
|
|
</button>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
function ConnectMenu() {
|
|
const [open, setOpen] = React.useState(false);
|
|
const [enabledOnly, setEnabledOnly] = React.useState(true);
|
|
const q = enabledOnly ? "?enabled=1" : "";
|
|
return (
|
|
<div style={{ position: "relative" }}>
|
|
<button type="button" onClick={() => setOpen((o) => !o)}
|
|
style={{ display: "inline-flex", alignItems: "center", gap: 7, height: 30, padding: "0 11px", borderRadius: "var(--radius-sm)", border: "1px solid var(--border-control)", background: open ? "var(--ctv-surface-3)" : "var(--ctv-surface-2)", color: "var(--text-primary)", cursor: "pointer", font: "var(--weight-medium) var(--text-xs)/1 var(--font-sans)" }}>
|
|
<Ico n="Cast" s={15} color="var(--ctv-accent)" />Connect
|
|
<Ico n="ChevronDown" s={13} color="var(--text-disabled)" />
|
|
</button>
|
|
{open && (
|
|
<React.Fragment>
|
|
<div onClick={() => setOpen(false)} style={{ position: "fixed", inset: 0, zIndex: 40 }} />
|
|
<div style={{ position: "absolute", top: "calc(100% + 8px)", right: 0, zIndex: 41, width: 340, padding: 14, background: "var(--surface-raised)", border: "1px solid var(--border-control)", borderRadius: "var(--radius-md)", boxShadow: "var(--shadow-pop)" }}>
|
|
<div style={{ display: "flex", alignItems: "center", gap: 8, marginBottom: 12 }}>
|
|
<span style={{ font: "var(--weight-semibold) var(--text-sm)/1 var(--font-sans)", color: "var(--text-primary)" }}>Connect a player</span>
|
|
<span style={{ flex: 1 }} />
|
|
<span style={{ font: "var(--text-2xs)/1 var(--font-sans)", color: "var(--text-disabled)" }}>128 channels</span>
|
|
</div>
|
|
<div style={{ display: "flex", flexDirection: "column", gap: 8, marginBottom: 12 }}>
|
|
<EndpointRow icon="ListVideo" label="M3U playlist" url={`chicory.tv/iptv/channels.m3u${q}`} />
|
|
<EndpointRow icon="CalendarClock" label="XMLTV guide" url={`chicory.tv/iptv/xmltv.xml${q}`} />
|
|
</div>
|
|
<label style={{ display: "flex", alignItems: "center", gap: 9, padding: "9px 11px", borderRadius: "var(--radius-sm)", background: "var(--ctv-bg-sunken)", border: "1px solid var(--border-hairline)", cursor: "pointer" }}>
|
|
<input type="checkbox" checked={enabledOnly} onChange={(e) => setEnabledOnly(e.target.checked)} style={{ accentColor: "var(--ctv-accent)" }} />
|
|
<span style={{ flex: 1, font: "var(--text-xs)/1 var(--font-sans)", color: "var(--text-primary)" }}>Only enabled channels</span>
|
|
</label>
|
|
<div style={{ marginTop: 11, display: "flex", alignItems: "center", gap: 7, font: "var(--text-2xs)/1.4 var(--font-sans)", color: "var(--text-disabled)" }}>
|
|
<Ico n="Info" s={13} />Works with any IPTV player — Jellyfin, TiviMate, VLC, Plex.
|
|
</div>
|
|
</div>
|
|
</React.Fragment>
|
|
)}
|
|
</div>
|
|
);
|
|
}
|
|
window.CTVShell = { Sidebar, TopBar };
|
|
})();
|