Skip to content

Improve weekly attendance projection behavior#40

Open
theatulkumar1 wants to merge 2 commits into
AmanDevelops:masterfrom
theatulkumar1:feature/improve-weekly-projection
Open

Improve weekly attendance projection behavior#40
theatulkumar1 wants to merge 2 commits into
AmanDevelops:masterfrom
theatulkumar1:feature/improve-weekly-projection

Conversation

@theatulkumar1
Copy link
Copy Markdown

Summary

This PR improves the Weekly Projection feature so projected attendance updates for all upcoming classes,
not only the classes selected as missed.

Added Feature

Previously, when a student selected classes they planned to miss, only those selected subjects/classes
affected the projected attendance numbers. Unselected upcoming classes were ignored.

Now, the projection works more realistically:

  • Upcoming unselected classes are treated as attended by default.
  • Selected classes are treated as missed.
  • Subjects with upcoming classes now also show projected attendance changes even if the student does not
    manually select them.
  • Original attendance is restored when the projection panel is hidden.

New Projection Behavior

  • If a class is not selected:

    • total classes increase
    • present classes increase
    • attendance may improve
  • If a class is selected as missed:

    • total classes increase
    • present classes do not increase
    • attendance may decrease

Technical Changes

  • Reworked projection logic to calculate from the original attendance snapshot.
  • Added stable class keys for checkbox tracking.
  • Removed incremental mutation logic that only updated selected missed classes.
  • Unmounts the projection component when hidden so attendance resets correctly.

Testing

  • npm run build passed.
  • npm run lint passed.

@AmanDevelops
Copy link
Copy Markdown
Owner

Great Feature. Some minor improvements.

Instead of marking every class as Present the users should have an independence of marking individual class present or absent, try implementing this

https://play.tailwindcss.com/6EuJjXRfk2

What do you think? @rishav76dev

image

@theatulkumar1
Copy link
Copy Markdown
Author

theatulkumar1 commented May 4, 2026

I improved the weekly projection feature. Now users can select subject/classes first,
then choose Present or Absent projection. Present marks selected classes as attended and
the rest as missed; Absent marks selected classes as missed and the rest as attended.
Reset clears the projection. I pushed it to branch feature/improve-weekly-projection,
commit da1bc7c.
Screenshot 2026-05-04 at 10 32 26 PM

@AmanDevelops
Copy link
Copy Markdown
Owner

Gemini_Generated_Image_9hoclg9hoclg9hoc

AI generated image

The three sliding switch should be on the left side of each class and should give granular independence to select classes as present or absent, you are free to use any other input type.

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.

2 participants