Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browser's "Choose class" dialog does not work with exact searches #17140

Closed
hernanmd opened this issue Sep 19, 2024 · 11 comments
Closed

Browser's "Choose class" dialog does not work with exact searches #17140

hernanmd opened this issue Sep 19, 2024 · 11 comments

Comments

@hernanmd
Copy link
Member

Bug description
The new "Choose class" dialog implemented in ClyFindClassCommand does not do exact matches, and there is no way to tell that I want to search using exact matches.

For instance, If I write "Object" I want "Object" and not "CmObject" :)

To Reproduce
See the following video:

2024-09-19.23-43-43.mp4

Expected development cost
There is already an implementation of multiple types of matching in the NewFinder. It could be refactored in a new package to be used in the Choose class window. That would need a PR in NewTools so it can include the refactored package.

@hernanmd
Copy link
Member Author

In pharo-spec/NewTools#845

@Rinzwind
Copy link
Contributor

I agree with wanting to get the class Object and not the class CmObject when looking for “Object”. But in the demo in NewTools pull request #845 it seems you would still need to select the ‘exact’ option for that. Whereas in Pharo 12 there’s no need for an extra click: you get Object when you type “Object” and just press the return key. A problem in Pharo 12 though is that it’s not always clear whether there’s an exact match or not: issue #13720. That could be solved by scrolling the list to the exact match when there is one, or by putting it first in the list. The ‘ok’ button should probably also be disabled when no class is selected.

@hernanmd
Copy link
Member Author

I agree with wanting to get the class Object and not the class CmObject when looking for “Object”. But in the demo in NewTools pull request #845 it seems you would still need to select the ‘exact’ option for that. Whereas in Pharo 12 there’s no need for an extra click: you get Object when you type “Object” and just press the return key. A problem in Pharo 12 though is that it’s not always clear whether there’s an exact match or not: issue #13720. That could be solved by scrolling the list to the exact match when there is one, or by putting it first in the list. The ‘ok’ button should probably also be disabled when no class is selected.

Thanks for the feedback. I will try to implement your suggestions in another PR

@hernanmd
Copy link
Member Author

I agree with wanting to get the class Object and not the class CmObject when looking for “Object”. But in the demo in NewTools pull request #845 it seems you would still need to select the ‘exact’ option for that. Whereas in Pharo 12 there’s no need for an extra click: you get Object when you type “Object” and just press the return key. A problem in Pharo 12 though is that it’s not always clear whether there’s an exact match or not: issue #13720. That could be solved by scrolling the list to the exact match when there is one, or by putting it first in the list. The ‘ok’ button should probably also be disabled when no class is selected.

Thanks for the feedback. I will try to implement your suggestions in another PR

I updated the PR in pharo-spec/NewTools#845 to handle auto-selection when the typed class exists.

@Ducasse
Copy link
Member

Ducasse commented Sep 26, 2024

So do we close this issue?

@hernanmd
Copy link
Member Author

Already integrated, so I closed it

@Rinzwind
Copy link
Contributor

Rinzwind commented Sep 28, 2024

Thanks! A few comments I still have though:

  • The result list only gets updated when the text field is edited, not when any of the options are changed
  • The ‘Ok’ button remains enabled when there are no results
  • The label ‘Case’ should probably be ‘Case sensitive’
  • I’m not sure the ‘Exact’ option is useful anymore now that ‘Substring’ will select an exact match if there is one (removing it would also avoid the next point)
  • The spacing between the radio buttons makes it seem as if the grouping is ‘Substring’ and ‘Regexp / Exact’ rather than ‘Substring / Regexp / Exact’
  • The result list should preferably be updated through a background process to avoid delay in the handling of keystrokes while typing in the text field (which is especially noticeable now when using ‘Regexp’)
  • When using ‘Regexp’, a debugger is opened when trying to enter ‘test[a-c]’ in the text field due to a RegexSyntaxError (“no terminating "]"”)

@Ducasse
Copy link
Member

Ducasse commented Sep 29, 2024

@hernanmd may be better to open another issue.

@Rinzwind
Copy link
Contributor

@hernanmd: I was wondering whether you’ve opened another issue as suggested above? The last point, about the RegexSyntaxError, should probably be handled at least.

@hernanmd
Copy link
Member Author

@Rinzwind the error belongs to Spec, so I opened an issue there (working on a PR now)
pharo-spec/Spec#1633

@hernanmd
Copy link
Member Author

@Rinzwind Please open issues in the Spec repository, so people can discuss it there. For the Regex bug I sent a PR pharo-spec/Spec#1635

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants