Add a foundation model for typeahead search of UIs.
Review Request #13627 — Created March 11, 2024 and submitted
This introduces
TypeaheadBuffer
, which tracks key presses made within
a short period of time (default is 3 seconds) for the purposes of
navigating a UI (such as a menu or sidebar). It takes care of
maintaining its buffer based on key presses and assisting in performing
matches based on the keys pressed.Components can instantiate this, send key presses, listen to buffer
changes, and use those and helper methods to help find the relevant
element in the UI to select.This does not provide any visuals showing what's been typed (though that
may come later, based on work done in another codebase).
Unit tests pass.
Summary | ID |
---|---|
a4cd3e23d244990a4582cb28aed8a923735b4d24 |
-
-
-
src/ink/js/foundation/models/tests/typeaheadBufferTests.ts (Diff revision 1) Add a module level comment here.
-
-
src/ink/js/foundation/models/typeaheadBuffer.ts (Diff revision 1) This syntax isn't quite right. This defines a function that takes an argument named ItemT with no type, and returns a string. It needs to be
((item: ItemT) => string)
-
-
Change Summary:
- Buffer text is now normalized when set, fixing comparison issues.
- Fixed some type-related issues and type name consistency.
- Added a missing file-level comment.
Summary: |
|
|||||||
---|---|---|---|---|---|---|---|---|
Commits: |
|
|||||||
Diff: |
Revision 2 (+958) |
Checks run (2 succeeded)
Description: |
|
---|