Skip to main content

Crate kitchen_shell

Crate kitchen_shell 

Source
Expand description

The frame the neuro-kitchen apps share. An app registers what it can do; the shell draws it the same way everywhere.

  • command: one list of commands (command::CommandSpec in a command::Registry) that becomes the menus, the search, the key bindings and an agent’s tools.
  • search: the search over the registry (Ctrl+K).
  • frame: the frame (frame::Shell): title bar (general menus, the app’s views, the shared workspaces), menu row, status bar with jobs and meters, Settings, search; it adapts to the window’s width.
  • jobs: what runs in the background, with progress and cancel.
  • keys: keybindings.toml, the keys the user gives the commands.
  • activity: what happened, for the timeline: every command run (who, how, with what), time in each workspace, jobs, what steps produced.
  • [env]: a project’s environments for its scripts: the Python venv (made and synced by uv from pyproject.toml and uv.lock) and the Rust workspace and toolchain pin.
  • changes: the Changes panel: watched project files as diffs against a baseline, an agent’s proposed change reviewed hunk by hunk.
  • picker and picker_view: the file picker File → Open… brings up: the folder model (tested without a window) and its popup.
  • container: the view container: a dock of views, “Add view or container”, arrangements, the buttons in a view’s tab.

cargo run -p kitchen-shell --example shell-gallery shows each piece.

Re-exports§

pub use changes::ChangesEvent;
pub use changes::ChangesPanel;
pub use command::CommandSpec;
pub use command::MenuItem;
pub use command::MenuProvider;
pub use command::MenuSpec;
pub use command::Registry;
pub use command::RunCommand;
pub use frame::OpenSpec;
pub use frame::Placement;
pub use frame::RemoteSpec;
pub use frame::SettingsSection;
pub use frame::Shell;
pub use frame::ShellEvent;
pub use frame::ShellSpec;
pub use frame::StatusItems;
pub use frame::TitleFit;
pub use frame::WorkspaceSpec;
pub use frame::fit;
pub use frame::frame_rounded;
pub use frame::resize_edge;
pub use picker::FileKind;
pub use picker::Picker;
pub use picker_view::FilePickerView;
pub use picker_view::PickerEvent;
pub use search::Search;
pub use search::SearchEvent;

Modules§

activity
What happened in the app, drawn: kitchen-services’ activity log (kitchen_services::activity) as kitchen-ui’s Timeline. The log itself (commands, focus, jobs, what was produced) is the runtime’s; this module re-exports it, so the registry and the frame record into it as before, and adds the views: view follows the whole log, view_of what a filter keeps.
changes
The Changes panel: the files that say what a project is and how its analysis was done (session.json, pipeline.json, project.json), watched, and what changed in them shown as git-style diffs (kitchen-ui’s DiffView): added lines green, removed red, compared by key (reordered keys are not changes) with long arrays as one summary line (cells: 2,539 → 2,712).
command
What an app can do, declared once: each CommandSpec has an id, a title, an icon, a line saying what it does, a group, a key, the JSON Schema of its arguments, when it is enabled (and why not), and the function that runs it. The Registry turns that one list into the menus (Registry::menu_button), the search rows (crate::search), the key bindings (Registry::bind_keys) and an agent’s tools (kitchen-chat), so none drifts from the others: a command is in the search because it is in the list, greyed with its reason wherever it cannot run.
container
The view container, now kitchen-views’ (re-exported: apps keep kitchen_shell::container). One container for every workspace’s views (lumen’s planes, tables and plots; dsp-kitchen’s traces and rasters): a dock whose views are tabs dragged into splits, the “Add view or container” dialog (after Rerun’s: arrange every view, or add one), and the buttons in a view’s tab. A workspace only lists its view kinds (ViewOption) with their flags: whether each can be added now (and why not), which one a view shows.
env
Jobs, environments and people: kitchen-services’, drawn by the frame and its Settings. A project’s environments for its scripts: what Python runs them, with which packages, and which Rust toolchain builds them. The project folder holds them, so a project (and a pipeline built in it) runs the same on another computer:
frame
The frame every app shares (Shell): an app hands it its registry, its workspaces, its menus and its Settings sections (ShellSpec), and the frame draws them the same way in every app (Design System, “The frame”):
jobs
Jobs, environments and people: kitchen-services’, drawn by the frame and its Settings. What runs in the background, in one place (from lumen’s job registry): each job has a kind (histology, model, export…), a name saying what it is doing, how far it is, and a cancel flag. Only one job that drives the GPU runs at a time (a second is refused, saying what runs). The status bar lists them with a cancel button each; the work itself (off the UI thread) updates its job through its JobHandle, which ends the job when dropped (finished, failed or cancelled alike).
keys
Key bindings the user edits: keybindings.toml in the app’s configuration folder, a key or a list of keys per command, in sections ([commands] for the registry’s commands, and one per part of an app that binds its own keys, as a plot’s [plot]). Read once at start (load_keybindings); each section is resolved against its defaults (resolve); a missing file is written with every default (write_default_keybindings) so the user sees what can be changed. A key that cannot be read keeps its default and is named in a notice (take_notices).
people
Jobs, environments and people: kitchen-services’, drawn by the frame and its Settings. Who works in the app: people (a name, and optionally an affiliation and an ORCID iD), the one working now, or a guest. What a person does is recorded under their name (the activity log, an app’s own records such as a curation log), so the name may end up in files that are shared: a guest leaves no name (guest).
people_view
The frame’s People: the Settings section that adds, picks and removes people, and what the title bar’s person button lists (menu_items). See crate::people.
picker
The file picker’s model: one folder at a time, what is in it, and what the app can open there. No window: crate::picker_view::FilePickerView draws it, and the tests drive it directly.
picker_view
The file picker’s popup (FilePickerView), over the frame when File → Open… runs. It draws crate::picker::Picker:
plugins_view
The plugin manager’s Settings page: every plugin found, its version, licence, capabilities, whether its runtime is ready and the room it takes; install one from a file, refresh, remove one (with what it downloaded). Discovery and installs run off the UI thread. An app shows the page as a section of its Settings (kitchen-shell’s SettingsSection).
search
The search (Ctrl+K, F3; as Spotlight or Blender’s F3): every registered command by name, filtered as you type, under its group: an icon tile, the title, a line saying what it does, its key at the right. A command that cannot run now stays listed, greyed, with the reason in place of its line. ↑ ↓ move between the commands that can run, Enter runs the highlighted one, a click runs any, Escape or a click outside closes.

Structs§

AddViewDialog
“Add view or container”: the arrangements, then the workspace’s views; ↑ ↓ move between the rows that can run, Enter runs one, Esc or a click outside closes.
ViewOption
A kind of view a container offers.

Enums§

Arrangement
How the views are laid out together.
Baseline
What the watched files are compared against.
DialogEvent
What the dialog asks for.