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

Improve topsite tiles in NTP #7859

Merged
merged 1 commit into from
Mar 2, 2021
Merged

Improve topsite tiles in NTP #7859

merged 1 commit into from
Mar 2, 2021

Conversation

simonhong
Copy link
Member

@simonhong simonhong commented Feb 8, 2021

fix brave/brave-browser#7493
fix brave/brave-browser#13881

image
image
Screenshot from 2021-02-17 14-44-09
image

image
image

Submitter Checklist:

  • There is a ticket for my issue.
  • Used Github auto-closing keywords in the commit message.
  • Wrote a good PR/commit description
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally: npm run test -- brave_browser_tests, npm run test -- brave_unit_tests, npm run lint, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed).
  • Requested a security/privacy review as needed.

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

In frequency mode, max tile number is 6 and add tile button is not displayed.
In favorites mode, 12 tiles are visible at most and add tile button is only visible when hover to top site tiles.
In favorites mode, add tile button is always visible if there is no tile.
Edit menu on tile always have two items - edit and delete.
When tile is edited or added, current mode is changed to favorites.

Full spec available at https://github.com/brave/internal/issues/754

@simonhong simonhong self-assigned this Feb 8, 2021
@simonhong simonhong force-pushed the topsite_edit branch 19 times, most recently from c7ec590 to 365270a Compare February 19, 2021 08:58
@simonhong simonhong marked this pull request as ready for review February 19, 2021 09:35
@simonhong simonhong requested a review from a team as a code owner February 19, 2021 09:35
@simonhong simonhong changed the title WIP: Improve topsite tiles in NTP Improve topsite tiles in NTP Feb 20, 2021
Copy link
Member

@bsclifton bsclifton left a comment

Choose a reason for hiding this comment

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

Awesome work here! I'm sure this ended up being more JavaScript than you had expected 😄

Everything I saw looks great - would be good to solve the concern by @petemill RE: dark mode (so that it happens automatically, detected in media query). Thanks for following up on all the feedback @karenkliu had too - the text under the icons is a beautiful touch

@simonhong
Copy link
Member Author

simonhong commented Feb 25, 2021

I found that it's switched to favorites mode but edited item is not visible in favorites mode. checking. => Fixed

Switch to Favorites
  The Top Sites widget switches to user-curated Favorites if the user manually customizes Top Sites:
      Edits a frequently visited site and puts in a site of their own choosing

@simonhong simonhong added CI/skip Do not run CI builds (except noplatform) and removed CI/skip Do not run CI builds (except noplatform) labels Feb 25, 2021
@simonhong simonhong force-pushed the topsite_edit branch 2 times, most recently from f34c943 to 60320aa Compare February 25, 2021 08:09
@simonhong
Copy link
Member Author

@karenkliu @petemill PTAL again.

#include "url/gurl.h"

std::string GetValidURLStringForTopSite(const std::string& url) {
return GURL(url).is_valid() ? url : "https://" + url;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This check is incomplete. You should re-verify that the url is valid after appending https

Copy link
Member Author

Choose a reason for hiding this comment

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

Added verification after fixing url here. If fixed url is not valid, that item will not be added/modified with passed url.

Copy link
Collaborator

@bridiver bridiver left a comment

Choose a reason for hiding this comment

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

deps/chromium_src ok

@karenkliu
Copy link

@simonhong did an amazing job fixing everything outlined in #7859 (review). The only thing we should do in a follow up is clean up top sites hover area to fix the the 'Add site' tile flicker. It sounds like it's a wrapping area issue that needs some refactoring.

add site tile hover

@simonhong
Copy link
Member Author

@simonhong did an amazing job fixing everything outlined in #7859 (review). The only thing we should do in a follow up is clean up top sites hover area to fix the the 'Add site' tile flicker. It sounds like it's a wrapping area issue that needs some refactoring.

add site tile hover

@karenkliu Add button flickering is a little bit improved. Only flicked when hovered over menu button.
addtile_flickering

Copy link
Member

@petemill petemill left a comment

Choose a reason for hiding this comment

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

Thanks for addressing a lot of the feedback, this continues to work great. Still a couple of things, including an important accessibility issue, that we can fix in follow-up. We can keep a list here, if possible. Also is there any chance of squashing some of the commits - 40 seems a lot and many of them seem to be fixes that can be amended.

* Adjust max topsite tiles number to 12
* Can add/edit topsites from NTP
* Can toggle favorites and frecency mode from NTP customization option

fix brave/brave-browser#7493
@simonhong
Copy link
Member Author

Merged because only audit-dps is failed from post-init and it's known issue.

@simonhong simonhong merged commit 43ab1ab into master Mar 2, 2021
@simonhong simonhong deleted the topsite_edit branch March 2, 2021 04:00
@Vantiveman
Copy link

Is this released? I have the latest version and I don't have this yet. Perhaps not yet rolled out.......

@simonhong simonhong added this to the 1.23.x - Nightly milestone Mar 3, 2021
@simonhong
Copy link
Member Author

@Vantiveman This is available in nightly (1.23.x) now.

@Vantiveman
Copy link

Vantiveman commented Mar 3, 2021 via email

@simonhong
Copy link
Member Author

@Vantiveman Yes, https://brave.com/download-nightly/ is for you :)

@MamaCoop452
Copy link

I'm truly confused. Sorry, I get how it should be able to be done, but that is not what I see when I open a new tab. Am I missing something? Are you really telling me that I need to redownload this every night in order to get these new updates?
customizedashboard

@simonhong
Copy link
Member Author

@MamaCoop452 I assume you're using brave stable channel. If so, this fix will be available for you when 1.23.x becomes stable version.
Currently, this is only available nightly channel (1.23.x). If you want to test this feature in advance, I recommend to install nightly(via https://brave.com/download-nightly).

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.

"Brave Web Store" in brave://apps Be able to edit and add "top sites" shown on the Dashboard (new tab page)
7 participants