allow to select channels if there are any other. Conditional switch

[?]
Aug 4, 2025, 9:58 AM
S4WH75Y32ZYLEWXBLHRG6Z3H7KWHSXAS6H37CFQIW3FXKKWFFQ2QC

Dependencies

Change contents

  • replacement in inflorescence_view/src/app.rs at line 126
    [4.3404][4.3404:3423]()
    SwitchChannel,
    [4.3404]
    [5.2980]
    SelectChannel,
  • replacement in inflorescence_view/src/app.rs at line 198
    [4.3900][4.3900:3955]()
    let can_switch_channel = changed_files.is_empty();
    [4.3900]
    [2.1499]
    let has_other_channels = !other_channels.is_empty();
  • replacement in inflorescence_view/src/app.rs at line 205
    [7.2089][7.2089:2155]()
    can_switch_channel.then_some(Msg::SwitchChannel),
    [7.2089]
    [7.2155]
    has_other_channels.then_some(Msg::SelectChannel),
  • replacement in inflorescence_view/src/app.rs at line 825
    [5.3707][4.7968:7993](),[3.3798][4.7968:7993](),[4.7993][6.948:1017]()
    let switch_channel =
    || action_button("c", "switch channel", Msg::SwitchChannel);
    [5.3707]
    [6.1017]
    let select_channel =
    || action_button("c", "select channel", Msg::SelectChannel);
  • replacement in inflorescence_view/src/app.rs at line 832
    [5.3789][6.1189:1259]()
    let confirm = || action_button("Enter", "confirm", Msg::Confirm);
    [5.3789]
    [6.1259]
    let confirm =
    |label: &'static str| action_button("Enter", label, Msg::Confirm);
  • edit in inflorescence_view/src/app.rs at line 846
    [3.4176]
    [3.4176]
    has_other_channels,
  • replacement in inflorescence_view/src/app.rs at line 865
    [4.8287][7.12937:13001]()
    let row = add_if(!can_record, switch_channel, row);
    [4.8287]
    [7.13001]
    let row = add_if(has_other_channels, select_channel, row);
  • edit in inflorescence_view/src/app.rs at line 871
    [3.5076]
    [3.5076]
    has_other_channels,
  • replacement in inflorescence_view/src/app.rs at line 876
    [5.4426][7.13018:13082]()
    let row = add_if(!can_record, switch_channel, row);
    [5.4426]
    [7.13082]
    let row = add_if(has_other_channels, select_channel, row);
  • replacement in inflorescence_view/src/app.rs at line 879
    [3.5266][3.5266:5312]()
    ActionState::Diff { can_record } => {
    [3.5266]
    [3.5312]
    ActionState::Diff {
    can_record,
    has_other_channels,
    } => {
  • replacement in inflorescence_view/src/app.rs at line 885
    [5.4541][7.13099:13163]()
    let row = add_if(!can_record, switch_channel, row);
    [5.4541]
    [7.13163]
    let row = add_if(has_other_channels, select_channel, row);
  • replacement in inflorescence_view/src/app.rs at line 896
    [4.8911][4.8911:9026]()
    SwitchingChannelState::SomethingSelected => {
    row([down(), up(), confirm(), cancel()])
    [4.8911]
    [4.9026]
    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
    [5.4685][5.4685:4747]()
    let row = add_if(!empty && unique, confirm, row);
    [5.4685]
    [6.1426]
    let row = add_if(!empty && unique, || confirm("confirm fork"), row);
  • edit in inflorescence_view/src/app.rs at line 952
    [3.5757]
    [3.5757]
    has_other_channels: bool,
  • edit in inflorescence_view/src/app.rs at line 958
    [3.5882]
    [3.5882]
    has_other_channels: bool,
  • edit in inflorescence_view/src/app.rs at line 963
    [4.9089]
    [4.9089]
    has_other_channels: bool,
  • replacement in inflorescence_view/src/app.rs at line 993
    [4.9214][4.9214:9237]()
    SomethingSelected,
    [4.9214]
    [4.9237]
    SomethingSelected { can_switch: bool },
  • replacement in inflorescence_view/src/app.rs at line 1013
    [4.9552][4.9552:9605]()
    SwitchingChannelState::SomethingSelected
    [4.9552]
    [4.9605]
    let can_switch = repo.state.changed_files.is_empty();
    SwitchingChannelState::SomethingSelected { can_switch }
  • edit in inflorescence_view/src/app.rs at line 1060
    [3.6491]
    [3.6491]
    let has_other_channels = !repo.state.other_channels.is_empty();
  • replacement in inflorescence_view/src/app.rs at line 1070
    [3.6705][3.6705:6758]()
    ActionState::Diff { can_record }
    [3.6705]
    [3.6758]
    ActionState::Diff {
    can_record,
    has_other_channels,
    }
  • edit in inflorescence_view/src/app.rs at line 1081
    [3.7118]
    [3.7118]
    has_other_channels,
  • edit in inflorescence_view/src/app.rs at line 1089
    [3.7349]
    [3.7349]
    has_other_channels,
  • replacement in inflorescence_view/src/app.rs at line 1108
    [3.7853][3.7853:7906]()
    ActionState::Diff { can_record }
    [3.7853]
    [3.7906]
    ActionState::Diff {
    can_record,
    has_other_channels,
    }
  • edit in inflorescence_view/src/app.rs at line 1119
    [3.8258]
    [3.8258]
    has_other_channels,
  • edit in inflorescence_view/src/app.rs at line 1127
    [3.8481]
    [3.8481]
    has_other_channels,
  • replacement in inflorescence_view/src/app.rs at line 1145
    [3.8896][3.8896:8953]()
    ActionState::Diff { can_record }
    [3.8896]
    [3.8953]
    ActionState::Diff {
    can_record,
    has_other_channels,
    }
  • edit in inflorescence_view/src/app.rs at line 1155
    [3.9285]
    [3.9285]
    has_other_channels,
  • edit in inflorescence_view/src/app.rs at line 1162
    [3.9488]
    [3.9488]
    has_other_channels,
  • edit in inflorescence_view/src/app.rs at line 1172
    [3.9734]
    [3.9734]
    has_other_channels,
  • edit in inflorescence_view/src/app.rs at line 1179
    [3.9902]
    [3.9902]
    has_other_channels,
  • replacement in inflorescence/src/main.rs at line 241
    [5.6453][5.6453:6791]()
    } 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();
    }
    [5.6453]
    [5.6791]
    } 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 log
    if let Some(app::EntireLog::Got { log, nav }) =
    repo.entire_log.take()
    {
    // Cache for later viewing
    repo.entire_log =
    Some(app::EntireLog::NotViewing { log, nav });
    } else {
    debug_assert!(false, "The outter match should have the same condition as the inner match)")
    }
    [5.7347]
    [5.7347]
    } else if let Some(app::EntireLog::Got { log, nav }) = repo
    .entire_log
    .take_if(|log| matches!(log, app::EntireLog::Got { .. }))
    {
    // Cache for later viewing
    repo.entire_log =
    Some(app::EntireLog::NotViewing { log, nav });
  • replacement in inflorescence/src/main.rs at line 303
    [3.13009][4.18977:19014]()
    app::Msg::SwitchChannel => {
    [3.13009]
    [4.19014]
    app::Msg::SelectChannel => {
  • replacement in inflorescence/src/main.rs at line 344
    [7.44621][8.20021:20100]()
    if let Some(app::EntireLog::NotViewing { log, nav }) =
    [7.44621]
    [8.20100]
    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)")
    }
    [8.20151]
    [7.46042]
    else {
    unreachable!()
    };
    repo.entire_log =
    Some(app::EntireLog::Got { log, nav });
  • replacement in inflorescence/src/main.rs at line 978
    [7.54548][7.54548:54617]()
    "c" => Some(Msg::View(app::Msg::SwitchChannel)),
    [7.54548]
    [8.21801]
    "c" => Some(Msg::View(app::Msg::SelectChannel)),