Skip to content

chore: some visual updates#260

Merged
hmbanan666 merged 1 commit into
mainfrom
update
Nov 14, 2025
Merged

chore: some visual updates#260
hmbanan666 merged 1 commit into
mainfrom
update

Conversation

@hmbanan666
Copy link
Copy Markdown
Collaborator

@hmbanan666 hmbanan666 commented Nov 14, 2025

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

    • Display total partner balance on /partner with currency formatting.
  • Refactors

    • Added actionToast.close(id) to remove a toast.
    • CompleteTask now closes the pending toast on success instead of showing a success toast.
    • Removed unused i18n variable in CompleteTask.

Written for commit d19d242. Summary will update automatically on new commits.

Summary by CodeRabbit

  • New Features

    • Partner page now displays total balance, calculated as the aggregate sum of all partner balances with localized currency formatting.
  • Bug Fixes

    • Task completion notifications now automatically close instead of displaying a success message.

@hmbanan666 hmbanan666 self-assigned this Nov 14, 2025
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Nov 14, 2025

Walkthrough

Changes 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

Cohort / File(s) Summary
Toast Composable Enhancement
packages/ui/app/composables/useActionToast.ts
Added new close(id: string) function that removes a toast by ID, exposed as public API method.
Form Component Update
apps/web-app/app/components/form/CompleteTask.vue
Removed i18n composable usage and replaced success toast call with toast closure via actionToast.close(toastId).
Partner Page Enhancement
apps/web-app/app/pages/partner/index.vue
Added computed totalBalance property that sums partner.balance across all partners; rendered in template as localized currency value.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • CompleteTask.vue: Verify that removing i18n and replacing the success toast behavior doesn't break existing UX expectations or messaging flow.
  • useActionToast.ts: Confirm the close() function integrates properly with the underlying toast library's remove() API.
  • partner/index.vue: Validate that the computed property correctly aggregates balances and the currency formatting renders as intended.

Possibly related PRs

  • chore: inputs rework #100: Directly modifies CompleteTask.vue by removing useI18n and altering toast success behavior, mirroring the same component's refactoring.
  • feat: confetti on task complete #227: Changes the success flow in CompleteTask.vue, adding post-success functionality (confetti animation) that complements the toast closure approach.

Poem

🐰 Toasts now close without a whisper,
Totals sum where partners glisten,
Small tweaks make the workflow crisper,
Silent success—no need to listen! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title 'chore: some visual updates' is vague and generic, using non-descriptive language that doesn't convey meaningful information about the actual changes. Replace with a more specific title that describes the actual changes, such as 'chore: add toast close action and partner balance display' or similar.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch update

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a 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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 89be982 and d19d242.

📒 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 close function is correctly implemented as a simple wrapper around toast.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')) to actionToast.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.balance is guaranteed to be defined.

The balance field is defined as numeric('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 that balance is always a number. The reduce operation is type-safe and will not produce NaN.

Comment on lines +6 to +8
<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>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

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.

Suggested change
<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.

@hmbanan666 hmbanan666 merged commit e37e391 into main Nov 14, 2025
9 checks passed
@hmbanan666 hmbanan666 deleted the update branch November 14, 2025 14:36
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant