allow to select channels if there are any other. Conditional switch
[?]
Aug 4, 2025, 9:58 AM
S4WH75Y32ZYLEWXBLHRG6Z3H7KWHSXAS6H37CFQIW3FXKKWFFQ2QCDependencies
- [2]
PTWZYQFRuse nav-scrollable for repo status - [3]
A6Z4O6RCactions menu - [4]
JZXYSIYDchannel selection! - [5]
5ZRDYL6Kfork channel, fix recording esc key - [6]
BAUK5BONpimp-up action buttons - [7]
OJPGHVC3entire log! - [8]
3XRG4BB6rewritten nav-scrollable! - [9]
7SSBM4UQview: refactor repo view - [10]
5MUEECMJsmooth scrolling nav - [11]
7BLZN73Oadd a key to refresh repo - [12]
UR4J677Rnav for log changes and refactors - [13]
ACDXXAX2refactor main's updates into smaller fns - [*]
23SFYK4Qbig view refactor into a new crate - [*]
6YZAVBWUInitial commit
Change contents
- replacement in inflorescence_view/src/app.rs at line 126
SwitchChannel,SelectChannel, - replacement in inflorescence_view/src/app.rs at line 198
let can_switch_channel = changed_files.is_empty();let has_other_channels = !other_channels.is_empty(); - replacement in inflorescence_view/src/app.rs at line 205
can_switch_channel.then_some(Msg::SwitchChannel),has_other_channels.then_some(Msg::SelectChannel), - replacement in inflorescence_view/src/app.rs at line 825
let switch_channel =|| action_button("c", "switch channel", Msg::SwitchChannel);let select_channel =|| action_button("c", "select channel", Msg::SelectChannel); - replacement in inflorescence_view/src/app.rs at line 832
let confirm = || action_button("Enter", "confirm", Msg::Confirm);let confirm =|label: &'static str| action_button("Enter", label, Msg::Confirm); - edit in inflorescence_view/src/app.rs at line 846
has_other_channels, - replacement in inflorescence_view/src/app.rs at line 865
let row = add_if(!can_record, switch_channel, row);let row = add_if(has_other_channels, select_channel, row); - edit in inflorescence_view/src/app.rs at line 871
has_other_channels, - replacement in inflorescence_view/src/app.rs at line 876
let row = add_if(!can_record, switch_channel, row);let row = add_if(has_other_channels, select_channel, row); - replacement in inflorescence_view/src/app.rs at line 879
ActionState::Diff { can_record } => {ActionState::Diff {can_record,has_other_channels,} => { - replacement in inflorescence_view/src/app.rs at line 885
let row = add_if(!can_record, switch_channel, row);let row = add_if(has_other_channels, select_channel, row); - replacement in inflorescence_view/src/app.rs at line 896
SwitchingChannelState::SomethingSelected => {row([down(), up(), confirm(), cancel()])SwitchingChannelState::SomethingSelected { can_switch } => {let row = row([down(), up(), cancel()]);let row = add_if(can_switch, || confirm("switch channel"), row);row - replacement in inflorescence_view/src/app.rs at line 904
let row = add_if(!empty && unique, confirm, row);let row = add_if(!empty && unique, || confirm("confirm fork"), row); - edit in inflorescence_view/src/app.rs at line 952
has_other_channels: bool, - edit in inflorescence_view/src/app.rs at line 958
has_other_channels: bool, - edit in inflorescence_view/src/app.rs at line 963
has_other_channels: bool, - replacement in inflorescence_view/src/app.rs at line 993
SomethingSelected,SomethingSelected { can_switch: bool }, - replacement in inflorescence_view/src/app.rs at line 1013
SwitchingChannelState::SomethingSelectedlet can_switch = repo.state.changed_files.is_empty();SwitchingChannelState::SomethingSelected { can_switch } - edit in inflorescence_view/src/app.rs at line 1060
let has_other_channels = !repo.state.other_channels.is_empty(); - replacement in inflorescence_view/src/app.rs at line 1070
ActionState::Diff { can_record }ActionState::Diff {can_record,has_other_channels,} - edit in inflorescence_view/src/app.rs at line 1081
has_other_channels, - edit in inflorescence_view/src/app.rs at line 1089
has_other_channels, - replacement in inflorescence_view/src/app.rs at line 1108
ActionState::Diff { can_record }ActionState::Diff {can_record,has_other_channels,} - edit in inflorescence_view/src/app.rs at line 1119
has_other_channels, - edit in inflorescence_view/src/app.rs at line 1127
has_other_channels, - replacement in inflorescence_view/src/app.rs at line 1145
ActionState::Diff { can_record }ActionState::Diff {can_record,has_other_channels,} - edit in inflorescence_view/src/app.rs at line 1155
has_other_channels, - edit in inflorescence_view/src/app.rs at line 1162
has_other_channels, - edit in inflorescence_view/src/app.rs at line 1172
has_other_channels, - edit in inflorescence_view/src/app.rs at line 1179
has_other_channels, - replacement in inflorescence/src/main.rs at line 241
} else if let Some(name) = repo.forking_channel.take() {if !repo.state.other_channels.contains(&name) {state.repo_tx_in.send(repo::MsgIn::ForkChannel(name)).unwrap();}} else if let Some(name) =repo.forking_channel.take_if(|name| {let name = name.trim();let empty = name.is_empty();let unique = || {!repo.state.other_channels.iter().any(|n| n == name)};!empty && unique()}){state.repo_tx_in.send(repo::MsgIn::ForkChannel(name)).unwrap(); - replacement in inflorescence/src/main.rs at line 272[5.7347]→[7.42706:43117](∅→∅),[7.43117]→[8.19865:19982](∅→∅),[8.19982]→[7.43320:43487](∅→∅),[7.43320]→[7.43320:43487](∅→∅)
} else if matches!(repo.entire_log.as_ref(),Some(app::EntireLog::Got { .. }),) {// Repeated match to take ownership of the logif let Some(app::EntireLog::Got { log, nav }) =repo.entire_log.take(){// Cache for later viewingrepo.entire_log =Some(app::EntireLog::NotViewing { log, nav });} else {debug_assert!(false, "The outter match should have the same condition as the inner match)")}} else if let Some(app::EntireLog::Got { log, nav }) = repo.entire_log.take_if(|log| matches!(log, app::EntireLog::Got { .. })){// Cache for later viewingrepo.entire_log =Some(app::EntireLog::NotViewing { log, nav }); - replacement in inflorescence/src/main.rs at line 303
app::Msg::SwitchChannel => {app::Msg::SelectChannel => { - replacement in inflorescence/src/main.rs at line 344
if let Some(app::EntireLog::NotViewing { log, nav }) =let Some(app::EntireLog::NotViewing { log, nav }) = - replacement in inflorescence/src/main.rs at line 346[8.20151]→[7.44818:44844](∅→∅),[7.44818]→[7.44818:44844](∅→∅),[7.44844]→[8.20152:20270](∅→∅),[8.20270]→[7.45863:46042](∅→∅),[7.45863]→[7.45863:46042](∅→∅)
{repo.entire_log =Some(app::EntireLog::Got { log, nav });} else {debug_assert!(false, "The outter match should have the same condition as the inner match)")}else {unreachable!()};repo.entire_log =Some(app::EntireLog::Got { log, nav }); - replacement in inflorescence/src/main.rs at line 978
"c" => Some(Msg::View(app::Msg::SwitchChannel)),"c" => Some(Msg::View(app::Msg::SelectChannel)),