-
Notifications
You must be signed in to change notification settings - Fork 886
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
Add support for multiple views on Shields #2874
Conversation
b5772d8
to
50f01c1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
@@ -121,7 +121,7 @@ describe('cosmeticFilterReducer', () => { | |||
shieldsPanelReducer(initialState.shieldsPanel, { | |||
type: windowTypes.WINDOW_REMOVED, | |||
windowId | |||
}) | |||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: whitespace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
@@ -196,6 +226,9 @@ describe('shieldsPanelState test', () => { | |||
it('updates the currentWindowId', () => { | |||
expect(shieldsPanelState.updateFocusedWindow(state, 2)).toEqual({ | |||
currentWindowId: 2, | |||
persistentData: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely, it was just a comment
components/brave_extension/extension/brave_extension/_locales/en_US/messages.json
Outdated
Show resolved
Hide resolved
components/brave_extension/extension/brave_extension/_locales/en_US/messages.json
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 -i
to squash commits (if needed).Test Plan:
Reviewer Checklist:
After-merge Checklist:
changes has landed on.