Skip to main content

Crate kitchen_ui

Crate kitchen_ui 

Source
Expand description

The neuro-kitchen apps’ shared UI (GPUI through gpui-kit).

  • theme: design tokens (spacing, type, radii, pane gaps), the shared grey neutrals, the app’s accent theme::Palette or the user’s own (theme::Rgb), light and dark; theme::apply hands them to gpui-kit.
  • widgets: accent picker, section, labelled row, slider, dropdown, stepper, dragged number, swatch, empty state, icon button; code view (highlighting, errors), diff view (text or JSON, Accept / Reject per hunk), text view (light markdown).
  • diff: the line diffs the diff view shows, as plain data.
  • chat: the agent chat pane (conversation and prompt; the app supplies the agent).
  • param_editor: the parameters of any op that serializes to JSON, editable.
  • timeline: an episodic memory of the work: what the person and the agent did over time, summarised into a few episodes, with the provenance of each action.
  • icons: what an app ships (its icon set and files) and the test that every icon its code names is shipped.

Start-up: gpui_kit::init(cx), then theme::use_look(Look::new(MY_PALETTE), cx); open windows with gpui_kit::open_window. cargo run -p kitchen-ui --example gallery shows every widget.

Re-exports§

pub use param_editor::Commit;
pub use param_editor::ParamEditor;
pub use param_editor::Params;
pub use theme::Look;
pub use theme::Palette;
pub use theme::Rgb;

Modules§

chat
The agent chat as a view an app can dock: the conversation (the user’s prompts, the agent’s replies, its tool calls) and a prompt box. No network or model code: the pane emits ChatEvents and the app pushes messages in. The conversation is plain data (ChatMessage, serializable) so an app can record it (a session file) and restore it.
diff
Line diffs of two texts, git style, for crate::widgets::DiffView: added and removed lines with their old and new line numbers, grouped into hunks with a few unchanged lines of context around each change; the unchanged runs between hunks fold away.
icons
Icons: what an app ships (AppAssets: gpui-kit’s component icons, the few Lucide icons the app adds, and its own files), and the check that every icon its code names is shipped (assert_icons_bundled): an icon missing from the assets draws nothing and logs an error.
param_editor
The parameters of one op, editable: numbers as inputs (Enter or leaving the field applies them), a short list of numbers as one input each, choices as menus, switches as checkboxes. It works on any op that serializes to a JSON object (Params): lumen’s ops, dsp-kitchen’s pipeline nodes. Whoever owns the op decides how a change is applied (a Commit: a project or session command), so a side panel and a pipeline inspector can share it.
theme
Design tokens shared by the neuro-kitchen apps, and their application to gpui-kit’s theme, so every gpui-kit component (buttons, menus, inputs, tooltips) and the apps’ own layout use one set of values.
timeline
An episodic memory of the work: what the person and the agent did, over time, as a story one can read back (after Scott Jenson’s “Episodic Memory” prototype). It shows attention, not content: which kind of work, when, for how long and how busily.
widgets
Small pieces both apps use: an accent picker, a titled section, a labelled row, a slider, a dropdown of fixed options, a stepper and a dragged number, a colour swatch, a centred empty state, an icon button; and the text views: code (CodeView), diffs (DiffView) and light markdown (TextView). Plain data in, no store; colours from the current look (crate::theme::color).