Skip to content
This repository has been archived by the owner. It is now read-only.

feat (systemaddon): #3147 implement highlights section #3369

Merged
merged 1 commit into from Sep 8, 2017

Conversation

@rlr
Copy link
Contributor

@rlr rlr commented Sep 7, 2017

Fixes #3147
Fixes some of #3155

@@ -203,12 +203,16 @@ function Sections(prevState = INITIAL_STATE.Sections, action) {
let order;
let index;
if (prevState.length > 0) {
order = action.data.order || prevState[0].order - 1;
order = action.data.order !== undefined ? action.data.order : prevState[0].order - 1;

This comment has been minimized.

@k88hudson

k88hudson Sep 7, 2017
Member

Can you add a test for this?

@rlr rlr force-pushed the rlr:gh3147/highlights branch from bf20122 to a6e76b2 Sep 7, 2017
@Mardak
Copy link
Member

@Mardak Mardak commented Sep 7, 2017

First screenshot!
image

@rlr rlr force-pushed the rlr:gh3147/highlights branch from a6e76b2 to 1fde931 Sep 7, 2017
@rlr rlr requested a review from Mardak Sep 7, 2017
@rlr
Copy link
Contributor Author

@rlr rlr commented Sep 7, 2017

@Mardak ok, I think I have it covered decently with tests now. not sure why travis isn't running 🤔 r?

@rlr rlr changed the title [WIP] feat (systemaddon): #3147 implement highlights section feat (systemaddon): #3147 implement highlights section Sep 7, 2017

// Remove any Highlights that are in Top Sites already
const topsites = this.store.getState().TopSites.rows.map(site => site.url);
this.highlights = this.highlights.filter(site => topsites.indexOf(site.url) === -1);

This comment has been minimized.

@Mardak

Mardak Sep 7, 2017
Member

We could use Dedupe here. #3379 Or this is fine for now. Interestingly, because we update highlights when there aren't enough results but not for top sites, recently visited what-would-be-top-site appears as a highlight

id: "highlights",
pref: {
titleString: {id: "settings_pane_highlights_header"},
descString: {id: "settings_pane_highlights_body2"}

This comment has been minimized.

@Mardak

Mardak Sep 7, 2017
Member

I'm guessing section manager doesn't currently support the complex sub pref options, so we can split that out to fully fix #3155.

break;
case at.PLACES_BOOKMARK_ADDED:
case at.PLACES_BOOKMARK_REMOVED:
this.fetchHighlights(false);

This comment has been minimized.

@Mardak

Mardak Sep 7, 2017
Member

I see that we avoid updating the UI here. But the context menu doesn't update either. Perhaps the Section Reducer isn't working correctly? #3378

@Mardak
Mardak approved these changes Sep 7, 2017
Copy link
Member

@Mardak Mardak left a comment

looks to be working! I filed a couple issues that I noticed when testing: #3377 #3378 #3379

case at.NEW_TAB_LOAD:
if (this.highlights.length < HIGHLIGHTS_MAX_LENGTH) {
// If we haven't filled the highlights grid yet, fetch again.
this.fetchHighlights(true);

This comment has been minimized.

@Mardak

Mardak Sep 7, 2017
Member

This broadcast means all open pages get the update. This behavior is different from top sites.

@Mardak Mardak merged commit 50ccd28 into mozilla:master Sep 8, 2017
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@rlr rlr deleted the rlr:gh3147/highlights branch Sep 8, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants