Skip to content

Fix: handle edge case in progress calculation when no tasks exist#112

Open
Bhavesh-om wants to merge 1 commit into
JIYAJAIN30:mainfrom
Bhavesh-om:fix-progress-bug
Open

Fix: handle edge case in progress calculation when no tasks exist#112
Bhavesh-om wants to merge 1 commit into
JIYAJAIN30:mainfrom
Bhavesh-om:fix-progress-bug

Conversation

@Bhavesh-om
Copy link
Copy Markdown

###111

Bug Fix: Progress shows 100% when no tasks exist

Issue Reference: Fixes #

Bug Description
When all tasks are deleted after being completed, the progress text briefly shows 100% (0/0 tasks completed) before resetting. This creates confusion for users, as it suggests completion even when no tasks exist.

Steps to Reproduce

  1. Add a few tasks.
  2. Mark all tasks as completed.
  3. Delete all tasks.
  4. Observe the progress text — it may show 100% (0/0 tasks completed).

Expected Behavior
Instead of showing 100% (0/0 tasks completed), the app should display a clear message like:

  • "No tasks yet!"
    or
  • "Progress: 0% (0/0 tasks completed)"

Proposed Solution

  • Updated the updateProgress() function to handle the edge case when total === 0.
  • Now displays "No tasks yet!" instead of misleading 100%.

Environment

  • Browser: Chrome / Firefox / Edge
  • OS: Windows 10
  • Project: Productivity Tracker (HTML, CSS, JS)

Screenshots

  • Before:
Screenshot 2026-05-22 183537
  • After:
Screenshot 2026-05-22 183850

@Karanjot786
Copy link
Copy Markdown

Hey @Bhavesh-om! Saw your work on GSSoC 2026.

We are building TermUI, a TypeScript terminal UI framework with React-style hooks and JSX, rendered entirely in the terminal.

We have 67 unassigned GSSoC issues open. 19 are marked good first issue. Your JavaScript background transfers directly.

Karanjot, TermUI maintainer

@Bhavesh-om
Copy link
Copy Markdown
Author

Hi @JIYAJAIN30 👋
I’ve updated the PR with before/after screenshots and the fix is ready.
Kindly review and merge when convenient. Thanks!

@Bhavesh-om
Copy link
Copy Markdown
Author

Hi @Karanjot786, thanks for reaching out!
TermUI sounds exciting — I’ll check out the open issues and see where I can contribute.

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.

2 participants