# rae
`rae` is a renderer-neutral Rust design crate for shader-heavy desktop tools.
It was extracted so multiple codebases can improve the same widget, layout, math, sanitized output, and GLSL shader primitives without coupling themselves to one app shell.
## What It Owns
```text
src/color.rs Palette and RGBA primitives
src/effect.rs Ripple, glow, elevation, focus, and motion primitives
src/hit.rs Hit regions, local coordinates, cursors, and resize handles
src/input.rs Command palette, shortcuts, and text snippets
src/layout.rs Prompt/transcript/sidebar/status layout
src/math.rs CPU-side animation and shader math helpers
src/morph.rs Whole-card topology/morph descriptors and material tokens
src/output.rs Sanitized Markdown/code output rows and code token classes
src/sanitize.rs ANSI/control-safe text helpers and display-width utilities
src/scroll.rs Scroll state, anchoring, range clamping, and visibility helpers
src/shader.rs Heavy GLSL shader catalog with families/descriptors
src/state.rs Minimal pane and overlay identifiers
src/transcript.rs Transcript viewport measurement and scroll materialization
src/theme.rs Built-in visual themes
src/widget.rs Shared widget frame and prompt/transcript models
```
## Use From A Sibling App
```toml
[dependencies]
rae = { path = "../KnottRustDesign", version = "0.1.11" }
```
## Verify
```bash
cargo fmt --all --check
cargo check
cargo test
cargo package --allow-dirty
```
## Publishing Note
The package name is `rae`; publish only after the verification gates pass for the intended version.
## 0.1.1 Focus
`rae` is leaning hard into high-end interaction design:
- Flutter/Material-style ripple pools and click effects.
- Glow, elevation, disabled, focus-ring, hover, selected, and pressed state resolution.
- Motion specs and curves for fast/standard/slow interaction timing.
- Shader descriptors grouped by background, panel, prompt, interaction, code, data, and flow families.
- GLSL effects for curl nebula, aurora curtains, raymarched knot fields, terminal rain, ripples, bloom glows, code lenses, reaction-diffusion cells, Voronoi crystal panels, and plasma graph networks.
## 0.1.2 Direction
`rae` now treats cards and panels as morphable topology surfaces instead of static rectangles:
- `MorphShape`, `CardTopology`, `MorphProfile`, and `MorphState` describe whole-card transitions between rounded cards, capsules, blobs, tickets, notched panels, dock islands, and command lenses.
- `MaterialTokens` packages fill/stroke/glow/shadow/blur/elevation values for glass and elevated surfaces.
- SDF GLSL can morph an entire card silhouette with animated edge waves, blob pressure, notches, capsule pulls, and rim glow.
- Extra shaders cover metaball cards, Google-style aura fields, orbital meshes, glass caustics, and liquid chrome surfaces.
## 0.1.3 Direction
`rae` now ports high-signal ideas from Aisling/`KnottEffects` into renderer-neutral GLSL motifs:
- Blackhole gravity wells, elliptical rings, fireworks, laser etching, scan beams, synth grids, spotlights, swarms, storms, VHS glitches, waves, vortices, cascades, and grid pulses.
- Aisling-style deterministic hash noise and staggered progress/reveal timing are embedded directly in shader code, without coupling `rae` to terminal-frame rendering.
- The shader catalog exposes each effect through the same `ShaderDescriptor` family/complexity metadata used by existing consumers.
## 0.1.4 Examples
`rae` now ships a growing `examples/` suite:
- Shader catalog and Aisling shader gallery examples show how to discover GLSL sources and choose effects for app surfaces.
- Effects, morph, layout, widget, transcript, sanitized output, and theme examples print renderer-neutral snapshots that real renderers can consume.
- `demo_full` combines multiple modules into one shell snapshot without binding `rae` to a renderer or runtime.
Run a rendered desktop example with `cargo run --example demo_layout`, `cargo run --example demo_widgets`, or `cargo run --example demo_render_full`.
The text-only examples are catalog/model snapshots for renderer authors. The rendered examples use `macroquad` as a dev-dependency only; the library itself remains renderer-neutral.
## 0.1.5 Code Output Safety
`rae` now includes out-of-the-box sanitized assistant/code output primitives:
- `sanitize` strips ANSI/OSC escape sequences, replaces unsafe controls, removes zero-width directional formatting, tracks truncation, and computes display width.
- `output` materializes Markdown-like assistant text into renderer-neutral rows for headings, paragraphs, bullets, quotes, fenced code, line-number gutters, code tokens, and copy-safe Markdown.
- `demo_code_output` shows a complete safe rendering pipeline for model output containing Markdown, code fences, comments, strings, numbers, and terminal escape injection attempts.
## 0.1.6 Public Surface Trim
`rae` is intentionally focused on reusable rendering primitives. Application-specific orchestration belongs in consuming apps, not in this public crate.
## 0.1.7 Package Scrub
The crates.io package excludes local implementation memory and only ships reusable widget, layout, sanitization, output, shader, effect, morph, transcript, theme, color, and math modules.
## 0.1.8 Interaction Primitives
`rae` now adds generic desktop interaction helpers while keeping application behavior out of the crate:
- `ScrollState` and `ScrollAnchor` handle viewport item ranges, bottom anchoring, clamping, and minimal `ensure_visible` movement.
- `HitMap`, `HitRegion`, `CursorKind`, and `ResizeHandle` provide renderer-neutral hit testing and resize edge detection.
- `CommandPalette`, `CommandItem`, `Shortcut`, `SnippetSet`, and `TextSnippet` model palette filtering and snippet expansion without runtime execution.
- The default dark palette/theme was renamed to `midnight` so public names are not tied to one desktop app.
## 0.1.9 Rendered Example
`rae` now includes `demo_render_full`, a real graphical example that opens a window and draws the design primitives as pixels:
- Renders `compute_shell_layout` rectangles as desktop panels.
- Uses `rae` GLSL shader sources through a dev-only `macroquad` material loader.
- Shows transcript materialization, command palette filtering, snippet matches, hit-test feedback, and ripple samples.
- Keeps all renderer code in `examples/`, not in the reusable library modules.
## 0.1.10 Rendered Layout And Widgets
`demo_layout` and `demo_widgets` now open real windows instead of printing coordinate/model dumps:
- `demo_layout` draws the live shell layout and responsive desktop/laptop/tablet/phone previews.
- `demo_widgets` renders a full widget frame with panes, prompt model, transcript rows, chips, and sections.
- Both examples support `RAE_RENDER_DEMO_FRAMES=2` for smoke tests and close on `Esc` for manual runs.
## 0.1.11 Rendered Example Polish
The rendered examples now use a shared visual system instead of debug-style rectangles:
- `examples/support` provides glass panels, soft shadows, ambient glows, pills, metrics, wrapped text, and scene backdrops for example renderers.
- `demo_layout` now presents a polished layout lab with live metrics, a scaled shell canvas, responsive breakpoint cards, and pinned prompt/status surfaces.
- `demo_widgets` now presents a widget gallery with transcript cards, section cards, status chips, cursor rendering, and clearer visual hierarchy.
- `demo_render_full` now shares the same glass/chrome language for a more cohesive desktop showcase.