From 7770149392041c5b216137c1b3b995a050eac129 Mon Sep 17 00:00:00 2001
From: Chenyu Li
Date: Mon, 30 Mar 2026 12:43:54 -0700
Subject: [PATCH 1/4] Add virtual chat demo
---
pages/demos/index.html | 5 +
pages/demos/virtual-chat.html | 91 ++++++++
pages/demos/virtual-chat.ts | 402 ++++++++++++++++++++++++++++++++++
3 files changed, 498 insertions(+)
create mode 100644 pages/demos/virtual-chat.html
create mode 100644 pages/demos/virtual-chat.ts
diff --git a/pages/demos/index.html b/pages/demos/index.html
index a15f4efd..3dc6039a 100644
--- a/pages/demos/index.html
+++ b/pages/demos/index.html
@@ -136,6 +136,11 @@ Rich Text
Masonry
A text-card occlusion demo where height prediction comes from Pretext instead of DOM reads.
+
+
+ Virtual Chat
+ 5,000 chat messages virtualized with live DOM vs Pretext measurement cost, toggleable with width and font-size sliders.
+
+
+
+
DOM
+
+
Pretext
+
+
+
+
+ 600px
+
+
+
+
+ 15px
+
+
β
+
+
+
+
diff --git a/pages/demos/virtual-chat.html b/pages/demos/virtual-chat.html
new file mode 100644
index 00000000..7a99c200
--- /dev/null
+++ b/pages/demos/virtual-chat.html
@@ -0,0 +1,91 @@
+
+
+
+
+
+
Virtual Chat β DOM vs Pretext
+
+
+
+