-
Notifications
You must be signed in to change notification settings - Fork 19
Akmal / feat: language fixes #402
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
Conversation
β¦ current_language from PositionsDrawer
β¦for better error management
Deploying derivatives-trader with Β
|
| Latest commit: |
678bf6c
|
| Status: | Β β Β Deploy successful! |
| Preview URL: | https://f83d3af4.derivatives-trader.pages.dev |
| Branch Preview URL: | https://b-language-issues-4.derivatives-trader.pages.dev |
Dependency Reviewβ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Manifest Files |
|
Claude finished @akmal-deriv's task ββ View job Code Review CompleteReviewing PR #402: "Akmal / feat: language fixed" OverviewThis PR addresses language-related issues across 4 files with 3 key changes focused on error message handling and conditional logic cleanup. Changes Summary1. purchase-fieldset.tsx (Line 170)Change: Conditional message display in Popover - message={info.message}
+ message={info.has_error ? info.message : undefined}β GOOD: Prevents displaying messages when there's no error, improving UX. 2. contract-info.tsx (Lines 145-147)Change: Restricted info Popover to vanilla contracts only - {!is_multiplier && !is_accumulator && !isMobile && (
+ {is_vanilla && (Concerns:
Question: Is this intentional? Should other contract types also show the info popover on desktop? 3. proposal.ts (Lines 128-130)Change: Removed - message: proposal.longcode || mapErrorMessage(response?.error || {}),
+ message: mapErrorMessage(response?.error || {}),Concerns:
Impact Analysis: Need to verify where
4. trade-store.ts (Line 1950)Change: Removed redundant - if (!this.is_dtrader_v2 && !this.is_accumulator) {
+ if (!this.is_dtrader_v2) {β
GOOD: Cleaner logic. The Verification needed: Confirm that dtrader_v2 mode already excludes accumulators, or that accumulators should indeed go through Priority Issuesπ΄ High Priority
π‘ Medium Priority
π’ Low Priority
Code QualityStrengths β
Concerns
|
|
Claude finished @akmal-deriv's task ββ View job Code Review CompleteReviewing PR #402: "Akmal / feat: language fixed" OverviewThis PR addresses language-related issues with 3 key changes across 5 files. The changes focus on message handling, conditional popover rendering, and cleanup of redundant logic. While the changes are well-intentioned, there are critical concerns that need to be addressed before merging. Changes Analysis1. proposal.ts (Lines 128-130) - Message HandlingChange: Removed - message: proposal.longcode || mapErrorMessage(response?.error || {}),
+ message: mapErrorMessage(response?.error || {}),π΄ HIGH PRIORITY - Critical Breaking ChangeConcerns:
Impact Assessment:
Where is this used?
The problem: In const setHintMessage = () => {
if (is_vanilla) return vanilla_payout_message;
return message; // This now returns empty string for successful proposals!
};Recommendation:
2. contract-info.tsx (Lines 145-147) - Popover RestrictionChange: Restricted info popover to vanilla contracts only - {!is_multiplier && !is_accumulator && !isMobile && (
+ {is_vanilla && (π‘ MEDIUM PRIORITY - Reduced Information AvailabilityConcerns:
Questions:
Additional concern: Combined with change #1 (removing longcode), users of non-vanilla contracts now have:
Recommendation:
3. purchase-fieldset.tsx (Line 170) - Conditional Message DisplayChange: Only show popover message when there's an error - message={info.message}
+ message={info.has_error ? info.message : undefined}β GOOD CHANGE - Defensive ProgrammingBenefits:
Note: This change is consistent with the removal of longcode from 4. trade-store.ts (Line 1950) - Redundant Check RemovalChange: Removed - if (!this.is_dtrader_v2 && !this.is_accumulator) {
+ if (!this.is_dtrader_v2) {β GOOD CHANGE - Code CleanupReasoning: If Verification needed:
Likely safe based on the commit message and context. 5. contract-info.spec.tsx - Test RemovalChange: Removed test for rendering component with children
|
Description
(Brief description of what this PR does)
Related Issue: Fixes #(issue)
Type of Change
Testing
Screenshots
(Add screenshots if UI changes)
Before:
After: