fork channel, fix recording esc key

[?]
Jul 24, 2025, 6:48 PM
5ZRDYL6KIQPUI3ZZETH5KJ64N6RUF7KYM3P6Q6HER5XVJZ7GZ4WQC

Dependencies

Change contents

  • edit in libflorescence/src/repo.rs at line 149
    [12.145]
    [2.466]
    ForkChannel(String),
  • edit in libflorescence/src/repo.rs at line 310
    [3.3040]
    [3.3040]
    MsgIn::ForkChannel(name) => {
    let state: State;
    (internal_state, state) = spawn_blocking(move || {
    fork_channel(&mut internal_state, name);
    let state = get_state(&internal_state);
    (internal_state, state)
    })
    .await
    .unwrap();
    let _ = msg_out_tx.send(MsgOut::Refreshed(state));
    }
  • edit in libflorescence/src/repo.rs at line 395
    [12.1949]
    [12.1949]
    txn.commit().unwrap();
    }
    fn fork_channel(state: &mut InternalState, name: String) {
    let repo = &state.repo;
    let current_channel = current_channel(repo);
    let mut txn = repo.pristine.mut_txn_begin().unwrap();
    let channel = txn.load_channel(&current_channel).unwrap().unwrap();
    let _fork = txn.fork(&channel, name.trim()).unwrap();
  • replacement in inflorescence_view/src/theme.rs at line 10
    [6.4709][6.4709:4761]()
    use iced::widget::{button, container, text_editor};
    [6.4709]
    [5.201]
    use iced::widget::{button, container, text_editor, text_input};
  • edit in inflorescence_view/src/theme.rs at line 107
    [5.955]
    [5.955]
    #[derive(Debug, Clone, Copy)]
    pub enum TextInput {
    Normal,
    }
  • edit in inflorescence_view/src/theme.rs at line 308
    [5.5869]
    [5.5869]
    impl text_input::Catalog for Theme {
    type Class<'a> = TextInput;
    fn default<'a>() -> Self::Class<'a> {
    TextInput::Normal
    }
    fn style(
    &self,
    class: &Self::Class<'_>,
    status: text_input::Status,
    ) -> text_input::Style {
    let background =
    palette::Background::new(PALETTE.background, PALETTE.text);
    let primary = palette::Primary::generate(
    PALETTE.primary,
    PALETTE.background,
    PALETTE.text,
    );
    let active = text_input::Style {
    background: Background::Color(background.base.color),
    border: Border {
    radius: 2.0.into(),
    width: 1.0,
    color: background.strongest.color,
    },
    icon: background.weak.text,
    placeholder: background.strongest.color,
    value: background.base.text,
    selection: primary.weak.color,
    };
    match status {
    text_input::Status::Active => active,
    text_input::Status::Hovered => text_input::Style {
    border: Border {
    color: background.base.text,
    ..active.border
    },
    ..active
    },
    text_input::Status::Focused { .. } => text_input::Style {
    border: Border {
    color: primary.strong.color,
    ..active.border
    },
    ..active
    },
    text_input::Status::Disabled => text_input::Style {
    background: Background::Color(background.weak.color),
    value: active.placeholder,
    ..active
    },
    }
    }
    }
  • replacement in inflorescence_view/src/app.rs at line 11
    [4.12642][9.1019:1090]()
    use iced::widget::{button, column, container, row, text, text_editor};
    [4.12642]
    [12.2991]
    use iced::widget::{
    button, column, container, row, text, text_editor, text_input,
    };
  • replacement in inflorescence_view/src/app.rs at line 42
    [7.1252][12.3176:3236]()
    /// `Some` when we're selecting a channel to switch to.
    [7.1252]
    [12.3236]
    /// `true` when we're selecting a channel to switch to.
  • edit in inflorescence_view/src/app.rs at line 44
    [12.3269]
    [9.1134]
    /// `Some` when we're selecting a channel to switch to.
    pub forking_channel: Option<String>,
  • edit in inflorescence_view/src/app.rs at line 115
    [12.3423]
    [11.28]
    ForkChannel,
    ForkChannelName(String),
  • edit in inflorescence_view/src/app.rs at line 178
    [12.3898]
    [7.1485]
    forking_channel,
  • replacement in inflorescence_view/src/app.rs at line 509
    [12.7009][12.7009:7083]()
    el(column([el(text(format!("Current channel: {channel}")))]))
    [12.7009]
    [12.7083]
    el(column([el(text(format!("Current channel: {channel}")))])
    .width(Length::Fill)
    .height(Length::Fill))
  • replacement in inflorescence_view/src/app.rs at line 516
    [12.7246][12.7246:7262]()
    ]))
    [12.7246]
    [12.7262]
    ])
    .width(Length::Fill)
    .height(Length::Fill))
  • replacement in inflorescence_view/src/app.rs at line 534
    [10.1967][12.7313:7364]()
    let actions_inner = view_actions(action_state(
    [10.1967]
    [12.7364]
    let actions_inner = column([]).spacing(4);
    let actions_inner = if let Some(forking_channel) = forking_channel {
    let channel_name_input = text_input("channel name...", forking_channel)
    .on_input(Msg::ForkChannelName);
    actions_inner.push(channel_name_input)
    } else {
    actions_inner
    };
    let actions_inner = actions_inner.push(view_actions(action_state(
  • replacement in inflorescence_view/src/app.rs at line 547
    [12.7451][12.7451:7459]()
    ));
    [12.7451]
    [10.2048]
    )));
  • edit in inflorescence_view/src/app.rs at line 601
    [10.3289]
    [10.3289]
  • edit in inflorescence_view/src/app.rs at line 605
    [10.3458]
    [10.3458]
  • edit in inflorescence_view/src/app.rs at line 612
    [10.3798]
    [12.7968]
  • edit in inflorescence_view/src/app.rs at line 615
    [12.8060]
    [11.46]
    let fork_channel = || action_button("f: fork channel", Msg::ForkChannel);
  • edit in inflorescence_view/src/app.rs at line 618
    [11.126]
    [12.8061]
  • replacement in inflorescence_view/src/app.rs at line 622
    [10.3799][10.3799:4038]()
    let add_if = |predicate: bool,
    button: Element<'a, Msg, Theme>,
    row: row::Row<'a, Msg, Theme>| {
    if predicate {
    row.push(button)
    } else {
    row
    }
    };
    [10.3799]
    [10.4038]
    let forking_channel = matches!(state, ActionState::ForkingChannel { .. });
  • edit in inflorescence_view/src/app.rs at line 624
    [10.4039][12.8193:8230]()
    #[allow(clippy::let_and_return)]
  • replacement in inflorescence_view/src/app.rs at line 634
    [10.4367][10.4367:4497]()
    let row = add_if(can_select_right, right(), row);
    add_if(can_record, start_record(), row)
    [10.4367]
    [10.4497]
    let row = add_if(can_select_right, right, row);
    add_if(can_record, start_record, row)
  • replacement in inflorescence_view/src/app.rs at line 639
    [10.4627][10.4627:4757]()
    let row = add_if(can_select_right, right(), row);
    add_if(can_record, start_record(), row)
    [10.4627]
    [10.4757]
    let row = add_if(can_select_right, right, row);
    add_if(can_record, start_record, row)
  • replacement in inflorescence_view/src/app.rs at line 643
    [10.4817][10.4817:4947]()
    let row = add_if(can_select_right, right(), row);
    add_if(can_record, start_record(), row)
    [10.4817]
    [10.4947]
    let row = add_if(can_select_right, right, row);
    add_if(can_record, start_record, row)
  • replacement in inflorescence_view/src/app.rs at line 647
    [12.8287][12.8287:8369]()
    let row = add_if(!can_record, switch_channel(), row);
    row
    [12.8287]
    [10.4979]
    add_if(!can_record, switch_channel, row)
  • replacement in inflorescence_view/src/app.rs at line 654
    [10.5142][10.5142:5204](),[10.5204][12.8370:8515]()
    let row = add_if(can_select_right, right(), row);
    let row = add_if(can_record, start_record(), row);
    let row = add_if(!can_record, switch_channel(), row);
    row
    [10.5142]
    [10.5256]
    let row = add_if(can_select_right, right, row);
    let row = add_if(can_record, start_record, row);
    add_if(!can_record, switch_channel, row)
  • replacement in inflorescence_view/src/app.rs at line 660
    [10.5393][12.8516:8661]()
    let row = add_if(can_record, start_record(), row);
    let row = add_if(!can_record, switch_channel(), row);
    row
    [10.5393]
    [10.5445]
    let row = add_if(can_record, start_record, row);
    add_if(!can_record, switch_channel, row)
  • edit in inflorescence_view/src/app.rs at line 675
    [12.9051]
    [10.5571]
    ActionState::ForkingChannel { empty, unique } => {
    let row = row([]);
    let row = add_if(!empty && unique, confirm, row);
    let row = add_if(
    !unique,
    || {
    el(button(
    text("Enter: already exists")
    .shaping(text::Shaping::Advanced),
    ))
    },
    row,
    );
    row.push(cancel())
    }
  • edit in inflorescence_view/src/app.rs at line 692
    [10.5579]
    [11.156]
    let row = add_if(!forking_channel, fork_channel, row);
  • edit in inflorescence_view/src/app.rs at line 698
    [10.5615]
    [10.5615]
    fn add_if<'a, F>(
    predicate: bool,
    button: F,
    row: row::Row<'a, Msg, Theme>,
    ) -> row::Row<'a, Msg, Theme>
    where
    F: Fn() -> Element<'a, Msg, Theme>,
    {
    if predicate {
    row.push(button())
    } else {
    row
    }
    }
  • edit in inflorescence_view/src/app.rs at line 732
    [12.9142]
    [10.6028]
    ForkingChannel {
    empty: bool,
    unique: bool,
    },
  • edit in inflorescence_view/src/app.rs at line 773
    [4.24509]
    [10.6432]
    if let Some(name) = repo.forking_channel.as_ref() {
    let name = name.trim();
    let empty = name.is_empty();
    let unique = !repo.state.other_channels.iter().any(|n| n == name);
    return ActionState::ForkingChannel { empty, unique };
    }
  • edit in inflorescence/src/selection.rs at line 128
    [12.13248]
    [8.640]
    forking_channel: _,
  • edit in inflorescence/src/selection.rs at line 458
    [12.14219]
    [8.9001]
    forking_channel: _,
  • edit in inflorescence/src/selection.rs at line 930
    [12.15760]
    [9.34932]
    forking_channel: _,
  • edit in inflorescence/src/selection.rs at line 1018
    [12.16414]
    [8.17839]
    forking_channel: _,
  • edit in inflorescence/src/selection.rs at line 1264
    [12.17222]
    [8.18046]
    forking_channel: _,
  • replacement in inflorescence/src/main.rs at line 251
    [12.18123][12.18123:18500]()
    if let Some(repo) = state.repo.as_mut()
    && repo.switching_channel
    && let Some(selection::Channel { ix: _, name }) =
    state.selection.view.channel.take()
    {
    state
    .repo_tx_in
    .send(repo::MsgIn::SwitchToChannel(name))
    .unwrap();
    [12.18123]
    [12.18500]
    if let Some(repo) = state.repo.as_mut() {
    #[allow(clippy::collapsible_if)]
    if repo.switching_channel {
    if let Some(selection::Channel { ix: _, name }) =
    state.selection.view.channel.take()
    {
    state
    .repo_tx_in
    .send(repo::MsgIn::SwitchToChannel(name))
    .unwrap();
  • replacement in inflorescence/src/main.rs at line 262
    [12.18501][12.18501:18549]()
    repo.switching_channel = false;
    [12.18501]
    [12.18549]
    repo.switching_channel = false;
    }
    } 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();
    }
    }
  • replacement in inflorescence/src/main.rs at line 276
    [12.18628][12.18628:18722]()
    if let Some(repo) = state.repo.as_mut()
    && repo.switching_channel
    [12.18628]
    [12.18722]
    if let Some(RecordMsg::Typing(content)) = state.record_msg.as_ref()
  • replacement in inflorescence/src/main.rs at line 278
    [12.18736][12.18736:18837]()
    repo.switching_channel = false;
    state.selection.view.channel = None;
    [12.18736]
    [12.18837]
    state.record_msg = Some(RecordMsg::Canceled {
    old_msg: content.text(),
    });
    }
    if let Some(repo) = state.repo.as_mut() {
    if repo.switching_channel {
    repo.switching_channel = false;
    state.selection.view.channel = None;
    } else if repo.forking_channel.is_some() {
    repo.forking_channel = None;
    }
  • edit in inflorescence/src/main.rs at line 342
    [12.19115]
    [12.19115]
    }
    Task::none()
    }
    app::Msg::ForkChannel => {
    if let Some(repo) = state.repo.as_mut() {
    repo.forking_channel = Some(String::new());
    return task::widget_focus_next();
  • edit in inflorescence/src/main.rs at line 352
    [12.19164]
    [11.237]
    app::Msg::ForkChannelName(name) => {
    if let Some(repo) = state.repo.as_mut() {
    repo.forking_channel = Some(name);
    }
    Task::none()
    }
  • edit in inflorescence/src/main.rs at line 386
    [12.19195]
    [7.5058]
    forking_channel: _,
  • edit in inflorescence/src/main.rs at line 449
    [12.19813]
    [7.6042]
    forking_channel: _,
  • edit in inflorescence/src/main.rs at line 576
    [12.20534]
    [12.20534]
    forking_channel: _,
  • edit in inflorescence/src/main.rs at line 680
    [12.21268]
    [7.7370]
    forking_channel: None,
  • edit in inflorescence/src/main.rs at line 759
    [12.21699]
    [7.7711]
    let forking_channel = state
    .repo
    .as_mut()
    .and_then(|repo| repo.forking_channel.take());
  • edit in inflorescence/src/main.rs at line 767
    [12.21727]
    [7.7786]
    forking_channel,
  • edit in inflorescence/src/main.rs at line 982
    [12.22615]
    [12.22615]
    "f" => Some(Msg::View(app::Msg::ForkChannel)),