From f0440d647a4c24477da752528f862badeb43f818 Mon Sep 17 00:00:00 2001 From: dev Date: Tue, 26 May 2026 20:00:33 +0200 Subject: [PATCH] docs(dialog-demo): update prose for polymorphic close MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The dialog demo prose described "Six events" with the per-event close-* shape that was collapsed into a single polymorphic close in commit 9f5fbfdb. Three updates: - Header lede: "Eight parts; six events" → "Eight parts; two events (open + polymorphic close)" with the polymorphism rationale. - morfo tab section: explains the imperative data-last-action + per-cause semantic pattern instead of the old per-event prewrite story. - sema tab section: describes how dismissWith() swaps the family at trigger time per cause. - Keyboard hint: "Close (close-dismiss)" → "Close (close with data-last-action='dismissed')" to match runtime behaviour. The compiled events table at the bottom of the morfo tab auto-derives from the morfo, so it already shows the correct collapsed event list without modification. Co-Authored-By: Claude Opus 4.7 (1M context) --- web/routes/uix/components/dialog/+page.svelte | 50 ++++++++++++------- 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/web/routes/uix/components/dialog/+page.svelte b/web/routes/uix/components/dialog/+page.svelte index 667913359..43ee1508d 100644 --- a/web/routes/uix/components/dialog/+page.svelte +++ b/web/routes/uix/components/dialog/+page.svelte @@ -148,10 +148,17 @@
Overlays · Dialog

Dialog

- Modal blocking surface. Eight parts; six events with the full - asymmetric exit set (saved · cancelled · dismissed · dismissed-outside - · failed) surfaced via data-last-action. Modal subset of - intent — only neutral / risk / + Modal blocking surface. Eight parts; two events + (open + a polymorphic close) with the + full asymmetric exit set (saved · cancelled · dismissed · + dismissed-outside · failed) surfaced via + data-last-action. The provider concretes the + close event's family at trigger time — + emerge.close (cancel / dismiss / dismiss-outside), + commit.save + fulfill (save) or + signal.alert + threat (fail) — per book §5.3 + polymorphism. Modal subset of intent — only + neutral / risk / threat; affirm / fulfill / loss are intentionally off the table per the modal canon.

@@ -455,12 +462,16 @@ · declarative contract

- Source: src/uix/morfo/components/dialog.ts. Six - events surface five distinct exit reasons via - data-last-action prewrites. open is intent-bound; - close-cancel / close-dismiss / close-dismiss-outside drop the - intent (backing out has no evaluative load); close-after-fail - explicitly carries threat regardless of provider intent. + Source: src/uix/morfo/components/dialog.ts. Two + events — open (intent-bound via fromProp) and + a polymorphic close (book §5.3) with + allowedFamilies: ['emerge', 'commit', 'signal']. + The provider sets data-last-action imperatively + before each close and passes the concrete semantic per cause: + cancel / dismiss / dismiss-outside fire as plain emerge + (backing out has no evaluative load); save fires as + commit.save + fulfill; fail fires as signal.alert + threat + regardless of provider intent.

@@ -588,14 +599,17 @@ · events + perceptual signature

- Six events. open is fromProp-bound to the + Two events. open is fromProp-bound to the provider's intent — a threat dialog opens with - threat-flavoured perceptual weight. close-save consummates as - fulfill (the user committed). close-cancel / - close-dismiss-* drop intent (no evaluative load on backing - out). close-after-fail explicitly hits threat regardless of - provider intent. Click play to fire on the - live dialog. + threat-flavoured perceptual weight. close is + polymorphic (book §5.3) — the table shows its declared + default family (emerge); the runtime swaps the + family per cause via opts.semantic in + dismissWith(): save → commit.save + fulfill; + cancel / dismiss / dismiss-outside → emerge.close (no + evaluative load on backing out); fail → signal.alert + + threat regardless of provider intent. Click + play to fire on the live dialog.

@@ -671,7 +685,7 @@ KeyAction Enter / SpaceOpen from Trigger. - EscapeClose (close-dismiss). + EscapeClose (close with data-last-action='dismissed'). Tab / Shift+TabCycle focus inside Content.