Skip to content
This repository has been archived by the owner on Feb 2, 2024. It is now read-only.

[Solvers] Settlements Table #235

Merged
merged 18 commits into from
Oct 25, 2022
Merged

[Solvers] Settlements Table #235

merged 18 commits into from
Oct 25, 2022

Conversation

matextrem
Copy link
Contributor

Summary

Closes #234

Added Settlements table in Solvers page

Screen Shot 2022-10-05 at 20 19 02

To Test

  1. Open the page solvers . You can use the header menu to navigate.
  2. Click on Settlements tab
    • You'll see the settlements table.

Notes: For ETH cost, we need some Subgraph PR to be merged first before we can get that info into the table.

@coveralls
Copy link

coveralls commented Oct 5, 2022

Pull Request Test Coverage Report for Build 3201733554

  • 14 of 18 (77.78%) changed or added relevant lines in 11 files are covered.
  • 68 unchanged lines in 5 files lost coverage.
  • Overall coverage increased (+0.04%) to 43.756%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/api/weth/WethApi.ts 1 2 50.0%
src/state/network/updater.tsx 1 2 50.0%
src/utils/walletconnectOptions.ts 0 1 0.0%
src/utils/wrap.ts 1 2 50.0%
Files with Coverage Reduction New Missed Lines %
src/api/wallet/WalletApiMock.ts 2 45.31%
src/api/web3/index.ts 5 72.73%
src/const.ts 15 81.62%
src/state/network/updater.tsx 16 32.05%
src/services/factories/tokenList.ts 30 4.8%
Totals Coverage Status
Change from base Build 3182895464: 0.04%
Covered Lines: 2214
Relevant Lines: 4286

💛 - Coveralls

@github-actions
Copy link

github-actions bot commented Oct 5, 2022

Copy link
Contributor

@ramirotw ramirotw left a comment

Choose a reason for hiding this comment

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

Looking good.

A few things:

  1. Change the base branch to 221/active-solvers so the commits are cleaned
  2. Lets hide for now the ETH cost column as we don't have that value from the subgraph
  3. The Tx hash link should go to the Transaction details page not Etherscan

@elena-zh
Copy link

elena-zh commented Oct 6, 2022

Hey @matextrem , great job!

Some my issues:

  1. The table shows only 100 settlements in each network. Is this OK?
  2. It would be great not to navigate users to the Home page when switch networks (added this case to Do not navigate to Home page when switch network from Solvers page #230 )
  3. Values in columns are not aligned on a reduced screen:
    not aligned
  4. Maybe we should make token icons clickable (and add navigation links to blockexplorer), and more visible (when several tokens are displayed in the column), WDYT? At least, it would be great to add a tooltip with token names to icons, due to sometimes token icons may be missing/incorrect/etc. So users may be confused with these views (see images below):
    image
    image
    image

@ramirotw

Lets hide for now the ETH cost column as we don't have that value from the subgraph

Just want to clarify it with you whether we really need to hide it as it was a request from Anxo in cowprotocol/cowswap#3721 (case 3). Or it is not going to be merged to Subgraph in the near future?

Thanks!

@ramirotw
Copy link
Contributor

ramirotw commented Oct 6, 2022

Just want to clarify it with you whether we really need to hide it as it was a request from Anxo in #156 (comment) (case 3). Or it is not going to be merged to Subgraph in the near future?

@GabrielCamba added a txCostNative field in the Settlement entity but currently that field is not the tx cost in eth (gas price * gas used) but just the gas price, so he needs to update that and re-deploy. Also, that field is only in the staging environment, you can it check here.

@ramirotw
Copy link
Contributor

ramirotw commented Oct 6, 2022

4. Maybe we should make token icons clickable (and add navigation links to blockexplorer), and more visible (when several tokens are displayed in the column), WDYT? At least, it would be great to add a tooltip with token names to icons, due to sometimes token icons may be missing/incorrect/etc. So users may be confused with these views (see images below):
image
image

agreed:

  1. the tooltip should have the token symbol
  2. the image should have a link to etherscan
  3. why is there only 1 token displayed in many settlements? the minimum should be 2

@matextrem matextrem requested a review from ramirotw October 7, 2022 02:23
@matextrem matextrem changed the base branch from develop to solvers October 7, 2022 02:57
@matextrem matextrem force-pushed the 224/settlements-table branch 3 times, most recently from e1039cd to 5bad0b6 Compare October 7, 2022 04:17
alfetopito and others added 6 commits October 7, 2022 01:18
* Bumping cow-sdk to latest

* Removed files already incorporated into the SDK

* Removed rinkeby from currently used spots

* Updated network selector

* removed it from storybook stories

* Removed/edited from the legacy code. Should remove it all eventually

* Fixed unit test
@matextrem matextrem force-pushed the 224/settlements-table branch from 5bad0b6 to 0524353 Compare October 7, 2022 04:31
@elena-zh
Copy link

elena-zh commented Oct 7, 2022

Hey @matextrem , nice changes!
I will list here what is left, and new issues I have found:

  1. Still, navigation to TX details is Explorer is not fixed (should be in the same tab)
    not fixed
  2. I still see only 100 Settlements in GC and Mainnet
  3. When hover a mouse on a native token (ETH/XDAI), 'Unknown' is displayed in the tooltip
    unknow token looks like ETH
    xdai
  4. '+1' may be displayed when there are many tokens in a settlement. I would show what tokens are included into '+1' in the tooltip instead of nothing
    1 - show which ones in tooltip
  5. Could we make token icons look nicer? I see some kind of curved boarders on tokens, some kind of a white border or so
    boarders

Thanks!

@elena-zh
Copy link

Hey @matextrem , great job!
Some remaining issues:

  1. MKR token is shown as 'unknown' token for the Mainnet
    mrr
  2. Now I see that the amount of settlements is 1000 in GC and Mainnet. Is this OK?
  3. When BE request fails to load the table, we show 'No results found' message. Maybe we should show a bit different error something instead with 'Try again' or reload the page button? @ramirotw , WDYT?
    fail

Thanks!

@matextrem
Copy link
Contributor Author

Regarding the first comment, the subgraph is responding with empty symbol for MKR token. @ramirotw any suggestions?

Copy link
Collaborator

@alfetopito alfetopito left a comment

Choose a reason for hiding this comment

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

The query to fetch dune info is not used in the first tab, resulting in missing solver names, where on the second they are filled

Screen Shot 2022-10-18 at 17 34 35
Screen Shot 2022-10-18 at 17 34 10

setQuery('')
setPageOffset(0)
}, [networkId, setPageOffset, setQuery])
}, [networkId, setPageOffset, setQuery, tabViewSelected])
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the useEffect intentionally denpendent on tabViewSelected although it's not used in it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is intentional since we need to reset the search bar query when changing between tabs

Copy link
Collaborator

Choose a reason for hiding this comment

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

Cool! Can you add a comment to be explicit about that and avoid the next reviewer to ask the same question 😆

@matextrem matextrem requested a review from alfetopito October 19, 2022 15:56
Copy link
Collaborator

@alfetopito alfetopito left a comment

Choose a reason for hiding this comment

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

Looking great Mati!

Only one last thing that I noticed now, but I rather it be addressed in another PR as this one is already quite big.

The table is "jumping" when I move between tabs, likely because it triggers a reload on every change:

Screen.Recording.2022-10-19.at.18.08.56.mov

So I'm in favor of merging and addressing the pending stuff in different PRs

@elena-zh
Copy link

Hey @matextrem ,

changes LGTM besides know issues related to the Graph:

  • MKR token is shown as 'unknown' token for the Mainnet
  • the amount of settlements is 1000 in GC and Mainnet.
  • total settlements is 100 on the Active solvers tab

Besides, I have created separate issues to address them later:

The only one issues that I would like you to fix is that some tokens (GNO/MIR) are too dark on the table, while the icons look good on Tx details pages:

gno too dark
icon
mir
mir1

Could you please fix it?

Thanks!

@alfetopito
Copy link
Collaborator

Specifically regarding this point

MKR token is shown as 'unknown' token for the Mainnet
Regarding the first comment, the subgraph is responding with empty symbol for MKR token

I suspect I know the reason.

Maker and and another token (I think DAI?) have the name stored as bytes32 rather than as string, which can be the root cause for this.

When fetching the token name from the contract, we are querying both versions of the contract to be safe.

Since this empty string is coming from the Subgraph, I suggest to:

  1. Try to look it up in the local list of tokens - maybe it's already loaded
  2. Follow the same loading step as other pages - try to get it from the contract

Copy link
Contributor

@ramirotw ramirotw left a comment

Choose a reason for hiding this comment

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

The Search by solver, address or name placeholder in the table header should be updated. Right now it's filtering by solver name and tx hash, it would also be helpful to filter by solver address so I don't need to go to the Active solvers tab to know the name based on the address and then come back and use that name to get the latest settlements by solver.

@matextrem matextrem requested a review from ramirotw October 20, 2022 16:02
@elena-zh
Copy link

Hey @matextrem , icons LGTM!
As for the MKR token, it is still unknown
mkr

Also, AFAIU from @ramirotw comment, it would be great to have a possibility to search by a solver address in the Settlements table, but you removed this option from the placeholder and, of cause, the search by a solver address is not working there.

@matextrem
Copy link
Contributor Author

@elena-zh updated!

MKR problem solved and search by address is working now.

Screen Shot 2022-10-21 at 14 44 27

@matextrem matextrem mentioned this pull request Oct 21, 2022
@elena-zh
Copy link

Hey @matextrem , changes LGTM!
The last nitpick is to change the placeholder in the search field to 'Search by tx hash, solver name or address'
image

Thanks

@matextrem
Copy link
Contributor Author

@elena-zh Updated!

Copy link

@elena-zh elena-zh left a comment

Choose a reason for hiding this comment

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

Hey @matextrem , great!
I'm approving this PR in order to merge this.
Still need to resolve some issues that are related to Subgraph.
Also, I have created a low-priority issue #242 to display the tooltip in the search field better on reduced screens.

Thank you!

Copy link
Contributor

@ramirotw ramirotw left a comment

Choose a reason for hiding this comment

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

👌

@matextrem matextrem merged commit 60c8fef into solvers Oct 25, 2022
@matextrem matextrem deleted the 224/settlements-table branch October 25, 2022 13:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
app:Explorer Explorer App
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Solvers] Settlements Table
5 participants