Skip to content

Fixes appeal tab issues #1420

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

Merged
merged 12 commits into from
Jan 18, 2024
Merged

Fixes appeal tab issues #1420

merged 12 commits into from
Jan 18, 2024

Conversation

tractorss
Copy link
Contributor

@tractorss tractorss commented Jan 17, 2024

closes #1414 , closes #1416

Issues fixed by this PR :

  1. Appeal tab becomes active after period changes to Appeal, no need to reload
  2. Explainer for stage 2, to show info about stage 1 's funded choice
  3. Popup showing on user reject txn, now fixed
  4. Fund button updated, better disabling conditions
  5. Fixes fully funded option still selectable
  6. Fixes fund input not editable in stage 2 appeal
  7. Adds loading indicator while appeal data is loading, instead of showing "No option was funded" info

PR-Codex overview

This PR focuses on refactoring the appeal feature in the CaseDetails page. It includes the following changes:

  • Renamed the useLoserSideCountdownContext hook to useCountdownContext and added useWinnerSideCountdown hook.
  • Updated imports and dependencies in multiple files.
  • Added StageOneExplanation and StageTwoExplanation components.
  • Updated the StageExplainer component to handle different stages.
  • Updated the Tabs component to disable a tab based on certain conditions.
  • Updated the Options component to use the useCountdownContext hook.
  • Updated the StageOne component to use the useCountdownContext and useFundingContext hooks.
  • Updated the StageTwo component to use the useCountdownContext, useFundingContext, and useOptionsContext hooks.
  • Updated the ClassicAppealProvider component to use the useCountdownContext hook and provide the countdown values.
  • Updated the useClassicAppealContext hook to export the useCountdownContext hook.
  • Added the useWinnerSideCountdown hook.
  • Updated the getDeadline function in the useClassicAppealContext hook.
  • Updated the Fund component to use the useAccount, useBalance, and usePublicClient hooks.

The following files were skipped due to too many changes: web/src/pages/Cases/CaseDetails/Appeal/Classic/Fund.tsx

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

netlify bot commented Jan 17, 2024

Deploy Preview for kleros-v2 ready!

Name Link
🔨 Latest commit a6beea5
🔍 Latest deploy log https://app.netlify.com/sites/kleros-v2/deploys/65a92e204875ff0009262999
😎 Deploy Preview https://deploy-preview-1420--kleros-v2.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@tractorss tractorss requested review from kemuru and alcercu January 17, 2024 09:24
kemuru
kemuru previously approved these changes Jan 17, 2024
Copy link
Contributor

@kemuru kemuru left a comment

Choose a reason for hiding this comment

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

lgtm

Comment on lines 63 to 64
The sum of funds must reach 100%. If it's not fully funded in time the option fully funded at{" "}
<small>stage 1</small> is declared the winner of the case.{" "}
Copy link
Contributor

Choose a reason for hiding this comment

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

This is slightly inaccurate, for the current implementation of DisputeKitClassic the sum of funds is not considered, the only condition to make an appeal go through is to completely fund two options. So I would write something like this:
If the current winner is not fully funded in time, the option funded during the previous stage will be declared as the final winner.

Copy link
Contributor

@alcercu alcercu left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link

codeclimate bot commented Jan 18, 2024

Code Climate has analyzed commit a6beea5 and detected 3 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1
Style 2

View more on Code Climate.

Copy link

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

2 New issues
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

@alcercu alcercu added this pull request to the merge queue Jan 18, 2024
Merged via the queue into dev with commit 0da521f Jan 18, 2024
@jaybuidl jaybuidl deleted the fix(web)--appeal-tab-issues branch January 19, 2024 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants