-
Notifications
You must be signed in to change notification settings - Fork 900
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
[Brave News]: Update to new locale format #15681
Conversation
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.
Everything looks great and seems to work well - just few pieces of feedback here.
There's a build error in Storybook due to stories/today.tsx
which is still providing a string array for the locales
field of a Publisher
.
! [tsl] ERROR in /Users/jenkins/jenkins/workspace/pr-brave-browser-bn-locale-parsing-macos/src/brave/components/brave_new_tab_ui/stories/today.tsx(59,19)
[2022-10-27T02:03:28.456Z] ERR! TS2322: Type 'string' is not assignable to type 'LocaleInfo'.
@@ -110,12 +111,17 @@ export const useBraveNews = () => { | |||
export const useChannels = (options: { subscribedOnly: boolean } = { subscribedOnly: false }) => { | |||
const { channels } = useBraveNews() | |||
return useMemo(() => Object.values(channels) | |||
.filter(c => c.subscribed || !options.subscribedOnly), [channels, options.subscribedOnly]) | |||
.filter(c => c.subscribedLocales.length || !options.subscribedOnly), [channels, options.subscribedOnly]) |
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.
Is this going to result in displaying all global channels in the initial screen of the Discover section? If so, I think we need to filter to the "current" locale.
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.
So this is used by the sidebar to ensure we show channels the user has subscribed to in all locales. Thinking about it though, I think we're already showing all channels in all locales (because the channels system just gets all channels from all publishers).
I think (as the system already works like this) we should fix it in a separate PR, as we can't land Rana's backend changes until this is ready.
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.
I've filed this issue:
brave/brave-browser#26385
c56f2ab
to
79dcc1f
Compare
@petemill could you PTAL. I fixed the storybook issues added by this PR but I think something in rewards is also broken on master. I had a quick look at fixing it, but there's some prod code which is breaking the Storybook build, and I wasn't sure how to fix it (on this line, https://github.com/brave/brave-core/blob/master/components/brave_vpn/resources/panel/state/store.ts#L47 observer should be implementing |
A Storybook has been deployed to preview UI for the latest push |
e95eb18
to
0677b41
Compare
SonarCloud is only complaining about code duplication in the storybook story. I have again attempted to re-configure SonarCloud to ignore this, but we can't re-run without pushing again and that would interrupt the rest of CI. So if the rest passes then we can force merge. |
A Storybook has been deployed to preview UI for the latest push |
2d5b9bc
to
7e28e06
Compare
A Storybook has been deployed to preview UI for the latest push |
7e28e06
to
791d600
Compare
A Storybook has been deployed to preview UI for the latest push |
@fallaciousreasoning Please uplift to 1.46.x when you get a chance |
Verified
|
Brave | 1.47.36 Chromium: 107.0.5304.91 (Official Build) nightly (x86_64) |
---|---|
Revision | 3d5948960d62418160796d5831a4d2d7d6c90fa8-refs/branch-heads/5304@{#1097} |
OS | macOS Version 11.7.1 (Build 20G918) |
Steps:
- installed
1.47.36
- launched Brave
- opened
brave://flags
- set
brave://flags/#brave-news-v2
toEnabled
- ran from the commandline:
--brave-today-host=brave-today-cdn.bravesoftware.com
- opened a new-tab page
- clicked on
Customize
- clicked on
Turn on Brave News
- typed
cnn
- examined the results
Confirmed I only saw one CNN
source on staging (brave-today-cdn.bravesoftware.com
)
Uplift is here #15749 |
[Uplift] [Brave News]: Update to new locale format (#15681)
Resolves brave/brave-browser#26259
Note: This is backwards compatible with the old locales format. I've filed brave/brave-browser#26307 so we can remove the backwards compatible bit once we update the API.
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
,npm run lint
,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan:
Brave News V2 should work the same as before