Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix([warning-banner-component]): add align prop, drop API docstring, document visual unifications

[._.]/ Adam Eivye92058a7b0a5
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 69062a33dd..16df99a8c2 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -4,7 +4,7 @@
- **[patch-settings-slice-helper] Nested settings edits no longer risk clobbering sibling fields.** Saving a Python path from Video Gen, or an image-gen config from a pipeline / Writers Room stage, used to round-trip the entire current settings object — leaving unrelated top-level keys exposed to drift if the read raced a concurrent write elsewhere. These edits now scope themselves to the slice being changed.
- **[client-use-previous-hook] Shared `usePrevious` hook.** Internal refactor: collapses two ad-hoc previous-render comparisons into one shared hook. No user-visible behavior change.
-- **[warning-banner-component] Shared `Banner` component.** Internal refactor: introduces a tone-variant Banner primitive and replaces five hand-rolled warning banners (LoRA manager, Security audio prompt, scheduled-runs paused / improvement-disabled callouts, local Python arch / externally-managed notices, CoS memory-backend status). No user-visible change.
+- **[warning-banner-component] Shared `Banner` component.** Internal refactor: introduces a tone-variant Banner primitive and replaces five hand-rolled warning banners (LoRA manager, Security audio prompt, scheduled-runs paused / improvement-disabled callouts, local Python arch / externally-managed notices, CoS memory-backend status). Two of those banners pick up a minor visual unification — the LoRA download message body now uses the standard warning amber instead of a cream variant, and the local Python notices gain a few pixels of horizontal padding to match the rest of the warning banner family.
## Added
diff --git a/client/src/components/cos/tabs/ScheduleTab.jsx b/client/src/components/cos/tabs/ScheduleTab.jsx
index 3960d68172..69f793a5cf 100644
--- a/client/src/components/cos/tabs/ScheduleTab.jsx
+++ b/client/src/components/cos/tabs/ScheduleTab.jsx
@@ -382,7 +382,7 @@ function GlobalConfigControls({ taskType, config, onUpdate, onTrigger, onReset,
/>
</div>
{isPaused && (
- <Banner icon={AlertCircle} className="items-center">
+ <Banner icon={AlertCircle} align="center">
All scheduled runs are paused for this task
</Banner>
)}
diff --git a/client/src/components/ui/Banner.jsx b/client/src/components/ui/Banner.jsx
index f8e570bff8..f925f7b2c3 100644
--- a/client/src/components/ui/Banner.jsx
+++ b/client/src/components/ui/Banner.jsx
@@ -1,23 +1,3 @@
-// Shared semantic-tone banner primitive. Replaces the hand-rolled
-// `<div className="bg-port-warning/10 border border-port-warning/30 rounded p-2 …">`
-// (and matching success/error/info variants) that were copy-pasted across the
-// client.
-//
-// Knobs map to real call-site shapes — nothing speculative:
-// tone — semantic color trio (text + bg-tint + border). `warning` is the
-// default since that's the dominant in-repo usage.
-// icon — optional leading lucide glyph component (e.g. `AlertTriangle`).
-// size — `sm` (px-3 py-2 / text-xs, dense — default), `md` (px-4 py-3 /
-// text-sm), or `lg` (p-4 / text-sm). Icon scales with size.
-// title — optional bold first line. Body styling is left to children so
-// callers can mix tone-muted, gray-400 sub-text, links, etc.
-// actions — optional right-side slot (e.g. a button) — sits on the same row
-// as the icon + title block.
-// className — passthrough for layout tweaks (e.g. `mb-6`); merged after the
-// tone classes so callers can override defaults if needed.
-//
-// Any extra props pass through to the wrapping `<div>`.
-
// Each tone pre-composes every full class name it needs — Tailwind's JIT
// scans for complete tokens, so `${t.text}/30` would NOT generate the
// `border-port-warning/30` utility. Spell it out.
@@ -46,10 +26,19 @@ const SIZES = {
lg: { padding: 'p-4', text: 'text-sm', iconSize: 20, gap: 'gap-3' },
};
+// `align` must be an explicit prop, not a className override — Tailwind
+// resolves duplicate `items-*` utilities by CSS source order, not class-string
+// order, so a future Tailwind upgrade could silently flip the winner.
+const ALIGNMENTS = {
+ start: 'items-start',
+ center: 'items-center',
+};
+
export default function Banner({
tone = 'warning',
icon: Icon,
size = 'sm',
+ align = 'start',
title,
actions,
className = '',
@@ -58,18 +47,20 @@ export default function Banner({
}) {
const t = TONES[tone] || TONES.warning;
const s = SIZES[size] || SIZES.sm;
-
- // Border-radius scales with size — small banners use `rounded`, larger ones
- // use `rounded-lg` to match the surrounding call sites in the repo.
+ const alignClass = ALIGNMENTS[align] || ALIGNMENTS.start;
const radius = size === 'lg' || size === 'md' ? 'rounded-lg' : 'rounded';
+ // Nudge the icon down half a row to sit on the text baseline when the
+ // wrapper is top-aligned. For center-aligned banners the icon is already
+ // visually centered by flex, so the nudge becomes a noticeable mis-align.
+ const iconNudge = align === 'start' ? 'mt-0.5' : '';
return (
<div
- className={`${s.padding} ${s.text} border ${radius} ${t.wrapper} flex items-start ${s.gap} ${className}`.trim()}
+ className={`${s.padding} ${s.text} border ${radius} ${t.wrapper} flex ${alignClass} ${s.gap} ${className}`.trim()}
{...rest}
>
{Icon ? (
- <Icon size={s.iconSize} className={`shrink-0 mt-0.5 ${t.iconColor}`} />
+ <Icon size={s.iconSize} className={`shrink-0 ${iconNudge} ${t.iconColor}`.trim()} />
) : null}
<div className="flex-1 min-w-0">
{title ? <div className="font-medium">{title}</div> : null}
diff --git a/client/src/components/ui/Banner.test.jsx b/client/src/components/ui/Banner.test.jsx
index f41be54052..bc0ee5ed14 100644
--- a/client/src/components/ui/Banner.test.jsx
+++ b/client/src/components/ui/Banner.test.jsx
@@ -59,4 +59,21 @@ describe('Banner', () => {
expect(wrapper.className).toContain('mb-6');
expect(wrapper.className).toContain('custom-flag');
});
+
+ it('defaults to items-start alignment and drops the icon nudge at center', () => {
+ const { container, rerender } = render(<Banner icon={AlertTriangle}>x</Banner>);
+ let wrapper = container.querySelector('div.flex');
+ expect(wrapper.className.split(/\s+/)).toContain('items-start');
+ let svg = container.querySelector('svg');
+ expect(svg.getAttribute('class')).toContain('mt-0.5');
+
+ rerender(<Banner align="center" icon={AlertTriangle}>x</Banner>);
+ wrapper = container.querySelector('div.flex');
+ expect(wrapper.className.split(/\s+/)).toContain('items-center');
+ // Tailwind resolves duplicate items-* by CSS source order, so the
+ // component must emit exactly one — no items-start leaking through.
+ expect(wrapper.className.split(/\s+/)).not.toContain('items-start');
+ svg = container.querySelector('svg');
+ expect(svg.getAttribute('class')).not.toContain('mt-0.5');
+ });
});
diff --git a/client/src/pages/Security.jsx b/client/src/pages/Security.jsx
index 2301b8f19d..170f4509f7 100644
--- a/client/src/pages/Security.jsx
+++ b/client/src/pages/Security.jsx
@@ -279,9 +279,10 @@ export default function Security() {
{audioNeedsInteraction && streaming && audioEnabled && (
<Banner
size="lg"
+ align="center"
icon={Volume2}
title="Audio requires interaction"
- className="mb-6 items-center"
+ className="mb-6"
actions={
<button
onClick={enableAudio}