forked from 1b-agent/fieldcraft-upstream
ui: name a sample's document after it until saved (#334); "Solve cancelled"
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01UhhZMBTviDQxZvwnyP89fo
This commit is contained in:
1 parent
8819ff787c
commit
b65f1696b2
3 files changed
+12
-3
No files matched your search
@@ -106,6 +106,7 @@ fn open_sample(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
// A sample just opened has nothing to save: it opens again the same way.
|
||||
opened.saved_revision = Some(opened.revision);
|
||||
opened.saved_view = opened.view.clone();
|
||||
opened.sample = Some(sample.label);
|
||||
s.replace_with(opened);
|
||||
let mut reply = summary(s, &[]);
|
||||
reply["sample"] = json!(sample.name);
|
||||
|
||||
@@ -224,6 +224,9 @@ pub struct Session {
|
||||
pub journal: Vec<(String, Value)>,
|
||||
/// The `.fieldcraft` file the session was opened from or last saved to.
|
||||
pub path: Option<String>,
|
||||
/// The sample the session was opened as (`file.sample`), by its label; the document is named
|
||||
/// after it until it is saved under a name of its own.
|
||||
pub sample: Option<&'static str>,
|
||||
history: History,
|
||||
/// Identifies the current state: it changes with every edit, undo and redo, and comes back
|
||||
/// when an undo returns to an earlier state.
|
||||
|
||||
Reference in new issue
Block a user