forked from 1b-agent/fieldcraft-upstream
UI: command replies read as one line, the whole reply in the context panel
Commands run from the UI whose reply had no `summary` printed their raw JSON into the status bar (Check Model, Step Table, Model Info, Bodies, Find Contacts, the solve steps...). The status bar now gets one sentence for every reply, and a reply with more to it opens in the context panel: Check Model as its diagnostics with severity marks and a button to each fix, the Step Table as a grid of loads and BCs against steps, any other reply as labelled rows and tables. Check Model and the Step Table follow the model as it changes. Programmatic replies stay JSON. Fixes #217 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UhhZMBTviDQxZvwnyP89fo
This commit is contained in:
1 parent
f89545a66a
commit
a84a8339ae
3 files changed
+455
-6
No files matched your search
@@ -16,7 +16,7 @@ pub const WIDTH: f32 = 310.0;
|
||||
|
||||
/// Whether the panel has anything to show.
|
||||
pub fn has_context(app: &mut ModelApp) -> bool {
|
||||
app.dialog.is_some() || app.selected.is_some() || app.plot().is_some()
|
||||
app.dialog.is_some() || app.selected.is_some() || app.reply.is_some() || app.plot().is_some()
|
||||
}
|
||||
|
||||
pub fn panel(app: &mut ModelApp, ui: &mut egui::Ui) {
|
||||
@@ -51,6 +51,10 @@ pub fn panel(app: &mut ModelApp, ui: &mut egui::Ui) {
|
||||
}
|
||||
ui.add_space(10.0);
|
||||
}
|
||||
if app.reply.is_some() {
|
||||
crate::reply::show(app, ui, &t);
|
||||
ui.add_space(10.0);
|
||||
}
|
||||
if let Some((kind, name)) = app.selected.clone() {
|
||||
properties(app, ui, &t, kind, &name);
|
||||
}
|
||||
@@ -231,7 +235,7 @@ fn properties(app: &mut ModelApp, ui: &mut egui::Ui, t: &Tokens, kind: Def, name
|
||||
|
||||
/// A field's value as short text: numbers and strings as they are, long lists as their length
|
||||
/// and first items, other lists and objects as compact JSON (long ones shortened).
|
||||
fn value_text(v: &Value) -> String {
|
||||
pub(crate) fn value_text(v: &Value) -> String {
|
||||
const MAX: usize = 160;
|
||||
/// Lists longer than this show their length and first items.
|
||||
const LIST: usize = 12;
|
||||
|
||||
Reference in new issue
Block a user