Skip to content

Add history to new list/tree search/filter widget (#155578)#159188

Merged
joaomoreno merged 16 commits intomicrosoft:mainfrom
gjsjohnmurray:fix-155578
Jan 3, 2023
Merged

Add history to new list/tree search/filter widget (#155578)#159188
joaomoreno merged 16 commits intomicrosoft:mainfrom
gjsjohnmurray:fix-155578

Conversation

@gjsjohnmurray
Copy link
Contributor

@gjsjohnmurray gjsjohnmurray commented Aug 25, 2022

This PR is for #155578.

While the widget remains open it accumulates search strings. Each one gets added when focus moves off the widget (typically to the tree, e.g. when DownArrow is pressed).

UpArrow in the widget's input field recalls previous history entries. Enter is implemented as an alternative shortcut into the tree, useful when you have navigated up the history and DownArrow no longer gets you there because instead it takes you down the history list.

At this time history is not persisted when the widget is closed.

@gjsjohnmurray
Copy link
Contributor Author

/assign @joaomoreno

@gjsjohnmurray
Copy link
Contributor Author

@joaomoreno please consider merging this as well as #158583. Both of them add some shine to the recent list/tree search/filter rework.

Copy link
Member

@joaomoreno joaomoreno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gjsjohnmurray This feels strange right now:

  • We should definitely persist the history in memory, as long as the tree is alive.
  • I don't think the current behavior makes sense: DownArrow will either navigate history or jump to the list, depending on the history's cursor position. This makes for very strange behavior. I don't have a good suggestion to solve this.
  • Are all those changes deep in history.ts really necessary?

@gjsjohnmurray
Copy link
Contributor Author

  • Are all those changes deep in history.ts really necessary?

Adding isLast() and isNowhere() seemed necessary to make the DownArrow handling work. I added isFirst() for completeness. All three are currently only used by the corresponding new public isXXXInHistory() methods of HistoryInputBox. Currently isAtFirstInHistory() isn't used, but it's there for completeness.

  • I don't think the current behavior makes sense: ... I don't have a good suggestion to solve this.

Nor do I. Removing current behaviour of DownArrow taking you back to the tree/list is likely to cause complaints as people adapt to using Enter for this instead. If I have UpArrowed up the history, then press one too many DownArrows, yes, I end of off the widget. But I can use Ctrl/Cmd+F to get back there quickly.

@gjsjohnmurray
Copy link
Contributor Author

  • We should definitely persist the history in memory, as long as the tree is alive.

I have pushed a change to do this, plus another than persists the search/filter mode for the tree across close/reopen of the widget.

@gjsjohnmurray
Copy link
Contributor Author

@bpasero I think this also addresses #156248

@gjsjohnmurray
Copy link
Contributor Author

@joaomoreno does this need more work from me before you will merge it?

@joaomoreno joaomoreno added this to the January 2023 milestone Jan 2, 2023
@joaomoreno joaomoreno added the tree-widget Tree widget issues label Jan 2, 2023
@joaomoreno
Copy link
Member

Sorry for the delay here @gjsjohnmurray! Happy new year and thank you! 🍻

@joaomoreno joaomoreno merged commit 8eee363 into microsoft:main Jan 3, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Feb 17, 2023
@gjsjohnmurray gjsjohnmurray deleted the fix-155578 branch August 16, 2024 05:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

tree-widget Tree widget issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants