Git Product home page Git Product logo

perspectiveapi-authorship-demo's Issues

Figure out why the javascript binary sizes are so large

Current binary sizes of code compiled with yarn build:prod :

Uncompressed:
-rw-r--r-- 1 rachelrosen primarygroup 5.7k 2018/04/18 15:14:03 build/static/inline.bundle.js
-rw-r--r-- 1 rachelrosen primarygroup 161k 2018/04/18 15:14:03 build/static/main.bundle.js
-rw-r--r-- 1 rachelrosen primarygroup 295k 2018/04/18 15:14:03 build/static/polyfills.bundle.js
-rw-r--r-- 1 rachelrosen primarygroup 57k 2018/04/18 15:14:03 build/static/styles.bundle.js
-rw-r--r-- 1 rachelrosen primarygroup 7.0M 2018/04/18 15:14:03 build/static/vendor.bundle.js

= 7.52 M

Using gzip:
-rw-r--r-- 1 rachelrosen primarygroup 1.6k 2018/04/18 15:14:03 build/static/inline.bundle.js.gz
-rw-r--r-- 1 rachelrosen primarygroup 28k 2018/04/18 15:14:03 build/static/main.bundle.js.gz
-rw-r--r-- 1 rachelrosen primarygroup 62k 2018/04/18 15:14:03 build/static/polyfills.bundle.js.gz
-rw-r--r-- 1 rachelrosen primarygroup 10k 2018/04/18 15:14:03 build/static/styles.bundle.js.gz
-rw-r--r-- 1 rachelrosen primarygroup 1.2M 2018/04/18 15:14:03 build/static/vendor.bundle.js.gz

= 1.3M

Checker icon bug: "Cannot tween null target"

While testing, we've discovered a bug in a specific checker component journey on the Perspective API website.

Repro

  1. Type something into the authorship demo
  2. Click "Seem Wrong?"
  3. Click Yes or No
  4. Click the checker icon, and observe error core.es5.js:1020 ERROR Cannot tween a null target.

References

screenshot 2017-11-17 11 20 02
screenshot 2017-11-17 11 20 04
screenshot 2017-11-17 11 20 07
screenshot 2017-11-17 11 20 09

Need to document gapi requirements

When using gapi directly, the gapi library needs to be included in the top level page so that a global gapi object is defined. Probably need to document this.

That or, maybe have a few different ways to include things that bundle their dependencies with them.

Default use doesn't respect non-english

With default setup, entering:
"bonjour mon ami"

Results in "Error scoring text. Please try again." it should instead say that it only works in english.

We should also provide the component with a way to force language usage too.

Provide a way to clear/reset the state

Sometimes an app that includes a convai-checker component wants to clear the text. If it does this by setting the text value to be empty, convai-checker doesn't know about it. It would be good to have some sensible programatic control of convai-checker from the external component.

Emoji image alt text

Currently the rendered image tag for the emoji has not alt attribute, please provide alt text of emoji type or emoji reaction.

"Learn more" and "Seems wrong" links are not working on the Authorship Widget in the "elements" version

To make the issue happen:
Setup the Perspective Authorship Widget as a webcomponent plugin. Enter some toxic text to see the widget display a score. At this point clicking either the "Learn more" or "Seems wrong" buttons/links will result in an error.

Description of bad behavior observed:
As per Rachel: "The reason for this is because it's not actually a link, it just emits an event. The way this was used on the conversationai website was that the parent angular component would listen for the event and display a popup. We won't have that for the plugin case, so we'll need to add some custom logic to make it a link in that case."

MPM package issues (version specification, and url)

The package.json file specified exact angular versions, but angular uses semantic versioning. This means that attempting to update angular breaks on projects that include the authorship npm package as a dependency.

Suggested fixes:

  • Use semantic versioning (e.g. "^6.0.0" instead of "6.0.0") for package dependencies.
  • Specify the github URL in the package.json file so that the source listing in NPM is correct.

If you can fix and cut a new release, that would be awesome and unblock some downstream projects I have using it.

Using aot compiler breaks the prod build

It gives the error: ERROR in : Type ConvaiChecker in /usr/local/google/home/rachelrosen/git/perspectiveapi-authorship-demo/src/app/convai-checker.component.ts is part of the declarations of 2 modules: ConvaiCheckerModule in /usr/local/google/home/rachelrosen/git/perspectiveapi-authorship-demo/src/app/convai-checker.module.ts and ElementDemoModule in /usr/local/google/home/rachelrosen/git/perspectiveapi-authorship-demo/src/app/element-demo.module.ts! Please consider moving ConvaiChecker in /usr/local/google/home/rachelrosen/git/perspectiveapi-authorship-demo/src/app/convai-checker.component.ts to a higher module that imports ConvaiCheckerModule in /usr/local/google/home/rachelrosen/git/perspectiveapi-authorship-demo/src/app/convai-checker.module.ts and ElementDemoModule in /usr/local/google/home/rachelrosen/git/perspectiveapi-authorship-demo/src/app/element-demo.module.ts. You can also create a new NgModule that exports and includes ConvaiChecker in /usr/local/google/home/rachelrosen/git/perspectiveapi-authorship-demo/src/app/convai-checker.component.ts then import that NgModule in ConvaiCheckerModule in /usr/local/google/home/rachelrosen/git/perspectiveapi-authorship-demo/src/app/convai-checker.module.ts and ElementDemoModule in /usr/local/google/home/rachelrosen/git/perspectiveapi-authorship-demo/src/app/element-demo.module.ts.

Animation gets stuck sometimes

I was playing with the demo locally on my machine and noticed that the animation seems to get stuck and doesn't restart even if more requests are sent. This is possibly a dependency / local build issue as the tests are all still passing, but it needs further investigation.

Add more tests

Test cases needed (this will be added to as I think of more):

-Checking layer state changes and giving feedback while in emoji mode.
-Updates to the gradient color (and checking that the gradient is correct at different positions given different score thresholds).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.