Git Product home page Git Product logo

webapp-tp's People

Contributors

0xferit avatar gratestas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

webapp-tp's Issues

Fix Flash of Unstyled Content issue

listArticles component calls setFetchingArticlesContents(false); inside useEffect but since it's not synchronous, false value comes late so this statement causes the FOUC.

We could make setFetchingArticlesContents(false); synchronous to solve this issue, somehow. This article might help.

Longpolling

https://github.com/proveuswrong/webapp-news/blob/9bb0fadb695dd741d82d46920302abbc8503e426/src/data/ethereumProvider.jsx#L60

As in the above statement, we are long-polling the block number from Graph to decide whether the content is old and needs refreshing, like in the statement below:

https://github.com/proveuswrong/webapp-news/blob/9bb0fadb695dd741d82d46920302abbc8503e426/src/routes/browse/index.jsx#L24

This does not make sense. Because before we make an HTTP request to Graph to fetch new data, we ask if there is new data, and to be able to ask, we make an HTTP request, which eliminates the cause (of minimizing HTTP requests). So why was this done? Because initially, we were listening to block numbers from a Web3 provider, but then we realized if none was provided, the web app won't be able to work properly. It seems we switched to pulling block data from Graph to fix this issue.

Alternatives for a solution:

  • Assume a Web3 connection will be provided by the user. I don't like this.
  • Provide a Web3 connection, like Infura or Alchemy, through env vars to guarantee the connection.
  • Instead of long-polling for block number, long poll for actual content to eliminate unnecessary HTTP requests.
  • Should each query have its own last-fetched time? Or should we keep a global constant? If each component keeps its own, then which one will SyncStatus show?

The last option seems the best. However, refactoring is not easy. Things to consider:

  • SyncStatus component relies on block numbers from Graph metadata.
  • Many components rely on block numbers from Graph metadata via their useEffect hooks. Their dependency array contains this block number variable, so when it changes, a new query is made to the Graph endpoint.

Ideally, we should do an initial fetch and save this timestamp. And keep track of the time delta between now and the last fetch to trigger a new fetch.

Fixing this issue will reduce the number of queries (to Subgraph) to half. This is not important now since we are on testnet, but will be important when we launch on Mainnet since we will be paying for each query.

Refactor Data Layer

Functions which provide access to data, such as getAllMetaEvidences, which acts as an interface for components, should not take chainID or contractInstances as an argument. The data layer already provides the Ethereum context, so it should work without pointing to the context again.

Add `Account` Page

This page should display user-related data. At this point, displaying all articles reported by the account address is enough.

Add Increase Bounty Modal

The modal below should be rendered when the Double Bounty button is clicked ( Article route page)

image

Don't horizontally pad list items in the narrow layout

Don't horizontally pad list items in the narrow layout where there is no frame around items. When there is no frame, horizontal padding does not help items to look good, and also in narrow layout page sides look too thick.

Refactor `Header` component

The Header component currently includes a combination of JavaScript and CSS code to enable simple animations, but this approach is not the most efficient.

To improve the quality of the code and promote simplicity and readability, refactoring is needed.
Note: consider separating nav and header

Fix Namings

claim is actually and article, for example. There are many instances of these inappropriate namings.

Add `Court` Page

The value of Arbitrator field within the Arbitration Details section should be a link to the Court Page. This page should include all relevant information about the court

  • name
  • id
  • policy
  • times per period

put on hold

  • arbitration fee
  • parent courts
  • active jurors
  • the number of disputes in the last month

Implement Dispute Flow

Mockups

  • Evidence period
  • Voting period
  • Appeal period

See visual design here.

Implementation

  • Period tracking
  • Evidence submission
  • #47
  • Fetch Appeal data from subgraph
  • Fetch Voting data from subgraph
  • Pass arbitrator period
  • Execute arbitrator ruling
  • Draw jury

Dispute: Execution Period updates

  • Mark the Execution item of Timeline as checked when the ruling is executed
  • Display an informative message in the rewards field when a connected account has not contributed

FIx data formatting in `EventLog` Modal

  • Contribution - character encoding issue
  • Rewards Withdrawal - ignore
  • Evidence - ipfs uri (must be fetched data)
  • ArticleWithdrawal -> Article Unpublished (?) & last calculated score (?)
  • TimelockStarted - unformatted UNIX timestamp

image
image

Fix bounty tooltip: `NaN blocks ago`

The value of blocks in the tooltip of the bounty has become undefined, most likely due to a variable name issue resulting from recent subgraph updates.

Implement a Git Hook to Prevent Pushing from Some Branches to Others

I'm no longer the sole programmer in this project, so the need for a more sophisticated workflow has emerged. Implementing a workflow like this will let us do more testing before jumping to the production environment.

Implementing such workflow requires preventing pushes to the production branch except for whitelisted branches. For example, we should only let pushes to production from staging or hotfix branches. AFAIK, Github does not have such a branch protection rule option. The other option to implement this restriction is doing it directly within Git, using hooks.

Example scenario to implement: Prevent pushes to main, except from dev or hotfix/* (note that * is a RegEx wildcard here).

Help wanted. Up for grabs.

Handle Bad Item Routes

Refactor out claim component from claim route. Implement handling in the route component.

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.