chore: refactor the input component (#165)

* refactor the input component

* fix clippy

* clean up
This commit is contained in:
reya
2025-09-25 08:03:14 +07:00
committed by GitHub
parent a87184214f
commit 61cad5dd96
20 changed files with 2529 additions and 1593 deletions
+4 -3
View File
@@ -100,12 +100,12 @@ impl Sidebar {
subscriptions.push(
// Subscribe for find input events
cx.subscribe_in(&find_input, window, |this, _state, event, window, cx| {
cx.subscribe_in(&find_input, window, |this, state, event, window, cx| {
match event {
InputEvent::PressEnter { .. } => this.search(window, cx),
InputEvent::Change(text) => {
InputEvent::Change => {
// Clear the result when input is empty
if text.is_empty() {
if state.read(cx).value().is_empty() {
this.clear_search_results(window, cx);
} else {
// Run debounced search
@@ -722,6 +722,7 @@ impl Render for Sidebar {
.small()
.cleanable()
.appearance(true)
.text_xs()
.suffix(
Button::new("find")
.icon(IconName::Search)