feat(yahweh-widget-banner): widget compartido para toasts/errores cross-app

Patrón visual común a yahweh-widget-meta-form (toast success +
error banner) y nakui-explorer (error banner): div con bg + text
colored según severidad. Antes duplicado con colores hardcoded en
cada consumer.

Crate nuevo crates/modules/ui_engine/widgets/banner:
- pub enum Banner { Info, Success, Warning, Error } con bg()/fg()
  hardcoded por variant.
- pub fn banner(kind, message) -> Div: padding/text_size defaults;
  caller compone con .child()/.px()/.on_click()/etc.
- 2 tests sanity (no color collisions).

Migración:
- yahweh-widget-meta-form: 12 líneas hardcoded → 2 llamadas a
  banner().
- nakui-explorer: error banner usa banner() + override de
  padding custom del header.

Tests stack: 109 → 111 (+2). Cada crate compila individualmente.

Próximo natural: confirm_delete_banner (Warning + botones) puede
extraerse como modal-banner cuando emerja segundo consumer.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Sergio
2026-05-10 09:57:32 +00:00
parent 3e4278d766
commit 715cf6be03
9 changed files with 213 additions and 27 deletions
Generated
+9
View File
@@ -6460,6 +6460,7 @@ dependencies = [
"tempfile",
"uuid",
"yahweh-meta-runtime",
"yahweh-widget-banner",
]
[[package]]
@@ -12998,6 +12999,13 @@ dependencies = [
"gpui",
]
[[package]]
name = "yahweh-widget-banner"
version = "0.1.0"
dependencies = [
"gpui",
]
[[package]]
name = "yahweh-widget-container-core"
version = "0.1.0"
@@ -13016,6 +13024,7 @@ dependencies = [
"yahweh-meta-runtime",
"yahweh-meta-schema",
"yahweh-theme",
"yahweh-widget-banner",
"yahweh-widget-text-input",
]