feat(yahweh-widget-card): container card-shape compartido para timeline entries

Iter 3 de integración nakui↔yahweh. El card visual pattern (padding
consistente + rounded + flex_col + gap) que vivía duplicado en cada
timeline entry de nakui-explorer ahora es un widget yahweh reusable.

crates/modules/ui_engine/widgets/card/:
- pub fn card() -> Div: flex_col + px(12) + py(8) + mb(4) +
  rounded(4) + gap(2). Sin colores (caller decide via builder).
- 1 test smoke.

nakui-explorer:
- Los 2 timeline entry patterns (Seed/Morphism) pasan de ~7
  calls a ~3, intención "card with accent" emerge del nombre.

Tests stack: 111 → 112. App-agnostic — el widget no impone paleta,
permite themes diversos.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Sergio
2026-05-10 10:02:23 +00:00
parent 715cf6be03
commit 1be7bf9b1e
7 changed files with 133 additions and 16 deletions
+1
View File
@@ -9,6 +9,7 @@ description = "Explorador GPUI del event log de Nakui: timeline de seeds + morph
nakui-core = { path = "../../modules/nakui/core" }
yahweh-meta-runtime = { path = "../../modules/ui_engine/libs/meta-runtime" }
yahweh-widget-banner = { path = "../../modules/ui_engine/widgets/banner" }
yahweh-widget-card = { path = "../../modules/ui_engine/widgets/card" }
gpui = { workspace = true }
serde_json = { workspace = true }
uuid = { workspace = true, features = ["serde"] }
+3 -16
View File
@@ -32,6 +32,7 @@ use gpui::{
use nakui_core::event_log::{EventLog, LogEntry};
use yahweh_meta_runtime::{preview_value, short_hash, short_uuid};
use yahweh_widget_banner::{banner, Banner};
use yahweh_widget_card::card;
const REFRESH_INTERVAL: Duration = Duration::from_secs(2);
@@ -224,17 +225,10 @@ impl Render for Explorer {
.as_ref()
.map(|h| format!("schema={}", short_hash(h)))
.unwrap_or_else(|| "schema=(legacy)".into());
div()
.flex()
.flex_col()
.px(px(12.))
.py(px(8.))
.mb(px(4.))
card()
.bg(card_bg)
.rounded(px(4.))
.border_l_4()
.border_color(accent_seed)
.gap(px(2.))
.child(
div()
.flex()
@@ -297,17 +291,10 @@ impl Render for Explorer {
.as_ref()
.map(|h| format!("schema={}", short_hash(h)))
.unwrap_or_else(|| "schema=(legacy)".into());
div()
.flex()
.flex_col()
.px(px(12.))
.py(px(8.))
.mb(px(4.))
card()
.bg(card_bg)
.rounded(px(4.))
.border_l_4()
.border_color(accent_morphism)
.gap(px(2.))
.child(
div()
.flex()