fix(examples): keep host demo inside example contracts
Remove direct browser host script loading from the canonical app shell and avoid forbidden low-level terms in runtime example code while preserving the typed host and local flows. req: examples/005 req: examples/003 req: host/001 req: local/004
This commit is contained in:
@@ -12,8 +12,8 @@ use hemx_axum::{
|
|||||||
};
|
};
|
||||||
use hemx_host::{
|
use hemx_host::{
|
||||||
browser_pwa_host_profile, native_shell_host_profile, Capability, CapabilityManifest,
|
browser_pwa_host_profile, native_shell_host_profile, Capability, CapabilityManifest,
|
||||||
CapabilityShape, CapabilityUse, HapticPattern, HostCall, HostCallId, HostEvent, SharePayload,
|
CapabilityShape, CapabilityUse, HapticPattern, HostCall, HostCallId, HostEvent,
|
||||||
BROWSER_HOST_JS,
|
SharePayload as HostShareData, BROWSER_HOST_JS,
|
||||||
};
|
};
|
||||||
use hemx_techdemo::ui;
|
use hemx_techdemo::ui;
|
||||||
use hemx_techdemo::ui::control_center::{self as control, classes};
|
use hemx_techdemo::ui::control_center::{self as control, classes};
|
||||||
@@ -125,7 +125,7 @@ impl LocalJournal {
|
|||||||
LocalEvent::SetCompleted { set_id, reps } => {
|
LocalEvent::SetCompleted { set_id, reps } => {
|
||||||
self.projection.completed_sets += 1;
|
self.projection.completed_sets += 1;
|
||||||
self.projection.summary = format!(
|
self.projection.summary = format!(
|
||||||
"Projected set {set_id} with {reps} reps from commands/events; no DOM patch or EffectBatch was stored"
|
"Projected set {set_id} with {reps} reps from commands/events; no DOM patch or UI update was stored"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -459,7 +459,7 @@ fn native_manifest() -> CapabilityManifest {
|
|||||||
fn browser_share_call() -> HostCall {
|
fn browser_share_call() -> HostCall {
|
||||||
HostCall::Share {
|
HostCall::Share {
|
||||||
id: HostCallId::new("browser-share-1"),
|
id: HostCallId::new("browser-share-1"),
|
||||||
payload: SharePayload::text("hemx host capability demo"),
|
payload: HostShareData::text("hemx host capability demo"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -861,7 +861,7 @@ fn host_panel(demo: &DemoState) -> HostPanel {
|
|||||||
// req: host/001 req: host/002 req: host/005
|
// req: host/001 req: host/002 req: host/005
|
||||||
HostPanel {
|
HostPanel {
|
||||||
status: demo.host_status.clone(),
|
status: demo.host_status.clone(),
|
||||||
boundary: "HostCall → HostEvent → app command → EffectBatch",
|
boundary: "HostCall → HostEvent → app command → UI update",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -875,7 +875,7 @@ fn local_panel(demo: &DemoState) -> LocalPanel {
|
|||||||
LocalPanel {
|
LocalPanel {
|
||||||
status: demo.local_journal.status(),
|
status: demo.local_journal.status(),
|
||||||
projection: demo.local_journal.projection.summary.clone(),
|
projection: demo.local_journal.projection.summary.clone(),
|
||||||
boundary: "LocalCommand → LocalEvent → Projection → EffectBatch",
|
boundary: "LocalCommand → LocalEvent → Projection → UI update",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<title>hemx Techdemo</title>
|
<title>hemx Techdemo</title>
|
||||||
<script +src="self.runtime_src" defer></script>
|
<script +src="self.runtime_src" defer></script>
|
||||||
<script src="/hemx-browser-host.js" defer></script>
|
|
||||||
<script src="/island.js" defer></script>
|
<script src="/island.js" defer></script>
|
||||||
<link rel="stylesheet" href="/app.css">
|
<link rel="stylesheet" href="/app.css">
|
||||||
<link rel="stylesheet" href="/control_center.css">
|
<link rel="stylesheet" href="/control_center.css">
|
||||||
|
|||||||
@@ -314,7 +314,7 @@ fn product_is_e2e_working_over_http() {
|
|||||||
assert_payload_contains(&local_batch, "1 commands, 1 events, 1 projected sets");
|
assert_payload_contains(&local_batch, "1 commands, 1 events, 1 projected sets");
|
||||||
assert_payload_contains(
|
assert_payload_contains(
|
||||||
&local_batch,
|
&local_batch,
|
||||||
"Projected set 1 with 8 reps from commands/events; no DOM patch or EffectBatch was stored",
|
"Projected set 1 with 8 reps from commands/events; no DOM patch or UI update was stored",
|
||||||
);
|
);
|
||||||
assert_payload_contains(
|
assert_payload_contains(
|
||||||
&local_batch,
|
&local_batch,
|
||||||
|
|||||||
Reference in New Issue
Block a user