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

[GSoC'24] Highlight selected preference setting #16368

Merged
merged 1 commit into from
May 23, 2024

Conversation

SanjaySargam
Copy link
Contributor

@SanjaySargam SanjaySargam commented May 10, 2024

Purpose / Description

In tablet mode, the selected settings preference category is not highlighted. It would be better if we highlight the preference to have better user experience.

Approach

Highlight GeneralSettings preference as default
use onPreferenceTreeClick function and remove highlight from previously selected preference and highlight the current preference

How Has This Been Tested?

Emulator

highlight.mp4

Chromebook
Screen recording 2024-05-19 11.47.35.webm

Checklist

Please, go through these checks before submitting the PR.

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

Copy link
Member

@BrayanDSO BrayanDSO left a comment

Choose a reason for hiding this comment

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

Haven't tested, but I think that this doesn't handle configuration changes (e.g. toggling night mode)

@BrayanDSO BrayanDSO added the Needs Author Reply Waiting for a reply from the original author label May 10, 2024
@SanjaySargam
Copy link
Contributor Author

It handles, I consider highlighting in night mode too

@BrayanDSO
Copy link
Member

BrayanDSO commented May 10, 2024

Tested it myself, and it doesn't.

  1. Use a tablet/large screen device
  2. Open settings
  3. Choose a section other than General
  4. Toggle system's night mode

Result: General is highlighted instead of the active preference


Also, please avoid deleting your own comments. Editing is a more healthy choice for discussions.

@SanjaySargam
Copy link
Contributor Author

Now I understood what you said. Sorry I didn't test this. I'll make changes accordingly.

Also, please avoid deleting your own comments. Editing is a more healthy choice for discussions

Ok will take care of this from next time

@SanjaySargam SanjaySargam requested a review from BrayanDSO May 11, 2024 06:12
@BrayanDSO BrayanDSO added Needs Review and removed Needs Author Reply Waiting for a reply from the original author labels May 11, 2024
@criticalAY criticalAY added the GSoC Pull requests authored by a Google Summer of Code participant [Candidate/Selected], for GSoC mentors label May 11, 2024
Copy link
Member

@lukstbit lukstbit left a comment

Choose a reason for hiding this comment

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

The current code has two issues:

  • on phones(where the majority of our users are) the highlight shouldn't appear as it looks weird. You could fix this by making the Preferences.hasLateralNavigation() method public and then checking its status in highlightHeaderPreference() and return immediately if false(on phones).
  • second issue: tablet on any orientation -> highlight one preference -> rotate the tablet -> highlight is gone

@lukstbit lukstbit added Needs Author Reply Waiting for a reply from the original author and removed Needs Review labels May 13, 2024
@SanjaySargam
Copy link
Contributor Author

on phones(where the majority of our users are) the highlight shouldn't appear as it looks weird. You could fix this by making the Preferences.hasLateralNavigation() method public and then checking its status in highlightHeaderPreference() and return immediately if false(on phones).

hasLateralNavigation function is not included in companion object so we can't access even if we make it public

Copy link
Member

@lukstbit lukstbit left a comment

Choose a reason for hiding this comment

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

LGTM if it includes the change below.

@lukstbit lukstbit added the Needs Second Approval Has one approval, one more approval to merge label May 17, 2024
@lukstbit lukstbit removed the Needs Author Reply Waiting for a reply from the original author label May 18, 2024
@SanjaySargam SanjaySargam changed the title Highlight selected preference setting [GSoC'24] Highlight selected preference setting May 18, 2024
@SanjaySargam
Copy link
Contributor Author

Also tested on Chromebook

Copy link
Member

@david-allison david-allison left a comment

Choose a reason for hiding this comment

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

minor nitpicks, should be good to go next round

@david-allison david-allison added the Needs Author Reply Waiting for a reply from the original author label May 22, 2024
Copy link
Member

@david-allison david-allison left a comment

Choose a reason for hiding this comment

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

Cheers!

@david-allison david-allison removed Needs Author Reply Waiting for a reply from the original author Needs Second Approval Has one approval, one more approval to merge labels May 23, 2024
@david-allison david-allison added the Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) label May 23, 2024
@david-allison david-allison added this pull request to the merge queue May 23, 2024
Merged via the queue into ankidroid:main with commit e605223 May 23, 2024
6 checks passed
@github-actions github-actions bot added this to the 2.19 release milestone May 23, 2024
@github-actions github-actions bot removed the Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) label May 23, 2024
Copy link
Contributor

Hi there @SanjaySargam! This is the OpenCollective Notice for PRs merged from 2024-05-01 through 2024-05-31

If you are interested in compensation for this work, the process with details is here:

https://github.com/ankidroid/Anki-Android/wiki/OpenCollective-Payment-Process#how-to-get-paid

Important

PLEASE NOTE: The process was updated in August 2024. Re-read the Payment Process page if you have not already.

We only post one comment per person per month to avoid spamming you, regardless of the number of PRs merged, but this note applies to all PRs merged for this month

Please understand that our monthly budget is never guaranteed to cover all claims - the cap on payments-per-person may be lower, but we try to make our process as fair and transparent as possible, we just need your understanding.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GSoC Pull requests authored by a Google Summer of Code participant [Candidate/Selected], for GSoC mentors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants