T25f Generative: data and prompts

DatasetViewer is tables::DataTable with row detail; the gallery pages
through a dataset and opens a sample whole. EmbeddingVisualizer scatters
points by group, flat or turned in three dimensions: lens.rs holds the
projection, where a turned view keeps the unit ball's scale and fits any
point past it at every turn. A drag or the arrow keys spin it, the
pointer names a point, and the legend hides a group. PromptPlayground
gives each {name} of a template a field, marks the blanks, and runs once
every value is in. PromptDiff shows word changes inline, a space parting
a word taken out from the word put in; PromptVersionHistory lists
versions to choose from and restore.

ChartLegend entries that toggle are Tab stops with the focus ring. Each
capture pass starts its page fresh, so dark runs the script from the same
start as light.
This commit is contained in:
ZacharyZhang-NY committed 2026-09-26 14:57:55 -04:00
1 parent 2f859eeb03
commit e3038647c8
16 files changed
+1800 -17

No files matched your search

+11 -2
View File
@@ -21,6 +21,8 @@ pub enum Choice {
pub struct Gallery {
page: usize,
/// Counts fresh starts; the page's state lives under it.
pass: usize,
choice: Choice,
focus: FocusHandle,
scroll: ScrollHandle,
@@ -38,6 +40,7 @@ impl Gallery {
window.focus(&focus);
Self {
page,
pass: 0,
choice: Choice::Light,
focus,
scroll: ScrollHandle::new(),
@@ -52,6 +55,12 @@ impl Gallery {
cx.notify();
}
/// Drops the page's state, so it draws as new.
pub fn fresh(&mut self, cx: &mut Context<Self>) {
self.pass += 1;
cx.notify();
}
/// Viewport height and furthest scroll, in pixels.
pub fn scroll_extent(&self) -> (Pixels, Pixels) {
(
@@ -192,7 +201,7 @@ impl Gallery {
impl Render for Gallery {
fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
let page = &pages::ALL[self.page];
let body = (page.render)(window, cx);
let body = window.with_id(("pass", self.pass), |window| (page.render)(window, cx));
let sidebar = self.sidebar(cx);
let switcher = self.switcher(cx);
let theme = cx.theme();
@@ -208,7 +217,7 @@ impl Render for Gallery {
.text_size(theme.text_size(TextSize::Base))
.child(sidebar)
.child(
on_axis(div().id("page"))
on_axis(div().id(("page", self.pass)))
.flex_1()
.h_full()
.overflow_y_scroll()