Skip to content

Conversation

@ShivaGupta-14
Copy link
Contributor

@ShivaGupta-14 ShivaGupta-14 commented Nov 18, 2025

Description

This PR implements visual indicators for unsynced task modifications. When a task is edited, completed, or deleted, the UI immediately marks it as "Unsynced" until the backend successfully synchronizes all pending changes.

Key Changes

  • State Management: Implements a local state unsyncedTaskUuids to track tasks modified on the frontend but not yet synced to the backend.

  • Visual Indicators:

    • Adds a red "Unsynced" badge to task rows for immediate feedback when a task is edited, completed, or deleted.
    • Displays the count of pending unsynced items on the Sync button via a notification-style badge.
  • Optimistic UI Updates: Immediately updates UI for task status changes (completed/deleted) to enhance perceived performance.

  • Sync Logic: Automatically clears all unsynced indicators once backend synchronization succeeds.

  • Testing

    • Includes unit tests verifying:
      • Unsynced badge visibility
      • Sync button counter accuracy
      • Clearing state on successful sync
      • Used test.each for repetitive date editing tests, reducing code duplication.

Checklist

  • Ran npx prettier --write . (for formatting)
  • Ran gofmt -w . (for Go backend)
  • Ran npm test (for JS/TS testing)
  • Added unit tests, if applicable
  • Verified all tests pass
  • Updated documentation, if needed

Additional Notes

Video: Link to see changes

@ShivaGupta-14 ShivaGupta-14 force-pushed the feat/143-unsync-ui branch 2 times, most recently from 1bd542e to f7f9057 Compare November 19, 2025 15:25
@ShivaGupta-14 ShivaGupta-14 force-pushed the feat/143-unsync-ui branch 4 times, most recently from 8ff6827 to 76df3ab Compare December 2, 2025 13:48
@ShivaGupta-14 ShivaGupta-14 force-pushed the feat/143-unsync-ui branch 2 times, most recently from 164a544 to 1dfb900 Compare December 7, 2025 13:23
@ShivaGupta-14
Copy link
Contributor Author

Hi @its-me-abhishek!
I’ve completed the requested changes and updated the PR. Please review it whenever you get time. Thanks!

Copy link
Collaborator

@its-me-abhishek its-me-abhishek left a comment

Choose a reason for hiding this comment

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

hey, this does not really go along the lines that is intended for this feature. The feature shall simply just be a state of set that handles a set of UUIDs of tasks that have been recently modified, and hence display them using the set calls upon rendering.

@ShivaGupta-14
Copy link
Contributor Author

@its-me-abhishek, Thanks for explaining! I've made the necessary changes, the "Unsynced" badge will now only appear when an existing task is edited, not when a new task is added.

Quick question: Should I update the toast from "Task added successfully!" to "Task added! Sync to see it (or update)." to make it clearer? Or keep it as is?

PR is ready for review.

@ShivaGupta-14 ShivaGupta-14 force-pushed the feat/143-unsync-ui branch 2 times, most recently from 2934893 to f35b309 Compare December 18, 2025 10:08
@ShivaGupta-14
Copy link
Contributor Author

Hi @its-me-abhishek, could you please review this PR when you get a chance?

@its-me-abhishek
Copy link
Collaborator

Are there any updates on this PR @ShivaGupta-14 ?

@ShivaGupta-14
Copy link
Contributor Author

Hi @its-me-abhishek!

Yes, on it! I was travelling for a few days, so there was a slight delay. I’ll finish all the remaining work (review and updates) by tomorrow EOD

- Implements a local state `unsyncedTaskUuids` to track items modified on the frontend but not yet pushed to the backend.
- Adds an 'Unsynced' badge to task rows for immediate visual feedback on edit, completion, or deletion.
- Implements optimistic UI updates for task status changes (completed/deleted) to improve perceived performance.
- Automatically clears all unsynced indicators upon successful synchronization with the backend.
- Displays the number of pending local changes on the button and includes unit tests.

Fixes CCExtractor#143
Copy link
Contributor Author

Choose a reason for hiding this comment

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

shows animated unsynced badge when task has local changes pending sync. Added aria-labels for accessibility

Copy link
Contributor Author

@ShivaGupta-14 ShivaGupta-14 Dec 23, 2025

Choose a reason for hiding this comment

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

added unsyncedTaskUuids state using sets, adds task UUID to set whenever any field is modified locally, clears all unsynced indicators after successful sync, passes isUnsynced prop to TaskDialog to display visual indicator and total count of unsync tasks on sync button

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added tests for unsynced badge visibility based on isUnsynced prop

Copy link
Contributor Author

Choose a reason for hiding this comment

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

new test cases for unsync tasks

Copy link
Contributor Author

@ShivaGupta-14 ShivaGupta-14 left a comment

Choose a reason for hiding this comment

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

self review completed! open to any suggestions

@ShivaGupta-14
Copy link
Contributor Author

Hi @its-me-abhishek! this is ready for review. please review whenever you get time.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Visual Indicator for Modified / Unsynced Tasks on Frontend

2 participants