Record the command, device and first relevant error yourself. The app never claims to have inspected the SDK, installed a package or fixed the toolchain. Its preview and native shell run the same Compose form; the note is retained for this session and is not uploaded or persisted.
Keep the generated src/main.rs. These focused modules replace only the scratch app's screen, translations and shell setup:
{"id":"fission-tabs-1","tabs":[{"index":0,"label":"src/app.rs","value":"src-app-rs"},{"index":1,"label":"src/lib.rs","value":"src-lib-rs"},{"index":2,"label":"src/translations.rs","value":"src-translations-rs"},{"index":3,"label":"i18n/en-US.yaml","value":"i18n-en-us-yaml"},{"index":4,"label":"i18n/es-ES.yaml","value":"i18n-es-es-yaml"},{"index":5,"label":"preview/lib.rs","value":"preview-lib-rs"}]}
{"id":"fission-tabs-1","index":0,"label":"src/app.rs","value":"src-app-rs"}
use fission::prelude::*;
fission_component! {
pub DiagnosticNote<()> {
state {
command: String = String::new(),
device: String = String::new(),
first_error: String = String::new(),
reviewed: bool = false,
}
}
view(note, _state, cx) {
let tokens = &cx.view.env().theme.tokens;
let complete = !note.command.trim().is_empty() && !note.first_error.trim().is_empty();
let summary = cx.tr("diagnostic.summary")
.replace("{command}", ¬e.command)
.replace("{device}", ¬e.device)
.replace("{error}", ¬e.first_error);
} =>
Container(SafeArea(child: Scroll(child:
Container(Column(gap: tokens.spacing.m, children: [
Text(cx.tr("diagnostic.title")).size(tokens.typography.heading1_size),
Text(cx.tr("diagnostic.scope")).color(tokens.colors.text_secondary),
TextInput(
label: Some(cx.tr("diagnostic.command").into()),
bind: note.command,
required: true,
semantics_identifier: "diagnostic.command".to_string(),
),
TextInput(
label: Some(cx.tr("diagnostic.device").into()),
bind: note.device,
semantics_identifier: "diagnostic.device".to_string(),
),
TextInput(
label: Some(cx.tr("diagnostic.error").into()),
bind: note.first_error,
required: true,
multiline: true,
semantics_identifier: "diagnostic.error".to_string(),
),
Button(
child: Text(cx.tr("diagnostic.review")),
key: "review-diagnostic-note",
on_press: reduce { note.reviewed = true; },
).semantics_identifier("diagnostic.review"),
if note.reviewed {
if complete { Code(text: summary) }
else { Text(cx.tr("diagnostic.invalid")).color(tokens.colors.error) }
},
]))
.padding_all(tokens.spacing.l)
.width_length(Length::percent(100.0))
.max_width(760.0),
)))
.height_length(Length::vh(100.0))
}
{"id":"fission-tabs-1","index":1,"label":"src/lib.rs","value":"src-lib-rs"}
pub mod app;
mod translations;
use app::DiagnosticNote;
use fission::prelude::*;
#[cfg(not(any(target_arch = "wasm32", target_os = "android", target_os = "ios")))]
pub fn run_desktop() -> anyhow::Result<()> {
DesktopApp::<(), _>::new(DiagnosticNote::new())
.with_env(translations::create_env())
.run()
}
#[cfg(any(target_os = "android", target_os = "ios"))]
fn mobile_app() -> MobileApp<(), DiagnosticNote> {
let app = MobileApp::<(), _>::new(DiagnosticNote::new())
.with_env(translations::create_env());
#[cfg(all(target_os = "android", debug_assertions))]
let app = app.with_test_control_port(48761);
app
}
#[cfg(any(target_os = "android", target_os = "ios"))]
pub fn run_mobile() -> anyhow::Result<()> { mobile_app().run() }
#[cfg(target_os = "android")]
#[no_mangle]
fn android_main(app_handle: AndroidApp) {
let _ = mobile_app().run_with_android_app(app_handle);
}
#[cfg(target_arch = "wasm32")]
#[wasm_bindgen::prelude::wasm_bindgen(start)]
pub fn run_web() -> Result<(), wasm_bindgen::JsValue> {
console_error_panic_hook::set_once();
WebApp::<(), _>::new(DiagnosticNote::new())
.with_env(translations::create_env())
.run()
.map_err(|error| wasm_bindgen::JsValue::from_str(&error.to_string()))
}
{"id":"fission-tabs-1","index":2,"label":"src/translations.rs","value":"src-translations-rs"}
use std::collections::HashMap;
use fission::prelude::*;
pub fn create_env() -> Env {
let mut env = Env::default();
env.locale = Locale::from("en-US");
for (locale, source) in [
("en-US", include_str!("../i18n/en-US.yaml")),
("es-ES", include_str!("../i18n/es-ES.yaml")),
] {
let messages: HashMap<String, String> =
serde_yaml::from_str(source).expect("valid checked-in translations");
env.i18n.add_bundle(TranslationBundle { locale: Locale::from(locale), messages });
}
env
}
{"id":"fission-tabs-1","index":3,"label":"i18n/en-US.yaml","value":"i18n-en-us-yaml"}
diagnostic.title: "Record the first failure"
diagnostic.scope: "This note does not run commands or inspect your computer. It stays in memory for this session."
diagnostic.command: "Exact failing command"
diagnostic.device: "Device ID, if relevant"
diagnostic.error: "First relevant error and its context"
diagnostic.review: "Review diagnostic note"
diagnostic.invalid: "Enter the command and first error before reviewing the note."
diagnostic.summary: "Command: {command}\nDevice: {device}\nFirst error:\n{error}"
{"id":"fission-tabs-1","index":4,"label":"i18n/es-ES.yaml","value":"i18n-es-es-yaml"}
diagnostic.title: "Registrar el primer fallo"
diagnostic.scope: "Esta nota no ejecuta comandos ni inspecciona tu equipo. Solo se conserva en memoria durante esta sesión."
diagnostic.command: "Comando exacto que falla"
diagnostic.device: "Identificador del dispositivo, si corresponde"
diagnostic.error: "Primer error relevante y su contexto"
diagnostic.review: "Revisar la nota de diagnóstico"
diagnostic.invalid: "Introduce el comando y el primer error antes de revisar la nota."
diagnostic.summary: "Comando: {command}\nDispositivo: {device}\nPrimer error:\n{error}"
{"id":"fission-tabs-1","index":5,"label":"preview/lib.rs","value":"preview-lib-rs"}
mod app;
mod translations;
use fission::prelude::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen(start)]
pub fn run() -> Result<(), JsValue> {
console_error_panic_hook::set_once();
WebApp::<(), _>::new(app::DiagnosticNote::new())
.with_env(translations::create_env())
.mount("#fission-web-mount")
.run()
.map_err(|error| JsValue::from_str(&error.to_string()))
}
{"id":"fission-tabs-1"}