{"record":{"id":"828e2ea2e63a83c8","repo":"emilk/egui","slug":"run-ui-should-only-be-called-with-appkind-ui-or-a","errorCode":null,"errorMessage":"run_ui should only be called with AppKind::Ui or AppKind::UiState","messagePattern":"run_ui should only be called with AppKind::Ui or AppKind::UiState","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/egui_kittest/src/app_kind.rs","lineNumber":67,"sourceCode":"        &mut self,\n        ui: &mut egui::Ui,\n        state: &mut State,\n        sizing_pass: bool,\n    ) -> egui::Response {\n        let mut builder = egui::UiBuilder::new();\n        if sizing_pass {\n            builder.sizing_pass = true;\n        }\n        ui.scope_builder(builder, |ui| {\n            Frame::central_panel(ui.style())\n                // Only set outer margin, so we show no frame for tests with only free-floating windows/popups:\n                .outer_margin(8.0)\n                .inner_margin(0.0)\n                .show(ui, |ui| match self {\n                    AppKind::Ui(f) => f(ui),\n                    AppKind::UiState(f) => f(ui, state),\n                    #[cfg(feature = \"eframe\")]\n                    AppKind::Eframe(_) => unreachable!(\n                        \"run_ui should only be called with AppKind::Ui or AppKind::UiState\"\n                    ),\n                });\n        })\n        .response\n    }\n}\n","sourceCodeStart":49,"sourceCodeEnd":75,"githubUrl":"https://github.com/emilk/egui/blob/b9a0723d88dee87ba0965470b554a6efdab1d0bb/crates/egui_kittest/src/app_kind.rs#L49-L75","documentation":"Error \"run_ui should only be called with AppKind::Ui or AppKind::UiState\" thrown in emilk/egui.","triggerScenarios":"Thrown at crates/egui_kittest/src/app_kind.rs:67 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Call run_ui only on a Harness created with AppKind::Ui or AppKind::UiState; for other app kinds use the appropriate run method."],"exampleFix":"let mut harness = Harness::new_ui(|ui| { ui.label(\"hi\"); }); harness.run_ui(|ctx| {});","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b9a0723d88dee87ba0965470b554a6efdab1d0bb","analyzedAt":"2026-08-19T12:39:57.743Z","contentChangedAt":"2026-08-19T12:39:57.743Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}