add push and pull sub-menus
Dependencies
- [2]
D7A7MSIHallow to defer or abandon record, add buttons - [3]
OPXFZKEBview tests setup - [4]
3QVNMRNMtest non-empty repo app view - [5]
MYGIBRRHwip custom theme - [6]
3TLPJ57Balt scroll via context and couple fixes - [7]
JZXYSIYDchannel selection! - [8]
5ZRDYL6Kfork channel, fix recording esc key - [9]
WAOGSCOJvery nice refactor, wip adding channels logs - [10]
EJPSD5XOshared allowed actions conditions between update and view - [11]
YK3MOJJLchonky refactor, wip other channels logs & diffs - [12]
7WCB5YQJrefactor msgs and modules - [13]
PKLUHYE4allow to copy change hash - [14]
CULHFNIVadd error report view - [15]
LFEMJYYDstart of to_record selection - [16]
5O4FWCFPadd tests to_record selection and improve it - [17]
YGZ3VCW4add push - [18]
ODCT4QJNadd pull - [19]
UTDTZCTXpull+push status, add info reports - [20]
G5WLRXODadd screenshots for test - [21]
OLT666N4fix screenshot test to include status, fix failed test report - [22]
WH57EHNMupdate tests - [23]
LNAL3372update iced - [24]
SASAN2XCuse nav-scrollable - [25]
YKHE3XMWrefactor diffs handling - [26]
PTWZYQFRuse nav-scrollable for repo status - [27]
AZ5D2LQUallow to set record description - [28]
3XRG4BB6rewritten nav-scrollable! - [29]
2SLTGWP6add change files diffs to-record selection - [30]
23SFYK4Qbig view refactor into a new crate - [31]
S2NVIFXRallow to enter record msg - [32]
3BK22XE5add a test for hover btn and more refactors - [33]
UR4J677Rnav for log changes and refactors - [34]
XSZZB47Urefactor stuff into lib - [*]
6YZAVBWUInitial commit
Change contents
- edit in inflorescence_view/src/view.rs at line 56
sub_menu: _, - replacement in inflorescence_view/src/view/test.rs at line 5
use inflorescence_model::model::{ReadyState, State, SubState};use inflorescence_model::model::{ReadyState, State, SubMenu, SubState}; - replacement in inflorescence_view/src/view/test.rs at line 51
let allowed_actions = action::get_allowed(&sub, &report);let allowed_actions = action::get_allowed(&sub, &None, &report); - edit in inflorescence_view/src/view/test.rs at line 59
sub_menu: None, - replacement in inflorescence_view/src/view/test.rs at line 90
let allowed_actions = action::get_allowed(&sub, &report);let allowed_actions = action::get_allowed(&sub, &None, &report); - edit in inflorescence_view/src/view/test.rs at line 97
sub_menu: None, - replacement in inflorescence_view/src/view/test.rs at line 143
let allowed_actions = action::get_allowed(&sub, &report);let allowed_actions = action::get_allowed(&sub, &None, &report); - edit in inflorescence_view/src/view/test.rs at line 150
sub_menu: None, - replacement in inflorescence_view/src/view/test.rs at line 190
let allowed_actions = action::get_allowed(&sub, &report);let allowed_actions = action::get_allowed(&sub, &None, &report); - edit in inflorescence_view/src/view/test.rs at line 197
sub_menu: None, - replacement in inflorescence_view/src/view/test.rs at line 256
let allowed_actions = action::get_allowed(&sub, &report);let allowed_actions = action::get_allowed(&sub, &None, &report);let state = State {window_size: WINDOW_SIZE,window_scale: WINDOW_SCALE,repo_path: repo_path.clone(),sub,allowed_actions,sub_menu: None,report,};test_view(mresults, uniq_name, view(&state), size);// _________________________________________________________________________//let uniq_name = "sub_menu_push";let repo = repo::State {dir_name: "path".to_string(),channel: "some_channel".to_string(),other_channels: vec![],untracked_files: BTreeSet::new(),changed_files: BTreeMap::new(),short_log: vec![],};let ready_state = ReadyState {user_id: Id::default().unwrap(),repo,selection: default(),navigation: default(),record_changes: default(),logs: default(),forking_channel_name: default(),to_record: default(),jobs: default(),};let repo_path = PathBuf::from("test/repo/path");let sub = SubState::Ready(ready_state);let report = report::Container::default();let sub_menu = Some(SubMenu::Push);let allowed_actions = action::get_allowed(&sub, &sub_menu, &report); - edit in inflorescence_view/src/view/test.rs at line 303
sub_menu, - file addition: sub_menu_push-wgpu.png[20.1]
- edit in inflorescence_model/src/model.rs at line 36
pub sub_menu: Option<SubMenu>, - edit in inflorescence_model/src/model.rs at line 40
#[derive(Clone, Copy, Debug, PartialEq, Eq)]pub enum SubMenu {Push,Pull,} - replacement in inflorescence_model/src/action.rs at line 40
Push,Pull,EnterSubMenu(model::SubMenu), - replacement in inflorescence_model/src/action.rs at line 102
(Push, Push) => true,(Pull, Pull) => true,(EnterSubMenu(left), EnterSubMenu(right)) => left == right, - replacement in inflorescence_model/src/action.rs at line 123
(Push, _) => false,(Pull, _) => false,(EnterSubMenu(_), _) => false, - edit in inflorescence_model/src/action.rs at line 129
sub_menu: &Option<model::SubMenu>, - replacement in inflorescence_model/src/action.rs at line 132
let mut bindings = match state {model::SubState::Loading { .. } => vec![],model::SubState::SelectingId { .. } => todo!(),model::SubState::Ready(ready_state) => get_ready_allowed(ready_state),let mut bindings = if let Some(sub_menu) = sub_menu {match sub_menu {model::SubMenu::Push => {// TODO add optionsvec![confirm("confirm push"), cancel()]}model::SubMenu::Pull => {// TODO add optionsvec![confirm("confirm pull"), cancel()]}}} else {match state {model::SubState::Loading { .. } => vec![],model::SubState::SelectingId { .. } => todo!(),model::SubState::Ready(ready_state) => {get_ready_allowed(ready_state)}} - edit in inflorescence_model/src/action.rs at line 284[10.8320]→[10.8320:8407](∅→∅),[10.8407]→[12.8403:8444](∅→∅),[12.8444]→[10.8440:8447](∅→∅),[10.8440]→[10.8440:8447](∅→∅)
let confirm = |label: &'static str| Binding {key: "Enter",label,msg: Some(FilteredMsg::Confirm),}; - edit in inflorescence_model/src/action.rs at line 289[10.8565]→[10.8565:8640](∅→∅),[10.8640]→[12.8445:8485](∅→∅),[12.8485]→[10.8672:8679](∅→∅),[10.8672]→[10.8672:8679](∅→∅)
let cancel = || Binding {key: "Esc",label: "cancel",msg: Some(FilteredMsg::Cancel),}; - replacement in inflorescence_model/src/action.rs at line 348
msg: can_push.then_some(FilteredMsg::Push),msg: can_push.then_some(FilteredMsg::EnterSubMenu(model::SubMenu::Push)), - replacement in inflorescence_model/src/action.rs at line 354
msg: can_pull.then_some(FilteredMsg::Pull),msg: can_pull.then_some(FilteredMsg::EnterSubMenu(model::SubMenu::Pull)), - edit in inflorescence_model/src/action.rs at line 580
// ____________________________________________________________________________// Simplified state used for determining allowed bindings - edit in inflorescence_model/src/action.rs at line 947[10.23202]
// ____________________________________________________________________________// Bindingsfn confirm(label: &'static str) -> Binding {Binding {key: "Enter",label,msg: Some(FilteredMsg::Confirm),}}fn cancel() -> Binding {Binding {key: "Esc",label: "cancel",msg: Some(FilteredMsg::Cancel),}} - edit in inflorescence/src/main.rs at line 124
sub_menu: None, - replacement in inflorescence/src/main.rs at line 182
state.model.allowed_actions =action::get_allowed(&state.model.sub, &state.model.report);state.model.allowed_actions = action::get_allowed(&state.model.sub,&state.model.sub_menu,&state.model.report,); - replacement in inflorescence/src/main.rs at line 344
if let Some(ReadyState {if let Some(sub_menu) = &state.model.sub_menu {match sub_menu {model::SubMenu::Push => push(state),model::SubMenu::Pull => pull(state),}} else if let Some(ReadyState { - edit in inflorescence/src/main.rs at line 391
Task::none()} else {Task::none() - edit in inflorescence/src/main.rs at line 395
Task::none() - replacement in inflorescence/src/main.rs at line 397
if let Some(ReadyState {if state.model.sub_menu.is_some() {state.model.sub_menu = None;} else if let Some(ReadyState { - replacement in inflorescence/src/main.rs at line 570
action::FilteredMsg::Push => {if let Some(ReadyState { repo, jobs, .. }) =model::is_ready_mut(&mut state.model){jobs.insert(model::Job::Push {channel: repo.channel.clone(),});state.repo_tx_in.send(repo::MsgIn::Push {channel: repo.channel.clone(),}).unwrap();}action::FilteredMsg::EnterSubMenu(sub_menu) => {state.model.sub_menu = Some(sub_menu); - edit in inflorescence/src/main.rs at line 574[15.18195]→[18.9937:9976](∅→∅),[18.9976]→[19.7380:7846](∅→∅),[19.7846]→[18.10106:10141](∅→∅),[18.10106]→[18.10106:10141](∅→∅)
action::FilteredMsg::Pull => {if let Some(ReadyState { repo, jobs, .. }) =model::is_ready_mut(&mut state.model){jobs.insert(model::Job::Pull {channel: repo.channel.clone(),});state.repo_tx_in.send(repo::MsgIn::Pull {channel: repo.channel.clone(),}).unwrap();}Task::none()} - edit in inflorescence/src/main.rs at line 687
}fn push(state: &mut State) -> Task<Msg> {if let Some(ReadyState { repo, jobs, .. }) =model::is_ready_mut(&mut state.model){jobs.insert(model::Job::Push {channel: repo.channel.clone(),});state.repo_tx_in.send(repo::MsgIn::Push {channel: repo.channel.clone(),}).unwrap();}state.model.sub_menu = None;Task::none() - edit in inflorescence/src/main.rs at line 707
fn pull(state: &mut State) -> Task<Msg> {if let Some(ReadyState { repo, jobs, .. }) =model::is_ready_mut(&mut state.model){jobs.insert(model::Job::Pull {channel: repo.channel.clone(),});state.repo_tx_in.send(repo::MsgIn::Pull {channel: repo.channel.clone(),}).unwrap();}state.model.sub_menu = None;Task::none()} - replacement in inflorescence/src/main.rs at line 1693
"f" if mods == Modifiers::SHIFT => {action(action::FilteredMsg::Pull)}"f" if mods == Modifiers::SHIFT => action(action::FilteredMsg::EnterSubMenu(model::SubMenu::Pull),), - replacement in inflorescence/src/main.rs at line 1708
"p" if mods == Modifiers::SHIFT => {action(action::FilteredMsg::Push)}"p" if mods == Modifiers::SHIFT => action(action::FilteredMsg::EnterSubMenu(model::SubMenu::Push),),