Skip to content
This repository has been archived by the owner on Feb 29, 2020. It is now read-only.

Bookmark panel refactor #5203

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

piatra
Copy link
Contributor

@piatra piatra commented Jul 26, 2019

After the PR to adjust the panel height #5172 I realized there are some things that can be improved for the BookmarkPanelHub.
Specifically we were keeping around a reference to the window and document where the bookmark action happened and we were using this in most of the code. It made it very difficult to test and to mock for ASRAdmin. I find it clearer to pass the window object as argument to the function.

I combined this with another asrouter admin request: open the bookmark panel when previewing the message.
And this works with preview endpoints without any code change (and it opens the panel automatically when you navigate to the url)
To test:

Pref name Pref value
browser.newtab.activity-stream.asrouter.whitelistHosts ["gist.githubusercontent.com"]

Test url
about:newtab?endpoint=https://gist.githubusercontent.com/piatra/d193ca7e0f513cc19fc6a1d396c214f7/raw/a9d815080912078008613cc476a197034c998013/bookmark_endpoint.json

Preview
image

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

Successfully merging this pull request may close these issues.

1 participant