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

Empty Search fix and search edit #408

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ketan2jangid
Copy link
Contributor

These changes makes sure that the user is not able to make empty searches i.e. search for nothing (" ") and also removes leading and trailing spaces from searches, which doesn't look that good (eg below). Beside this, this PR also include change requested in issue #391 and now allows user to edit the searched text by tapping on it.

(A slight change is made in search result header, making the actual searched text bigger and making the 'Search results' text smaller, as it seemed a bit more logical to me to highlight the actual text)

image

Comment on lines +34 to +56
GestureDetector(
onTap: () {
searchScreenController.textInputController.text =
searchResScrController.queryString.value;
Navigator.pop(context);
},
child: Column(
children: [
Align(
alignment: Alignment.centerLeft,
child: Text(
"searchRes".tr,
style: Theme.of(context).textTheme.titleMedium,
),
),
Align(
alignment: Alignment.centerLeft,
child: Text(
"${"for1".tr} \"${searchResScrController.queryString.value}\"",
style: Theme.of(context).textTheme.titleLarge,
),
),
],
Copy link
Owner

@anandnet anandnet Jan 23, 2025

Choose a reason for hiding this comment

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

i think, it is not a good idea to add event on Search result, please keep this part as it was before. many persons also want fields should be cleared after search, & we already have search history implemented.

Copy link
Owner

Choose a reason for hiding this comment

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

If the intention is to edit search string, you can add event only on searched string. So that if any of user want to edit he can be able to do that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The intention behind this change is to enable users to directly edit the searched text so that the user does not need to rewrite the text and directly make changes in the searched text. As of now users can only go back and need to retype the text, which isn't a pleasant experience (from my experience as a user). To enable this, I have made this change.

Also the intention behind increasing searched text font size and making the header also tap-able is to increase the touch area, as the user will only hit it when he needs to make change in the entered text, else he can directly go back.
Do let me know if I should revert these changes or make some other changes.

Thanks

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

Successfully merging this pull request may close these issues.

2 participants