Skip to content
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]: Better offline handling & UX tweaks #21507

Merged
merged 8 commits into from
Jan 10, 2024
Merged

Conversation

fallaciousreasoning
Copy link
Contributor

@fallaciousreasoning fallaciousreasoning commented Jan 8, 2024

Resolves brave/brave-browser#35153
Resolves brave/brave-browser#35155
Resolves brave/brave-browser#35154
Resolves brave/brave-browser#35157

Submitter Checklist:

  • I confirm that no security/privacy review is needed and no other type of reviews are needed, or that I have requested them
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Squashed any review feedback or "fixup" commits before merge, so that history is a record of what happened in the repo, not your PR
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally:
    • npm run test -- brave_browser_tests, npm run test -- brave_unit_tests wiki
    • npm run lint, npm run presubmit wiki, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

Note: When testing this the company VPN should be off, as Brave can't detect the network state and requests hang (this happens for fetch requests from JavaScript too).

  1. Start Brave with no internet
  2. An error message for "You appear to be offline" should show up
  3. Connect
  4. Refresh
  5. Feed should load
  6. Go offline
  7. Change feed (should work fine)
  8. Refresh
  9. Offline message should show
  10. (see individual issues for ux tweaks issues)

@fallaciousreasoning fallaciousreasoning requested a review from a team as a code owner January 8, 2024 02:52
@github-actions github-actions bot added the CI/storybook-url Deploy storybook and provide a unique URL for each build label Jan 8, 2024
@fallaciousreasoning fallaciousreasoning changed the title [Brave News]: Better offline handling [Brave News]: Better offline handling & UX tweaks Jan 8, 2024
@brave-builds
Copy link
Collaborator

A Storybook has been deployed to preview UI for the latest push

Copy link
Collaborator

@mkarolin mkarolin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strings++

Copy link
Contributor

@sangwoo108 sangwoo108 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

components/brave_news/browser/brave_news_controller.h Outdated Show resolved Hide resolved
components/brave_news/common/brave_news.mojom Show resolved Hide resolved
{cards}
<CaughtUp />
</>
? errors[feed.error!] ?? <>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious if this is a hacky way to do the same with

(feed.error && errors[feed.error]) ??

, as errors[null] would be undefined anyway

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly - errors has an exact list of keys it allows, but I wanted to treat it as a map which may or may not have the key. Just felt it read a bit nicer, but happy to change it 😄

@brave-builds
Copy link
Collaborator

A Storybook has been deployed to preview UI for the latest push

@stephendonner
Copy link
Contributor

stephendonner commented Jan 11, 2024

Verification PASSED using

Brave | 1.63.109 Chromium: 120.0.6099.217 (Official Build) nightly (64-bit)
-- | --
Revision | 923ccf5cb23b3696c81c135cddccccbd6db027a2
OS | Windows 10 Version 22H2 (Build 19045.3930)

Case One: brave/brave-browser#35153 - PASSED

Steps:

  1. disabled system Wi-Fi / internet connectivity
  2. installed 1.63.109
  3. launched Brave
  4. confirmed error message for "You appear to be offline" was shown
  5. reconnect to system Wi-FI / internet connectivity
  6. clicked Refresh
  7. confirmed feed loaded
  8. went offline again/disabled system Wi-FI/ internet connectivity
  9. (added CNN and Fox News)
  10. refreshed again

Confirmed Your appear to be offline error message was shown

step 0 step 3 step 4 step 5 step 6 step 7 step 8 step 9
image image image image image image image image

Case Two: brave/brave-browser#35155 - PASSED

(Followed steps from issue, above.)

Checked a couple iterations of the loading spinner and no longer see the square outline

example example
image image
2024-01-11_02h25_11.mp4

Case Three: brave/brave-browser#35154 - PASSED

Steps:

  1. disable system Wi-FI / internet connectivity
  2. install 1.63.109
  3. launch Brave
  4. open a new-tab page
  5. scroll down
  6. click on Turn on Brave News
  7. re-enable Wi-Fi
  8. wait / click Reload / Refresh etc. on the client-side

Confirmed after re-enabling Wi-Fi and clicking Refresh (or browser's Reload button), the content loads/returns

step 0 example step 6 example
image image image image

Case Four: brave/brave-browser#35157 - PASSED

Steps:

  1. install 1.63.109
  2. launch Brave
  3. open a new-tab page
  4. scroll down
  5. click on Turn on Brave News
  6. click Customize
  7. click on Brave News
  8. remove Top Sources
  9. now add at least one (1) each for Channels and Publishers

Confirmed both the Publishers and Channels appear with at least one entry (each), at which point they get the collapse/expand toggle

default populated, with the expand/collapse arrows (CNN) Cars
image image image

Encountered:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/storybook-url Deploy storybook and provide a unique URL for each build
Projects
None yet
5 participants