Initial public release of Warp.

Repo-Sync-Origin: warpdotdev/warp-internal@12af1d983b
This commit is contained in:
David Stern
2026-04-28 08:43:33 -05:00
commit 0dbd3d567a
4982 changed files with 1431549 additions and 0 deletions
@@ -0,0 +1,3 @@
# Don't include output or screenshot directories from testing.
output/
screenshots/
@@ -0,0 +1,25 @@
# WARP.md
## Visual Sanity Check for Table Example Screenshots
This project can auto-generate screenshots of the table example demos and then sanity check them using computer vision. The goal is to quickly catch apparent rendering bugs (e.g., empty cells, obvious misalignment, missing headers) before committing or opening a PR.
### How to capture images
- Build and run the example with capture flags:
- Baseline (reference images): `../../../../target/debug/examples/table-sample --capture-baseline`
- Current (to compare locally): `../../../../target/debug/examples/table-sample --capture-screenshots`
- Output directories:
- Baseline: `screenshots/baseline/`
- Current: `screenshots/current/`
### Sanity-check protocol (Agent/Agent Mode)
- Use the read_file tool to upload all PNGs in the chosen directory (baseline or current).
- For each image, scan for:
- Completely blank/black/solid-color large areas where UI should be rendered
- Obvious missing headers, rows, or columns
- Clearly misaligned row bands or headers vs. body
- Text clipped mid-line or unreadable due to extreme contrast issues
- Report any images that exhibit the above, with a short note.
Notes:
- This is a quick visual smoke test, not a pixel-perfect comparison.
- If a failure is found, re-run the example for a single demo by navigating with arrow keys or by re-running the full capture and re-checking.
@@ -0,0 +1,95 @@
use anyhow::{anyhow, Result};
use pathfinder_geometry::vector::vec2f;
use std::borrow::Cow;
pub mod root_view;
extern crate warpui;
use rust_embed::RustEmbed;
use warpui::{platform, platform::WindowBounds, AssetProvider};
#[derive(Clone, Copy, RustEmbed)]
#[folder = "examples/assets"]
pub struct Assets;
pub static ASSETS: Assets = Assets;
impl AssetProvider for Assets {
fn get(&self, path: &str) -> Result<Cow<'_, [u8]>> {
<Assets as RustEmbed>::get(path)
.map(|f| f.data)
.ok_or_else(|| anyhow!("no asset exists at path {}", path))
}
}
#[derive(Debug, Clone, Default)]
pub struct CaptureConfig {
pub capture_screenshots: bool,
pub capture_baseline: bool,
}
fn parse_args() -> CaptureConfig {
let args: Vec<String> = std::env::args().collect();
let mut config = CaptureConfig::default();
for arg in args.iter() {
match arg.as_str() {
"--capture-screenshots" => config.capture_screenshots = true,
"--capture-baseline" => {
config.capture_screenshots = true;
config.capture_baseline = true;
}
"--help" | "-h" => {
println!("Table Sample Example - Screenshot Testing");
println!("\nUsage: table-sample [OPTIONS]");
println!("\nOptions:");
println!(" --capture-screenshots Capture screenshots of all demos");
println!(" --capture-baseline Capture and save as baseline screenshots");
println!(" --help, -h Show this help message");
std::process::exit(0);
}
_ => {}
}
}
config
}
fn main() -> Result<()> {
env_logger::builder().format_timestamp_millis().init();
let capture_config = parse_args();
if capture_config.capture_screenshots {
println!("📸 Screenshot capture mode enabled");
if capture_config.capture_baseline {
println!("📁 Baseline mode: screenshots will be saved as reference images");
}
}
let app_builder =
platform::AppBuilder::new(platform::AppCallbacks::default(), Box::new(ASSETS), None);
let _ = app_builder.run(move |ctx| {
root_view::init(ctx);
let window_options = warpui::AddWindowOptions {
window_bounds: WindowBounds::ExactSize(vec2f(1000.0, 800.0)),
window_style: if capture_config.capture_screenshots {
warpui::platform::WindowStyle::NotStealFocus
} else {
warpui::platform::WindowStyle::Normal
},
..Default::default()
};
let config = capture_config.clone();
#[cfg_attr(not(target_os = "macos"), allow(unused_variables))]
let (window_id, _root) = ctx.add_window(window_options, move |view_ctx| {
root_view::RootView::new(view_ctx, config)
});
#[cfg(target_os = "macos")]
if capture_config.capture_screenshots {
// Make it visible for rendering but keep z-index
ctx.windows()
.show_window_and_focus_app_without_ordering_front(window_id);
}
});
Ok(())
}
File diff suppressed because it is too large Load Diff