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

Add webcompat issue reporting dialog #3420

Merged
merged 5 commits into from
Nov 27, 2019
Merged

Add webcompat issue reporting dialog #3420

merged 5 commits into from
Nov 27, 2019

Conversation

antonok-edm
Copy link
Collaborator

@antonok-edm antonok-edm commented Sep 12, 2019

Implements a new modal dialog for reporting web compatibility issues, as detailed here.

Closes brave/brave-browser#4262.

Includes content originally proposed in brave/brave-ui#532.

Depends on brave/brave-ui#542 for correct theme elements in dark mode.
Required brave-ui changes have been merged into brave-core via #4063.

Depends on brave/brave-browser#6550 for build-time npm webcompat report API endpoint config option.

Submitter Checklist:

Test Plan:

There doesn't appear to be any automated way to test behavior as it propagates from the browser to a modal dialog and back; and the dialog is trivial enough to just toggle a boolean state variable and pass along a message to the browser once again.

There is a new storybook story added for visual inspection of the webcompat reporter modal.

Recommend manually confirming network request contents when submitting a report on a dev build.

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

After-merge Checklist:

  • The associated issue milestone is set to the smallest version that the
    changes has landed on.
  • All relevant documentation has been updated.

Copy link
Member

@petemill petemill left a comment

Choose a reason for hiding this comment

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

This is great - a nice, clean, end-to-end solution! I haven't run the build to fully test, so not approving yet, but thought I'd leave feedback from reading through the code.

components/brave_webcompat_reporter_ui/screens/app.tsx Outdated Show resolved Hide resolved

void WebcompatReporterDOMHandler::RegisterMessages() {
web_ui()->RegisterMessageCallback(
"brave_webcompat_reporter.submitReport",
Copy link
Member

Choose a reason for hiding this comment

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

might want to call this submitWebcompatReporterReport if there's an issue with removing the brave_webcompat_reporter global object.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think it's just for namespacing purposes, it's sent by chrome.send('brave_webcompat_reporter.submitReport', ...).

It still works fine after removing the window.cr.define('brave_webcompat_reporter' ...) call, if that's what you're referring to.

@antonok-edm antonok-edm force-pushed the webcompatreporter branch 6 times, most recently from ae0a0dc to f9fff47 Compare September 20, 2019 01:56
@antonok-edm
Copy link
Collaborator Author

Just pushed one more commit which adds a 'Report a Broken Site' option in the Help menu for MacOS, per feedback from @alexwykoff.

Comment on lines 42 to 43
padding: 0;
background: transparent;
Copy link
Member

Choose a reason for hiding this comment

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

padding and background are transparent by default for p

import DarkTheme from 'brave-ui/theme/brave-dark'
import BraveCoreThemeProvider from '../../common/BraveCoreThemeProvider'
require('../../fonts/muli.css')
require('../../fonts/poppins.css')
Copy link
Member

Choose a reason for hiding this comment

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

These files were moved on master, unfortunately. You'll find them somewhere like brave/ui/webui/fonts

Copy link
Member

@petemill petemill left a comment

Choose a reason for hiding this comment

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

🍾 LGTM at least for front-end. Let's wait until CI finishes due to the changes

void WebcompatReporterService::SubmitReport(std::string report_domain) {
std::string api_key = brave::GetAPIKey();

std::unique_ptr<base::Environment> env(base::Environment::Create());
Copy link
Collaborator

Choose a reason for hiding this comment

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

this doesn't appear to be used for anything

content::WebContents* web_contents =
browser->tab_strip_model()->GetActiveWebContents();
// |web_contents| can be nullptr if the last tab in the browser was closed
// but the browser wasn't closed yet. https://crbug.com/799668
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think it makes sense to reference a bug for GetURLAndTitleToBookmark here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fair, I just found this in the code for the bookmarks and figured it might still be a relevant warning. I'll remove the comment

@antonok-edm antonok-edm force-pushed the webcompatreporter branch 2 times, most recently from 4bef257 to f22950e Compare November 26, 2019 18:33
@mbacchi mbacchi added CI/skip-android Do not run CI builds for Android CI/skip-ios Do not run CI builds for iOS CI/skip-linux labels Nov 27, 2019
@antonok-edm antonok-edm merged commit 2503c7e into master Nov 27, 2019
@antonok-edm antonok-edm deleted the webcompatreporter branch November 27, 2019 19:40
@bsclifton bsclifton added this to the 1.3.x - Dev milestone Dec 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/skip-android Do not run CI builds for Android CI/skip-ios Do not run CI builds for iOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable self-reported webcompat issues when Shields is DOWN
7 participants