allow to defer or abandon record, add buttons
[?]
Mar 1, 2025, 7:42 PM
D7A7MSIHJS3IAOLEPK52M4CZLDPLO7JB3Y62XACT2AM6UUCPQ6BACDependencies
- [2]
6YZAVBWUInitial commit - [3]
IQDCHWCPload a pijul repo - [4]
WT3GA27Padd cursor with selection - [5]
EC3TVL4Xadd untracked files - [6]
KT5UYXGKfix selection after adding file, add changed file diffs - [7]
ELG3UDT6allow to rm added files - [8]
S2NVIFXRallow to enter record msg - [9]
W7IUT3ZVstart recording impl - [10]
YBJRDOTCmake all repo actions async - [11]
2VUX5BTDload identity - [12]
A5YBC77Vrecord! - [13]
Z2CJPWZEfocus record message text_editor on spawn - [14]
SWWE2R6Mdisplay basic repo stuff - [15]
DVKSPF7Rtrack selected file path together with an index
Change contents
- replacement in crates/flowers_ui/src/main.rs at line 85
record_msg: Option<text_editor::Content>,record_msg: Option<RecordMsg>,}#[derive(Debug)]enum RecordMsg {Typing(text_editor::Content),Canceled { old_msg: String }, - replacement in crates/flowers_ui/src/main.rs at line 111
Save,DeferRecord,SaveRecord,AbandonRecord, - edit in crates/flowers_ui/src/main.rs at line 130
Message::LoadedId(id) => {state.id = Some(*id);Task::none()} - replacement in crates/flowers_ui/src/main.rs at line 336
if state.record_msg.is_some() {if repo.changed_files.is_empty() {info!("Trying to record with no changed files");} else if let Some(RecordMsg::Typing(_)) =state.record_msg.as_ref(){ - replacement in crates/flowers_ui/src/main.rs at line 342
} else if repo.changed_files.is_empty() {info!("Trying to record with no changed files");return Task::none(); - replacement in crates/flowers_ui/src/main.rs at line 344
state.record_msg = Some(text_editor::Content::new());let content = match state.record_msg.take() {Some(RecordMsg::Canceled { old_msg }) => {text_editor::Content::with_text(&old_msg)}None | Some(RecordMsg::Typing(_)) => {text_editor::Content::new()}};state.record_msg = Some(RecordMsg::Typing(content)); - replacement in crates/flowers_ui/src/main.rs at line 360
if let Some(record_msg) = state.record_msg.as_mut() {if let Some(RecordMsg::Typing(record_msg)) =state.record_msg.as_mut(){ - replacement in crates/flowers_ui/src/main.rs at line 367
Message::Save => {if let Some(record_msg) = state.record_msg.as_ref() {Message::SaveRecord => {if let Some(RecordMsg::Typing(record_msg)) =state.record_msg.as_ref(){ - replacement in crates/flowers_ui/src/main.rs at line 372
if msg.chars().all(|c| c.is_whitespace()) {if msg.trim().is_empty() { - replacement in crates/flowers_ui/src/main.rs at line 395
Message::LoadedId(id) => {state.id = Some(*id);Message::DeferRecord => {if let Some(RecordMsg::Typing(record_msg)) =state.record_msg.as_ref(){let old_msg = record_msg.text();state.record_msg = if !old_msg.trim().is_empty() {Some(RecordMsg::Canceled { old_msg })} else {None};}Task::none()}Message::AbandonRecord => {if let Some(RecordMsg::Typing(_)) = state.record_msg.as_ref() {state.record_msg = None;} - edit in crates/flowers_ui/src/main.rs at line 501
"a" => Some(Message::AddUntrackedFile), - replacement in crates/flowers_ui/src/main.rs at line 504
"a" => Some(Message::AddUntrackedFile),"r" => Some(Message::Record), - edit in crates/flowers_ui/src/main.rs at line 506
"r" => Some(Message::Record), - replacement in crates/flowers_ui/src/main.rs at line 513
"s" if mods == Modifiers::CTRL => Some(Message::Save),"a" if mods == Modifiers::CTRL => {Some(Message::AbandonRecord)}"d" if mods == Modifiers::CTRL => {Some(Message::DeferRecord)}"s" if mods == Modifiers::CTRL => Some(Message::SaveRecord), - replacement in crates/flowers_ui/src/main.rs at line 530
let repo_info = Element::from(row([Element::from(text(&repo.dir_name)),Element::from(text(": ")),Element::from(let repo_info = el(row([el(text(&repo.dir_name)),el(text(": ")),el( - replacement in crates/flowers_ui/src/main.rs at line 540
Element::from(column(repo.untracked_files.iter().enumerate().map(el(column(repo.untracked_files.iter().enumerate().map( - replacement in crates/flowers_ui/src/main.rs at line 545
Element::from(el( - replacement in crates/flowers_ui/src/main.rs at line 556
Element::from(column(repo.changed_files.iter().enumerate().map(el(column(repo.changed_files.iter().enumerate().map( - replacement in crates/flowers_ui/src/main.rs at line 561
Element::from(el( - replacement in crates/flowers_ui/src/main.rs at line 571
let log = Element::from(column(["todo: commits"].iter().map(|hash| Element::from(text(*hash))),));let log =el(column(["todo: commits"].iter().map(|hash| el(text(*hash))))); - replacement in crates/flowers_ui/src/main.rs at line 574
let record_msg_editor =if let Some(record_msg) = state.record_msg.as_ref() {Element::from(text_editor(record_msg).placeholder("Type something here...").on_action(Message::EditRecordMsg),)} else {Element::from(row([]))};let record_msg_editor = if let Some(RecordMsg::Typing(msg_content)) =state.record_msg.as_ref(){el(column([el(text_editor(msg_content).placeholder("Type something here...").on_action(Message::EditRecordMsg)),el(row([el(button(text("Save")).on_press(Message::SaveRecord)),el(button(text("Defer")).on_press(Message::DeferRecord)),el(button(text("Abandon")).on_press(Message::AbandonRecord)),])),]))} else {el(row([]))}; - replacement in crates/flowers_ui/src/main.rs at line 592
Element::from(row([Element::from(column([repo_info,Element::from(horizontal_rule(1)),Element::from(text("Untracked:")),untracked_files,Element::from(horizontal_rule(1)),Element::from(text("Changed:")),changed_files,Element::from(horizontal_rule(1)),log,]).width(Length::FillPortion(1)),),Element::from(column([record_msg_editor]).width(Length::FillPortion(1)),),el(row([el(column([repo_info,el(horizontal_rule(1)),el(text("Untracked:")),untracked_files,el(horizontal_rule(1)),el(text("Changed:")),changed_files,el(horizontal_rule(1)),log,]).width(Length::FillPortion(1))),el(column([record_msg_editor]).width(Length::FillPortion(1))), - replacement in crates/flowers_ui/src/main.rs at line 608
Element::from(text("Loading repo..."))el(text("Loading repo...")) - edit in crates/flowers_ui/src/main.rs at line 633
}fn el<'a, E, M>(e: E) -> Element<'a, M>whereE: Into<Element<'a, M>>,{e.into()