-
Notifications
You must be signed in to change notification settings - Fork 69
search preferences/settings #1036
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
search preferences/settings #1036
Conversation
|
I propose we use the Final result. subtitle: Text(
localSettings[index].name
.replaceFirst('_', '')
.replaceAll(RegExp(r'setting|general|gesture'), '')
.replaceAll('_', ' ')
),@hjiangsu @machinaeZER0 @micahmo thoughts. |
Unfortunately the names are not translated (and neither are the labels). I think we need a more general way to assign the translated label to the setting enum. Then we can also assign a category and sub-category. Once that's done, you can display search results like this:
For an example:
We started a discussion here but it didn't get very far. 😊 P.S. Thank you so much for working on this, it's something I've wanted for a while! |
|
I love this idea! Guess I never noticed this behavior since I hadn't used the search bar for this purpose. We're pretty sure we wouldn't want to take the strings as a stopgap solution, given the translation issue? I do agree that @micahmo 's solution is probably the best final course of action, and if an interim solution would be messier/create unnecessary work then maybe it does make sense to wait. The issue is real, but I guess is more of an annoyance for now? |
I've added that in #1045. This only has mapping for the
{
"defaultFeedType": "Default Feed Type",
"general": "General",
"feedTypeAndSorts": "Default Feed Type and Sorting"
}
enum LocalSettings {
defaultFeedListingType(
name: 'setting_general_default_listing_type',
key: 'defaultFeedType',
categoryKey: 'general',
subcategoryKey: 'feedTypeAndSorts'
);
const LocalSettings({
required this.name,
required this.key,
this.categoryKey,
this.subcategoryKey,
});
}
Here's an example of how you would get a localized string. List<LocalSettings> localSettings = [
LocalSettings.defaultFeedListingType,
LocalSettings.defaultFeedSortType,
...
];
final l10n = AppLocalizations.of(context)!.
Text(l10n.getLocalSettingLocalization(localSettings[0].key)); // Retrieves "Default Feed Type"
Text(l10n.getLocalSettingLocalization(localSettings[0].categoryKey)); // Retrieves "General"
Text(l10n.getLocalSettingLocalization(localSettings[0].subcategoryKey)); // Retrieves "Default Feed Type and Sorting" |
|
Once 1045 Is merged , I'll make the necessary changes. |
It should be merged now! I was just finishing up the first pre-release for 0.2.9 first before merging this one in. |
|
Hey I just tested out this feature. Again, it's super awesome and something I've wanted for a while. Here are a few observations from my testing.
Note that these are just my observations and I haven't reviewed the code yet. Also I'm not asking you to change/fix anything. Just making notes. 😊 |
Im using the default animation provided by the
Its Intentional. e.g On android devices settings.
Currently I don't have a clear way to implement this. I'll need some help.
I reckon this are searchable e.g Comments from the video
This are not in the
Didn't get this. |
Ok if you're using something built-in then there's probably not much you can do about it. 😊
Just for reference, my Android device settings search does not persist the search query (although it does have a history). qemu-system-x86_64_GKSsR0vyU6.mp4
Here is a demo of what I mean. It is odd to me that I can type in the main search widget, since it seems like it's only supposed to open the page. It's even more weird that the text is not in sync. I would say either typing there should not be allowed, or the text should be appended to the page. Another thing that might help is closing the keyboard when navigating back. qemu-system-x86_64_aKiIAKYcZK.mp4 |
|
Thanks for doing this again @ggichure! It looks pretty awesome.
I believe we can split this off for a future enhancement, since it looks like it might take some more work to implement this feature.
Personally, I think we should clear it and reset the state. To me, that makes the most sense since navigating out of the search page means I'm done with changing whatever setting I meant to change in the first place.
I think this is following material's guidelines here: https://m3.material.io/components/search/overview. It looks like the main search text is supposed to be a text hint, rather than a dynamic traditional search bar. Maybe we can make it more apparent by not showing the cursor blink indicator. |
Makes sense! Although see my last video demonstrating how you can type in it. Also, would it make sense to remove the elevation here and on the search page to look a little more material? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just did a really quick review, and provided a couple of comments/feedback!
Screen.Recording.2024-01-24.at.16.58.49.mov |
|
@ggichure I love the latest demo, nice work! 🥳 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now!
@ggichure Is it ready to be merged?
Yes. |
Pull Request Description
Added a way to search through preferences.
Issue Being Fixed
Issue Number: N/A
Screenshots / Recordings
Updated recording
Screen.Recording.2024-01-20.at.16.32.22.mov
Checklist
semanticLabels where applicable for accessibility?