Add support for multiple views on Shields#2874
Conversation
b5772d8 to
50f01c1
Compare
karenkliu
left a comment
There was a problem hiding this comment.
Hi @cezaraugusto! This looks good, but I was wondering if there was any way we could fit in these last minute small changes to this PR:
If not, could we please get this in for the next build?
close brave/brave-browser#4953 Shields state needed across windows/tabs is not stored in localStorage API. This follows the webUI convention for persistent state. Goal is to provide a way to handle upcoming changes such as onboarding screen and simple/advanced view setting. Other state such as stats, resources blocked, and blocking preferences are still handled by the back-end and are left untouched.
|
@karenkliu updated |
| type: windowTypes.WINDOW_REMOVED, | ||
| windowId | ||
| }) | ||
| }) |
| it('updates the currentWindowId', () => { | ||
| expect(shieldsPanelState.updateFocusedWindow(state, 2)).toEqual({ | ||
| currentWindowId: 2, | ||
| persistentData: { |
There was a problem hiding this comment.
nit: this all seems quite repetitive! Perhaps a function getDefaultState would remove the need to copy and keep in sync amongst the tests, next time we need to update this :-)
There was a problem hiding this comment.
are you ok if we address this in a follow-up? I've been looking to re-work some shields tests for a while, can add this as well
There was a problem hiding this comment.
Absolutely, it was just a comment
bsclifton
left a comment
There was a problem hiding this comment.
Comments left about spelling - pulled down locally, works great! 😄 I made sure to try toggling the views, going to the learn more view, and also quitting/re-opening/browsing other domains to make sure view choice was retained
Great work here! 😄 👍

close brave/brave-browser#1196
close brave/brave-browser#4953
see https://brave-ui-4200l5i5w.now.sh/?path=/story/feature-components-shields--panel
Test Plan
See brave/brave-browser#1196 for design spec
Submitter Checklist:
npm run lint)git rebase master(if needed).git rebase -ito squash commits (if needed).Test Plan:
Reviewer Checklist:
After-merge Checklist:
changes has landed on.