Skip to content

Commit 4e0fcd7

Browse files
authored
chore: change default searchDebounceTimeout to 500ms (#191)
Reduce the default search debounce timeout from 2000ms to 500ms for a more responsive search experience. Updated source defaults, stories, and documentation.
1 parent 0105106 commit 4e0fcd7

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ A trigger button that opens a dialog containing the tree navigator. This is the
102102
| `opened` | -- | `boolean` | `false` | Whether the dialog is open (two-way bindable) |
103103
| `showReset` | `show-reset` | `boolean` | `false` | Show the reset/clear button |
104104
| `searchMinLength` | `search-min-length` | `number` | `3` | Minimum characters to trigger search |
105-
| `searchDebounceTimeout` | -- | `number` | `2000` | Debounce timeout (ms) before search triggers |
105+
| `searchDebounceTimeout` | -- | `number` | `500` | Debounce timeout (ms) before search triggers |
106106

107107
#### Events
108108

@@ -166,7 +166,7 @@ The inner navigator component that provides tree browsing, search, and keyboard
166166
| `highlightedNodePath` | `string` | `''` | Currently highlighted node's path (notify only) |
167167
| `opened` | `boolean` | `undefined` | Controls keyboard listeners and scroll behavior |
168168
| `searchMinLength` | `number` | `3` | Minimum characters to trigger search |
169-
| `searchDebounceTimeout` | `number` | `2000` | Debounce timeout (ms) before search triggers |
169+
| `searchDebounceTimeout` | `number` | `500` | Debounce timeout (ms) before search triggers |
170170

171171
#### Events
172172

src/cosmoz-treenode-button-view.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const CosmozNodeButtonView = ({
5555
tree,
5656
showReset = false,
5757
searchMinLength = 3,
58-
searchDebounceTimeout = 2000,
58+
searchDebounceTimeout = 500,
5959
}: ButtonViewProps) => {
6060
const dialogRef = useRef<ButtonViewDialog | null>(null);
6161

src/cosmoz-treenode-navigator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const NodeNavigator = ({
5353
*/
5454
searchMinLength = 3,
5555
opened,
56-
searchDebounceTimeout = 2000,
56+
searchDebounceTimeout = 500,
5757
}: TreenodeNavigatorProps) => {
5858
const listRef = useRef<HTMLElement>();
5959
const host = useHost();

stories/cosmoz-treenode-button-view.stories.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const meta: Meta<StoryArgs> = {
2727
},
2828
args: {
2929
searchMinLength: 3,
30-
searchDebounceTimeout: 2000,
30+
searchDebounceTimeout: 500,
3131
showReset: false,
3232
nodePath: '',
3333
},

stories/cosmoz-treenode-navigator.stories.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const meta: Meta<StoryArgs> = {
2727
},
2828
args: {
2929
searchMinLength: 3,
30-
searchDebounceTimeout: 2000,
30+
searchDebounceTimeout: 500,
3131
opened: true,
3232
nodePath: '',
3333
},

0 commit comments

Comments
 (0)