From 8b60cab6a22eb29a2ae105512e2f7a4d8e897c24 Mon Sep 17 00:00:00 2001 From: Simon Huber Date: Thu, 24 Oct 2024 15:34:23 +0200 Subject: [PATCH] Keyboard driven input rework (#8678) * Update tag-picker.tid * rework kb-driven-input macro to procedures + new syntax * rework change-input-tab to procedure * fix * remove console log :) * replace defines with procedures * fix link-dropdown * fix focus-selector in new-field dropdown * revert changing the footpring of change-input-tab + make it work as procedure * update change-input-tab procedure * refactor change-input-tab procedure and keep tags/Macro tag * simplify complicated filter * add tags/Global tag * remove tags/Global tag * rename variable --- core/ui/AdvancedSearch/Filter.tid | 44 +++--- core/ui/AdvancedSearch/Shadows.tid | 43 +++--- core/ui/AdvancedSearch/Standard.tid | 28 ++-- core/ui/AdvancedSearch/System.tid | 45 +++--- core/ui/EditTemplate/fields.tid | 55 ++++--- core/ui/EditTemplate/type.tid | 8 +- core/ui/EditorToolbar/link-dropdown.tid | 37 ++--- core/ui/SideBarSegments/search.tid | 28 ++-- core/wiki/macros/keyboard-driven-input.tid | 160 ++++++++++++--------- core/wiki/macros/tag-picker.tid | 28 ++-- 10 files changed, 272 insertions(+), 204 deletions(-) diff --git a/core/ui/AdvancedSearch/Filter.tid b/core/ui/AdvancedSearch/Filter.tid index a8baf9d30..7369e4c40 100644 --- a/core/ui/AdvancedSearch/Filter.tid +++ b/core/ui/AdvancedSearch/Filter.tid @@ -2,18 +2,28 @@ title: $:/core/ui/AdvancedSearch/Filter tags: $:/tags/AdvancedSearch caption: {{$:/language/Search/Filter/Caption}} -\define lingo-base() $:/language/Search/ -\define set-next-input-tab(beforeafter:"after") -<$macrocall $name="change-input-tab" +\procedure lingo-base() $:/language/Search/ +\procedure set-next-input-tab() +<$transclude $variable="change-input-tab" stateTitle="$:/state/tab--1498284803" tag="$:/tags/AdvancedSearch" - beforeafter="$beforeafter$" + beforeafter="after" defaultState="$:/core/ui/AdvancedSearch/System" actions="<$action-setfield $tiddler='$:/state/advancedsearch/currentTab' text=<>/>" /> \end -\define cancel-search-actions() +\procedure set-previous-input-tab() +<$transclude $variable="change-input-tab" + stateTitle="$:/state/tab--1498284803" + tag="$:/tags/AdvancedSearch" + beforeafter="before" + defaultState="$:/core/ui/AdvancedSearch/System" + actions="<$action-setfield $tiddler='$:/state/advancedsearch/currentTab' text=<>/>" +/> +\end + +\procedure cancel-search-actions() \whitespace trim <$list filter="[{$:/temp/advancedsearch/input}!match{$:/temp/advancedsearch}]"> <$list-empty> @@ -24,30 +34,30 @@ caption: {{$:/language/Search/Filter/Caption}} \end -\define input-accept-actions() +\procedure input-accept-actions() \whitespace trim <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]"> <$list-empty> - <$list filter="[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]"> - <$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/> + <$list filter="[get[text]!is[missing]] :else[get[text]is[shadow]]"> + <$action-navigate $to={{{ [get[text]] }}}/> <$/list-empty> - <$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/> + <$action-navigate $to={{{ [get[text]] }}}/> \end -\define input-accept-variant-actions() +\procedure input-accept-variant-actions() \whitespace trim <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]"> <$list-empty> - <$list filter="[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]"> + <$list filter="[get[text]!is[missing]] :else[get[text]is[shadow]]"> <$list filter="[<__tiddler__>get[text]minlength[1]]"> - <$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/> + <$action-sendmessage $message="tm-edit-tiddler" $param={{{ [get[text]] }}}/> - <$list filter="[<__tiddler__>get[text]minlength[1]]"> - <$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/> + <$list filter="[get[text]minlength[1]]"> + <$action-sendmessage $message="tm-edit-tiddler" $param={{{ [get[text]] }}}/> \end @@ -58,8 +68,8 @@ caption: {{$:/language/Search/Filter/Caption}}