Skip to content

feat: confetti on task complete#227

Merged
hmbanan666 merged 1 commit into
mainfrom
confetti
Oct 16, 2025
Merged

feat: confetti on task complete#227
hmbanan666 merged 1 commit into
mainfrom
confetti

Conversation

@hmbanan666
Copy link
Copy Markdown
Collaborator

@hmbanan666 hmbanan666 commented Oct 16, 2025

Summary by CodeRabbit

Release Notes

  • New Features
    • Added "In Progress" task filter for improved task organization
    • Navigation menu now displays badges for notifications
    • Confetti celebration animation triggers upon task completion
    • Smooth entry animations on task cards for enhanced visual experience

@hmbanan666 hmbanan666 self-assigned this Oct 16, 2025
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Oct 16, 2025

Walkthrough

Changes span UI enhancements across Telegram and web-app components, including a slide-left animation on task cards, badge display in navigation, an in-progress task filter option, and a celebratory confetti effect triggered upon task completion with supporting composable infrastructure.

Changes

Cohort / File(s) Summary
Motion & Animation
apps/atrium-telegram/app/components/TaskInfoCard.vue
Added motion-preset-slide-left CSS class to root ActiveCard component for entry animation.
Navigation UI Enhancements
apps/atrium-telegram/app/composables/useNavigation.ts, apps/atrium-telegram/app/pages/navigation.vue
Added badge support: new "+1" badge property in mainRoutes, conditional badge rendering in navigation items template with icon and text display.
Task Filtering
apps/atrium-telegram/app/pages/all-tasks/index.vue
Added new "inProgress" filter option with dedicated filterByInProgress() function returning tasks that are not completed; extended filter switch logic.
Confetti Celebration Feature
apps/web-app/app/composables/useConfetti.ts, apps/web-app/app/components/form/CompleteTask.vue, apps/web-app/app/pages/index.vue
Created new useConfetti composable managing reactive isShown state and pop() function with 5-second timeout reset; integrated confetti animation in CompleteTask component on success; added confetti container rendering with v-confetti directive on index page.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CompleteTask
    participant useConfetti
    participant index.vue
    participant Timeout

    User->>CompleteTask: Complete task
    CompleteTask->>useConfetti: Call pop()
    useConfetti->>useConfetti: Set isShown = true
    useConfetti->>index.vue: isShown state updated
    index.vue->>index.vue: Render confetti container
    useConfetti->>Timeout: Schedule 5s timeout
    Timeout->>useConfetti: Timeout expires
    useConfetti->>useConfetti: Set isShown = false
    useConfetti->>index.vue: isShown state updated
    index.vue->>index.vue: Hide confetti container
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

The diff includes multiple files with straightforward additions (animations, badge UI, filter logic) and a new composable with state management. While mostly following existing patterns, the variety of changes and cross-component integrations (particularly the confetti feature spanning three files) warrant moderate review attention for logical consistency and proper state handling.

Possibly related PRs

  • chore: navigation rework #152: Modifies navigation composables and adds motion preset classes to components; overlaps with navigation badge and animation changes.
  • chore: filters update #209: Updates apps/atrium-telegram/app/pages/navigation.vue with motion classes and navigation item rendering logic; directly related to badge rendering changes.
  • chore: visual rework #112: Modifies ActiveCard component styling; relates to the motion preset animation added to TaskInfoCard usage.

Poem

🎉 A slide from the left, a badge shining bright,
Tasks filtering in progress, now in sight,
When completion arrives, confetti takes flight,
Each little particle dancing with delight,
Celebrating progress through the night! 🐰✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
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.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly captures the new confetti feature on task completion, which is indeed an actual and important part of this pull request, even though additional UI enhancements are also included.
✨ 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 confetti

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

🧹 Nitpick comments (2)
apps/atrium-telegram/app/composables/useNavigation.ts (1)

38-38: Consider using a dynamic badge or documenting the static value.

Unlike other navigation routes that use dynamic badges based on store state, this route uses a hardcoded '+1' string. If this is intentional (e.g., to indicate a new feature), consider:

  • Adding a comment explaining the static badge
  • Making it configurable via a feature flag
  • Using i18n for consistency with other UI strings
apps/web-app/app/composables/useConfetti.ts (1)

1-14: Add timeout cleanup to prevent memory leaks.

The current implementation doesn't clean up the timeout if the component unmounts or if pop() is called multiple times in quick succession. This could lead to memory leaks or unexpected behavior.

Apply this diff to add proper cleanup:

+import { onUnmounted } from 'vue'
+
 function _useConfetti() {
   const isShown = ref(false)
+  let timeoutId: NodeJS.Timeout | null = null
 
   function pop() {
+    if (timeoutId) {
+      clearTimeout(timeoutId)
+    }
     isShown.value = true
-    setTimeout(() => {
+    timeoutId = setTimeout(() => {
       isShown.value = false
+      timeoutId = null
     }, 5000)
   }
 
+  onUnmounted(() => {
+    if (timeoutId) {
+      clearTimeout(timeoutId)
+    }
+  })
+
   return { isShown, pop }
 }
 
 export const useConfetti = createSharedComposable(_useConfetti)
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6b3da32 and f4fd1a3.

📒 Files selected for processing (7)
  • apps/atrium-telegram/app/components/TaskInfoCard.vue (1 hunks)
  • apps/atrium-telegram/app/composables/useNavigation.ts (1 hunks)
  • apps/atrium-telegram/app/pages/all-tasks/index.vue (3 hunks)
  • apps/atrium-telegram/app/pages/navigation.vue (2 hunks)
  • apps/web-app/app/components/form/CompleteTask.vue (2 hunks)
  • apps/web-app/app/composables/useConfetti.ts (1 hunks)
  • apps/web-app/app/pages/index.vue (2 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). (1)
  • GitHub Check: build
🔇 Additional comments (5)
apps/atrium-telegram/app/components/TaskInfoCard.vue (1)

2-2: LGTM!

The slide-left animation enhances the task card entrance. The implementation is clean and consistent with other motion presets used throughout the app.

apps/atrium-telegram/app/pages/all-tasks/index.vue (1)

33-33: LGTM!

The new "in progress" filter is implemented correctly and follows the established pattern. The logic properly identifies tasks without completion dates.

Also applies to: 119-119, 129-131, 139-140

apps/web-app/app/components/form/CompleteTask.vue (1)

67-67: LGTM!

The confetti integration is clean and well-placed. Triggering the celebration after the success toast provides excellent user feedback without interfering with the existing flow.

Also applies to: 103-103

apps/atrium-telegram/app/pages/navigation.vue (1)

18-28: LGTM!

The conditional badge rendering is implemented correctly with nice visual polish using the animated pointer icon.

apps/web-app/app/pages/index.vue (1)

2-10: LGTM!

The confetti implementation is well-structured:

  • ClientOnly wrapper correctly handles the client-side-only library
  • Optional chaining on confetti?.clientHeight and confetti?.clientWidth safely handles the initial null state
  • The fixed positioning and z-index ensure the confetti displays above all content
  • Configuration parameters (particleCount, duration, force) provide a balanced celebratory effect

Also applies to: 87-87, 93-94

label: 'Задачи',
to: '/all-tasks',
icon: 'i-lucide-list-checks',
badge: 'апдейт',
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Use i18n for the badge text.

The hardcoded Russian text 'апдейт' bypasses the internationalization system used elsewhere in the app.

Apply this diff to use i18n:

   {
     label: 'Задачи',
     to: '/all-tasks',
     icon: 'i-lucide-list-checks',
-    badge: 'апдейт',
+    badge: t('app.navigation.tasks.badge'),
     onClick: () => vibrate(),
   },

Then add the corresponding translation key to your locale files.

📝 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
badge: 'апдейт',
{
label: 'Задачи',
to: '/all-tasks',
icon: 'i-lucide-list-checks',
badge: t('app.navigation.tasks.badge'),
onClick: () => vibrate(),
},
🤖 Prompt for AI Agents
In apps/atrium-telegram/app/pages/navigation.vue around line 63, the badge
property is using hardcoded Russian text "апдейт"; replace it with an i18n key
reference (e.g., $t('navigation.badge.update') or use the component/composable
translation helper used in the project) and update the callsite accordingly so
the badge reads from translations instead of a literal string; then add the
corresponding translation key "navigation.badge.update" (and translations for
other supported locales) to the project's locale files.

@hmbanan666 hmbanan666 merged commit 11b48d1 into main Oct 16, 2025
8 checks passed
@hmbanan666 hmbanan666 deleted the confetti branch October 16, 2025 11:11
This was referenced Oct 17, 2025
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