From 3972f5f2ab153ce7a5dbdd926eb8a58c1051c299 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Lo=CC=81pez=20Guevara?= Date: Tue, 27 May 2025 16:50:37 -0300 Subject: [PATCH] feat(hashtag-column): handle new hashtag on Enter key press --- crates/notedeck_columns/src/ui/add_column.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/crates/notedeck_columns/src/ui/add_column.rs b/crates/notedeck_columns/src/ui/add_column.rs index f8ec5091..3d3923fc 100644 --- a/crates/notedeck_columns/src/ui/add_column.rs +++ b/crates/notedeck_columns/src/ui/add_column.rs @@ -763,10 +763,17 @@ pub fn hashtag_ui( ui.add(text_edit); ui.add_space(8.0); - if ui - .add_sized(egui::vec2(50.0, 40.0), add_column_button()) - .clicked() + + let mut handle_user_input = false; + if ui.input(|i| i.key_released(egui::Key::Enter)) + || ui + .add_sized(egui::vec2(50.0, 40.0), add_column_button()) + .clicked() { + handle_user_input = true; + } + + if handle_user_input && !text_buffer.is_empty() { let resp = AddColumnResponse::Timeline(TimelineKind::Hashtag(sanitize_hashtag(text_buffer))); id_string_map.remove(&id);