chore: some visual updates#260
Conversation
WalkthroughChanges span three files: removing i18n translation usage from CompleteTask.vue while replacing success toast display with toast closure, adding a close() function to useActionToast composable, and adding a computed totalBalance property to the partner page to display aggregated partner balances. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
apps/web-app/app/components/form/CompleteTask.vue(1 hunks)apps/web-app/app/pages/partner/index.vue(2 hunks)packages/ui/app/composables/useActionToast.ts(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: cubic · AI code reviewer
- GitHub Check: build
🔇 Additional comments (3)
packages/ui/app/composables/useActionToast.ts (1)
48-50: LGTM! Clean addition of close functionality.The
closefunction is correctly implemented as a simple wrapper aroundtoast.remove()and properly exposed in the composable's return object, enabling programmatic toast dismissal.Also applies to: 56-56
apps/web-app/app/components/form/CompleteTask.vue (1)
101-101: Verify the intentional removal of success feedback.The change from
actionToast.success(toastId, t('toast.task-completed'))toactionToast.close(toastId)removes the explicit text confirmation of task completion. While confetti still provides visual feedback (line 102), users no longer see a text message confirming the action succeeded.Is this UX change intentional? Consider whether users need explicit text confirmation that their task was completed successfully, especially for accessibility purposes where visual effects like confetti may not be perceived by all users.
apps/web-app/app/pages/partner/index.vue (1)
32-32: No changes needed—partner.balanceis guaranteed to be defined.The
balancefield is defined asnumeric('balance', { mode: 'number' }).notNull().default(0)in the database schema, which ensures it is never null and always has a numeric value. The Partner type is inferred from this schema, so TypeScript will enforce thatbalanceis always a number. The reduce operation is type-safe and will not produce NaN.
| <div class="px-3.5 py-4 ring ring-default h-full rounded-lg text-lg/5 font-medium"> | ||
| Общий баланс: <span class="font-bold">{{ `${new Intl.NumberFormat().format(totalBalance)} ₽` }}</span> | ||
| </div> |
There was a problem hiding this comment.
Use i18n for consistency and internationalization.
The text "Общий баланс:" is hardcoded in Russian, while the rest of the file uses t() for internationalized strings (e.g., line 2). Additionally, the currency symbol "₽" is hardcoded and may not be appropriate for all locales or partner types.
Consider applying this diff to use i18n and potentially make the currency dynamic:
- <div class="px-3.5 py-4 ring ring-default h-full rounded-lg text-lg/5 font-medium">
- Общий баланс: <span class="font-bold">{{ `${new Intl.NumberFormat().format(totalBalance)} ₽` }}</span>
- </div>
+ <div class="px-3.5 py-4 ring ring-default h-full rounded-lg text-lg/5 font-medium">
+ {{ t('app.partner.total-balance') }}: <span class="font-bold">{{ `${new Intl.NumberFormat().format(totalBalance)} ₽` }}</span>
+ </div>If the currency should also be dynamic based on locale or partner data, consider using Intl.NumberFormat with a currency option instead of appending a hardcoded symbol.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| <div class="px-3.5 py-4 ring ring-default h-full rounded-lg text-lg/5 font-medium"> | |
| Общий баланс: <span class="font-bold">{{ `${new Intl.NumberFormat().format(totalBalance)} ₽` }}</span> | |
| </div> | |
| <div class="px-3.5 py-4 ring ring-default h-full rounded-lg text-lg/5 font-medium"> | |
| {{ t('app.partner.total-balance') }}: <span class="font-bold">{{ `${new Intl.NumberFormat().format(totalBalance)} ₽` }}</span> | |
| </div> |
🤖 Prompt for AI Agents
In apps/web-app/app/pages/partner/index.vue around lines 6 to 8, the label
"Общий баланс:" and the hardcoded ₽ currency are not internationalized; replace
the literal label with a call to the i18n translator (e.g.,
t('partner.totalBalance') or the existing namespace) and format the amount using
Intl.NumberFormat with the currency option (pass a dynamic currency code from
partner data or derived from locale) instead of appending "₽"; also add the new
translation key(s) to the locale files so the label is available in all
supported languages.



Summary by cubic
Show total partner balance on the Partner page and simplify toast handling. Adds a toast close(id) helper and uses it after completing a task instead of showing a success toast.
New Features
Refactors
Written for commit d19d242. Summary will update automatically on new commits.
Summary by CodeRabbit
New Features
Bug Fixes