Skip to content

Enhancement: Add Loading Indicators and Duplicate Submission Prevention for Transaction Actions #102

@mithilP007

Description

@mithilP007

Problem Statement

Currently, the transaction creation and update workflow does not properly handle multiple rapid submissions while a request is still processing.

Users can click the submit/update button multiple times, which may lead to:

  • duplicate transaction entries
  • repeated API/database requests
  • inconsistent dashboard totals
  • accidental duplicate expenses/income records
  • confusing UI behavior during async operations

Additionally, there is limited visual feedback during processing, making it unclear whether a request is still running.

Proposed Solution

Implement proper async loading-state handling and duplicate submission prevention for transaction-related actions.

Suggested improvements:

  • disable submit/update buttons while requests are processing
  • add loading indicators/spinners
  • prevent duplicate requests using execution guards
  • restore UI state correctly after request completion/failure
  • improve async cleanup using finally

Example:

if (loading) return;

setLoading(true);

try {
  await submitTransaction();
} finally {
  setLoading(false);
}

Optional enhancements:

  • toast notifications
  • reusable loading button component
  • debounce/throttle handling
  • optimistic UI updates

Affected Component

Frontend Dashboard (Next.js — apps/frontend/)

Estimated Difficulty

🟢 Beginner — Small, self-contained change

Alternatives Considered

A temporary workaround is manually avoiding repeated clicks during submission, but this is unreliable and does not solve the underlying async state-management issue.

Frontend-only button disabling without proper request-state handling was also considered, but a more complete async workflow solution would provide better reliability and scalability.

Additional Context

This enhancement improves:

  • frontend responsiveness
  • data consistency
  • backend efficiency
  • transaction reliability
  • overall user experience

Similar patterns are commonly implemented in financial/productivity applications to avoid duplicate actions and improve UX during async operations.

Contribution

  • I would like to implement this feature and submit a PR.

Checklist

  • I have searched existing issues and this is not a duplicate.
  • I have read the CONTRIBUTING.md guidelines.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions