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

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

@piatra piatra force-pushed the bookmark-panel-refactor branch from c171c4b to 15fe30a Compare July 30, 2019 08:52
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