-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
deverification copy changes #4790
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe changes involve updates to language files ( Changes
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (4)
src/components/views/project/projectGIVPower/index.tsx (2)
31-33
: LGTM: New variables for project statusThe introduction of
isVerified
,isGivbackEligible
, andisVerifiedNotGivbacksEligible
variables is appropriate and aligns with the PR objectives. These variables provide clear, semantic checks for the project's status.Consider using the nullish coalescing operator for a more concise expression:
-const isVerified = projectData?.verified; -const isGivbackEligible = projectData?.isGivbackEligible; +const isVerified = projectData?.verified ?? false; +const isGivbackEligible = projectData?.isGivbackEligible ?? false;This ensures that these variables are always boolean, even if
projectData
is undefined.
62-66
: LGTM: Conditional rendering of GIVpowerCardThe conditional rendering of the
GIVpowerCard
component based onisVerifiedNotGivbacksEligible
correctly implements the PR objective of removing the GivPower rank modal for verified projects that are not eligible for Givbacks.To improve readability, consider extracting the condition into a descriptive variable:
+const shouldShowGIVpowerCard = !isVerifiedNotGivbacksEligible; -{!isVerifiedNotGivbacksEligible && ( +{shouldShowGIVpowerCard && ( <Col lg={4}> <GIVpowerCard /> </Col> )}This makes the intent of the condition more explicit and easier to understand at a glance.
src/components/views/project/ProjectGIVbackToast.tsx (1)
248-259
: LGTM! Consider extracting the link component for better readability.The changes look good and align with the previous modification. The dynamic inclusion of the
stakeLock
link in the description improves the contextual relevance for verified owners who are not eligible.To improve code readability, consider extracting the
InnerLink
component into a separate variable:description = formatMessage( { id: `${useIntlDescription}verified_owner_not_eligible`, }, { stakeLock: ( - <InnerLink href={Routes.GIVfarm} target='_blank'> - {formatMessage({ id: 'label.stake_and_lock' })}{' '} - </InnerLink> + <StakeLockLink /> ), }, ); +const StakeLockLink = () => ( + <InnerLink href={Routes.GIVfarm} target='_blank'> + {formatMessage({ id: 'label.stake_and_lock' })}{' '} + </InnerLink> +);This extraction would make the
formatMessage
call cleaner and more focused on its primary purpose.lang/en.json (1)
313-313
: Informative description for vouching featureThe new description for the vouching feature is clear and informative. It effectively explains the purpose of DeVouch and the potential benefits of vouching for a project.
Consider adding a brief mention of what "DeVouch" is for users who might be unfamiliar with the term. For example:
- "With DeVouch, you can signal your support for this project by attesting to its legitimacy, potentially increasing the benefits it receives on Giveth." + "With DeVouch, our decentralized verification system, you can signal your support for this project by attesting to its legitimacy, potentially increasing the benefits it receives on Giveth."
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (6)
- lang/ca.json (2 hunks)
- lang/en.json (2 hunks)
- lang/es.json (2 hunks)
- src/components/views/project/ProjectDevouchBox.tsx (2 hunks)
- src/components/views/project/ProjectGIVbackToast.tsx (2 hunks)
- src/components/views/project/projectGIVPower/index.tsx (2 hunks)
🔇 Additional comments (18)
src/components/views/project/projectGIVPower/index.tsx (2)
28-29
: LGTM: DestructuringprojectData
fromuseProjectContext
The addition of
projectData
to the destructured values fromuseProjectContext
is appropriate and aligns with the intended changes described in the PR objectives.
Line range hint
1-76
: Summary: PR objectives successfully implementedThe changes in this file successfully implement the PR objectives related to the deverification copy changes and the removal of the GivPower rank modal for verified projects that are not eligible for Givbacks. The code is well-structured and follows React best practices.
Key points:
- New variables have been introduced to determine project verification and Givback eligibility status.
- The
GIVpowerCard
component is now conditionally rendered based on these new variables.- The changes align with the PR objectives and improve the clarity of the deverification process.
Minor suggestions for improvement have been made to enhance code readability and robustness. Overall, the implementation is sound and achieves the intended goals.
src/components/views/project/ProjectDevouchBox.tsx (4)
41-41
: LGTM: Message identifier update aligns with PR objectives.The change from 'label.devouch.view_this_project' to 'label.devouch.title.vouch_this_project' is consistent with the PR's focus on updating the deverification copy. This modification shifts the emphasis from "viewing" to "vouching" for a project, which appears to be the intended direction.
46-46
: LGTM: Description identifier update is consistent with title change.The modification from 'label.devouch.if_you_are_eligible' to 'label.devouch.description.vouch_this_project' aligns well with the previous title change. This update maintains consistency in the messaging, focusing on the act of vouching for a project rather than discussing eligibility.
Line range hint
1-165
: Summary: Copy changes align with PR objectives, functionality verification recommended.The changes in this file consistently update the copy related to the deverification process, aligning well with the PR objectives. The modifications shift the focus from "viewing" to "vouching" for a project and update the button label to reflect a possible change in user flow.
While the copy changes look good, it's important to verify that the button functionality aligns with the new label, especially regarding navigation to the devouch page versus direct attestation.
65-65
: LGTM: Button label update approved, but verify functionality.The change from 'label.devouch.attest_on_devouch' to 'label.devouch.go_to_devouch' is consistent with the overall copy updates. However, this modification suggests a potential change in the user action or flow.
Please confirm that this label change aligns with the current functionality of the button. Does it now navigate to a devouch page instead of directly attesting? Run the following script to check for any related changes in the button's behavior:
src/components/views/project/ProjectGIVbackToast.tsx (1)
230-230
: LGTM! Verify the new route for "stake and lock".The change from
Routes.GIVeconomy
toRoutes.GIVfarm
for the "stake and lock" link looks good. It appears to be a more specific and relevant route for this action.To ensure the correctness of this change, please run the following script to verify the existence and usage of the
Routes.GIVfarm
constant:✅ Verification successful
Routes.GIVfarm is correctly defined and properly used.
The
Routes.GIVfarm
constant is defined insrc/lib/constants/Routes.ts
and is appropriately utilized across the codebase for the "stake and lock" functionality.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence and usage of Routes.GIVfarm # Test 1: Check if Routes.GIVfarm is defined echo "Checking if Routes.GIVfarm is defined:" rg --type typescript "GIVfarm.*=.*" src/lib/constants/Routes.ts # Test 2: Check for other usages of Routes.GIVfarm in the codebase echo "Checking for other usages of Routes.GIVfarm:" rg --type typescript "Routes\.GIVfarm" -g '!src/components/views/project/ProjectGIVbackToast.tsx'Length of output: 421
Script:
#!/bin/bash # Description: Verify the existence and usage of Routes.GIVfarm # Test 1: Check if Routes.GIVfarm is defined echo "Checking if Routes.GIVfarm is defined:" rg --type ts "GIVfarm\s*=" src/lib/constants/Routes.ts # Test 2: Check for other usages of Routes.GIVfarm in the codebase echo "Checking for other usages of Routes.GIVfarm:" rg --type ts "Routes\.GIVfarm" --type-add 'tsx:*.tsx' -g '!src/components/views/project/ProjectGIVbackToast.tsx'Length of output: 1819
Script:
#!/bin/bash # Description: Search for the definition of Routes.GIVfarm across the entire codebase echo "Searching for the definition of Routes.GIVfarm in the entire codebase:" rg "Routes\.GIVfarm\s*="Length of output: 177
Script:
#!/bin/bash # Description: Broad search for any definition or usage patterns of GIVfarm echo "Searching for any definitions or assignments of GIVfarm:" rg "GIVfarm\s*[:=]" echo "Searching for any dynamic or indirect definitions of GIVfarm:" rg "define.*GIVfarm"Length of output: 439
lang/en.json (2)
311-311
: Improved clarity in UI textThe change from "Attest on Devouch" to "Go to DeVouch" is a good improvement. It makes the action clearer and more direct for users.
312-312
: Clear new label for vouchingThe addition of "Vouch for this Project" is a good, clear label for the vouching feature. It effectively communicates the action available to users.
lang/es.json (4)
311-312
: Approved: Label updated to reflect navigation actionThe label for "devouch.go_to_devouch" has been updated from "Certificar en DeVouch" to "Ir a DeVouch". This change shifts the meaning from a certification action to a navigation action, which may better reflect the intended user flow.
312-313
: Approved: Improved clarity in DeVouch descriptionThe description for "devouch.description.vouch_this_project" has been updated to provide a clearer explanation of the DeVouch feature. The new text emphasizes the act of supporting the project by vouching for its legitimacy and explains the potential benefits. This change should help users better understand the purpose and impact of using DeVouch.
314-314
: Approved: More direct and action-oriented titleThe title for "devouch.title.vouch_this_project" has been updated to "Avalar este Proyecto". This change simplifies the title and makes it more action-oriented, clearly stating the action the user can take. This improvement should make the purpose of the feature more immediately clear to users.
1649-1651
: Approved: Enhanced project information and personalizationThe descriptions for verified project owners have been significantly improved:
For "verified_owner_not_eligible", the text now provides more specific information about project endorsement, GIVpower benefits, and the ability to boost the project's position. It also clarifies that the project can be boosted but doesn't generate GIVbacks.
For "verified_public_not_eligible", a placeholder for dynamic content has been added ({stakeLock}), likely to provide personalized instructions. The text also clarifies the benefits of GIVpower and the project's status regarding GIVbacks.
These changes offer more detailed and personalized information to project owners, which should help them better understand their project's status and available actions.
lang/ca.json (5)
311-312
: Change in label for navigating to DeVouch confirmedThe label for navigating to DeVouch has been updated as mentioned in the AI-generated summary.
Old: "label.devouch.attest_on_devouch": "Certifica a DeVouch"
New: "label.devouch.go_to_devouch": "Anar a DeVouch"This change makes the action clearer and more direct.
312-313
: Description for vouching updated as expectedThe description for vouching for a project has been rephrased as indicated in the AI-generated summary. The new text clarifies the process and its potential benefits.
Old: "label.devouch.if_you_are_eligible": "Si ets un verificador elegible de Giveth, pots avalar la legitimitat d'aquest projecte, potencialment augmentant els beneficis que rep a Giveth."
New: "label.devouch.description.vouch_this_project": "Amb DeVouch, pots assenyalar el teu suport a aquest projecte testificant la seva legitimitat, cosa que potencialment augmentarà els beneficis que rep a Giveth."This change provides a clearer explanation of the DeVouch process.
314-314
: Title for vouching updated correctlyThe title for vouching for a project has been updated as mentioned in the AI-generated summary.
Old: "label.devouch.view_this_project": "Veure aquest projecte a DeVouch"
New: "label.devouch.title.vouch_this_project": "Avalar aquest Projecte"This change makes the action more clear and direct.
1649-1651
: GIVbacks descriptions updated with placeholder for staking informationThe descriptions for verified owners and public projects not eligible for GIVbacks have been modified to include a placeholder for staking information, as mentioned in the AI-generated summary.
For verified owners:
Old: "project.givback_toast.description.verified_owner_not_eligible": "No obstant això, donar a aquest projecte no generarà GIVbacks per als donants."
New: "project.givback_toast.description.verified_owner_not_eligible": "El teu projecte ha estat avalat pels Verificadors de Giveth i ara pot beneficiar-se de GIVpower. {stakeLock} per obtenir GIVpower i millorar la posició d'aquest projecte a la pàgina de projectes. Nota: Aquest projecte pot ser impulsat, però no genera GIVbacks."For public projects:
Old: "project.givback_toast.description.verified_public_not_eligible": "Nota: Aquest projecte pot ser impulsat, però no genera GIVbacks."
New: "project.givback_toast.description.verified_public_not_eligible": "{stakeLock} per obtenir GIVpower i millorar la posició d'aquest projecte a la pàgina de projectes. Nota: Aquest projecte pot ser impulsat, però no genera GIVbacks."These changes provide more detailed information about the GIVpower system and how it relates to project visibility.
Line range hint
1-1651
: Summary of changes in lang/ca.jsonAfter reviewing the changes in the Catalan language file, I can confirm that all modifications mentioned in the AI-generated summary have been accurately implemented. The updates include:
- Changed label for navigating to DeVouch
- Updated description for vouching for a project
- Modified title for vouching for a project
- Updated descriptions for verified owners and public projects not eligible for GIVbacks, including placeholders for staking information
These changes improve the clarity and informativeness of the messages related to the DeVouch and GIVbacks systems. No formatting issues or inconsistencies were found in the changed entries or the surrounding context.
Overall, these updates should enhance user understanding of these features in the Catalan version of the application.
lang/en.json
Outdated
"project.givback_toast.description.verified_owner_not_eligible": "Your project has been vouched for by Giveth Verifiers and can now benefit from GIVpower! {stakeLock} to get GIVpower and boost this project's position on the projects page! Note: This project can be boosted, but does not yield GIVbacks.", | ||
"project.givback_toast.description.verified_public": "Ethereum donations to GIVbacks Eligible projects are rewarded with GIV. Boost this project to increase its rewards percentage and make it more visible on the projects page!", | ||
"project.givback_toast.description.verified_public_not_eligible": "{stakeLock} your GIV tokens to get GIVpower. Boost this project make it more visible on the projects page! Note that while this project is eligible to be boosted with GIVpower, it will not yield GIVbacks to it's donors.", | ||
"project.givback_toast.description.verified_public_not_eligible": "{stakeLock} to get GIVpower and boost this project's position on the projects page! Note: This project can be boosted, but does not yield GIVbacks.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Placeholder {stakeLock} is not being properly handled in the application code
-
The
{stakeLock}
placeholder is present in the translation files (lang/en.json
,lang/es.json
,lang/ca.json
) for the keys:project.givback_toast.description.verified_owner_not_eligible
project.givback_toast.description.verified_public_not_eligible
-
No instances were found in JavaScript or TypeScript files where these translation keys are used with the
{stakeLock}
substitution. -
This may result in the placeholder
{stakeLock}
being displayed literally in the user interface instead of dynamic content.
🔗 Analysis chain
Improved clarity on project eligibility and boosting
The updates to these descriptions provide clearer information about project boosting and GIVbacks eligibility. The consistent messaging across owner and public views is good for maintaining clarity.
Ensure that the {stakeLock} placeholder is correctly handled in the code where these strings are used. Run the following script to check for proper usage:
This will help verify that the placeholder is being replaced with the appropriate content when the messages are displayed.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check for proper usage of the {stakeLock} placeholder
rg -t js -t ts "project\.givback_toast\.description\.(verified_owner_not_eligible|verified_public_not_eligible)" -A 5 -B 5
Length of output: 124
Script:
#!/bin/bash
# Search for usage of the specific translation keys across all relevant files
rg "project\.givback_toast\.description\.(verified_owner_not_eligible|verified_public_not_eligible)" --files-with-matches | while read -r file; do
echo "File: $file"
rg "{stakeLock}" "$file" -A 3 -B 3
done
Length of output: 711
Script:
#!/bin/bash
# Search for usage of the specific translation keys across all relevant files and correctly escape curly braces
rg "project\.givback_toast\.description\.(verified_owner_not_eligible|verified_public_not_eligible)" --files-with-matches | while read -r file; do
echo "File: $file"
rg "\{stakeLock\}" "$file" -A 3 -B 3
done
Length of output: 5417
Script:
#!/bin/bash
# Search for usage of the specific translation keys in JS and TS files and verify {stakeLock} substitution
keys=(
"project.givback_toast.description.verified_owner_not_eligible"
"project.givback_toast.description.verified_public_not_eligible"
)
for key in "${keys[@]}"; do
echo "Searching for key: $key"
rg "$key" --type js --type ts --multiline -A 5 -B 5 | while read -r line; do
echo "$line"
if echo "$line" | grep -q "{stakeLock}"; then
echo "-> Placeholder {stakeLock} found in usage"
else
echo "-> No placeholder substitution detected"
fi
done
done
Length of output: 782
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Thanks @divine-comedian
Just two minor fixes.
Thanks @RamRamez ready for another review |
FYI @MohammadPCh we should merge this BEFORE doing the release |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @divine-comedian
deverification copy changes and remove givpower rank modal for vouched projects
Summary by CodeRabbit
New Features
Bug Fixes
Documentation