Skip to content

feat: support and audit tabs for class detail page#1095

Merged
CK-7vn merged 54 commits intoCK-7vn/total-refactorfrom
CK-7vn/class-detail-remaining
Apr 3, 2026
Merged

feat: support and audit tabs for class detail page#1095
CK-7vn merged 54 commits intoCK-7vn/total-refactorfrom
CK-7vn/class-detail-remaining

Conversation

@CK-7vn
Copy link
Copy Markdown
Member

@CK-7vn CK-7vn commented Feb 26, 2026

Add Support tab with at-risk resident detection (attendance below 75% or consecutive absences) and Audit tab with class history timeline. Completes all 6 class detail tabs.

Pre-Submission PR Checklist

  • No debug/console/fmt.Println statements
  • Unnecessary development comments removed
  • All acceptance criteria verified
  • Functions according to ticket specifications
  • Tested manually where applicable
  • Branch rebased with latest main
  • No business logic exists within the database layer

Description of the change

Adds the final two tabs — Support and Audit — to the class detail page, completing all 6 tabs.

Support Tab (SupportTab.tsx)

  • Identifies at-risk residents using two criteria: attendance rate below 75% or 2+ consecutive absences
  • Computes per-resident stats from event instances and enrollment data (attendance rate, sessions attended/missed, consecutive absence streak)
  • Displays each at-risk resident with doc ID, name, attendance progress bar, and "Needs Support" badge
  • Empty state when all residents are engaged

Audit Tab (AuditTab.tsx)

  • Fetches class history from /api/program-classes/:id/history
  • Formats entries by field type: class creation, event rescheduled/cancelled/restored, substitute instructor, room change, and generic field changes
  • Parses RRULE date strings for human-readable event dates
  • Show/hide toggle when history exceeds 20 entries
  • Empty state when no audit history exists

index.tsx

  • Imports SupportTab and AuditTab
  • Adds Support and Audit tab triggers and content panels
  • Class detail page now has all 6 tabs: Roster, Enrollment History, Sessions, Schedule, Support, Audit

@CK-7vn CK-7vn requested a review from a team as a code owner March 3, 2026 22:29
@CK-7vn CK-7vn requested review from carddev81 and removed request for a team March 3, 2026 22:29
@CK-7vn CK-7vn force-pushed the CK-7vn/class-detail-sessions branch from cc8d6d3 to 2775eed Compare March 5, 2026 22:00
@CK-7vn CK-7vn force-pushed the CK-7vn/class-detail-remaining branch from b25ee52 to 9170257 Compare March 5, 2026 22:00
@CK-7vn CK-7vn force-pushed the CK-7vn/class-detail-sessions branch from 2775eed to 202e7a8 Compare March 7, 2026 06:36
@CK-7vn CK-7vn force-pushed the CK-7vn/class-detail-remaining branch from 9170257 to 77cc005 Compare March 7, 2026 06:36
@CK-7vn CK-7vn force-pushed the CK-7vn/class-detail-sessions branch from 202e7a8 to 41e3174 Compare March 7, 2026 09:18
@CK-7vn CK-7vn force-pushed the CK-7vn/class-detail-remaining branch 2 times, most recently from bec2211 to 5ffed45 Compare March 10, 2026 21:44
@CK-7vn CK-7vn force-pushed the CK-7vn/class-detail-sessions branch from cf6606a to 53ca3c1 Compare March 12, 2026 17:59
@CK-7vn CK-7vn force-pushed the CK-7vn/class-detail-remaining branch 2 times, most recently from 9dd506a to 8d8e1ae Compare March 12, 2026 18:18
Copy link
Copy Markdown
Contributor

@carddev81 carddev81 left a comment

Choose a reason for hiding this comment

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

@CK-7vn I did not complete my review of this PR because this branch of code does not contain the latest changes from total_refactor branch (rebase is needed)--missing (program details fac admin version with breadcrumbs at top. Please rebase this branch to contain all of these changes, I want to make sure we don't break anything along the way and not have to revisit completed work. Also, I noticed that toast messages were flagged in other PRs for being displayed at the top and green--figma displays them at the bottom, i think maybe that the fixes you made are not here.

Other issues that I found while reviewing

  1. Duration metric card is not displaying correct schedule--notice start date (Start date set was sept 1, but displays the last day of september)
  2. Metric Cards (do not match the size of figma also font sizes do not match)
  3. Focus ring on Scheduled button is black but figma doesn't have a focus ring, you can remove this entirely
Image
  1. when creating an instructor/room it does not auto select the instructor/room
  2. toast messages are appearing at the top and are green in color, figma appears at bottom and just bolded.

The plan is to completely review the design of Class Details since this contains all the previously reviewed design changes and check all functionality.

@CK-7vn CK-7vn force-pushed the CK-7vn/class-detail-remaining branch from 3f93d5b to 739b88c Compare March 16, 2026 18:24
@CK-7vn CK-7vn force-pushed the CK-7vn/class-detail-sessions branch 2 times, most recently from e7818d5 to dc0584a Compare March 16, 2026 18:51
@CK-7vn CK-7vn force-pushed the CK-7vn/class-detail-remaining branch 3 times, most recently from bcfa395 to 0f1db52 Compare March 16, 2026 20:15
@CK-7vn CK-7vn force-pushed the CK-7vn/class-detail-sessions branch 2 times, most recently from 5dd576b to 6a3c809 Compare March 17, 2026 20:49
@CK-7vn CK-7vn force-pushed the CK-7vn/class-detail-remaining branch from 3d8bef3 to adc73aa Compare March 17, 2026 20:50
Copy link
Copy Markdown
Contributor

@carddev81 carddev81 left a comment

Choose a reason for hiding this comment

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

@CK-7vn I did another partial review, can you please fix all my findings below and please compare figma to this PRs design...only because I was finding a lot of differences between the two. I thought these findings may have been flagged before?

  1. Duration card at top doesn't display correct information when class has no end date (I liked your previous format better, it wasn't formated as an SQL date--question for @calisio )
  2. Duration card at top displays - when there is an end date, should be the word 'to'
  3. When clicking the Schedule tab Duration information doesn't match figma (also should the date be in this format @calisio , figured it would be more user friendly--same goes for all duration information cards not just this one?)
  4. Change status modal
    • when opening the modal the the select box isn't focused as it is in the figma
    • spacing between 'New Status' and select box doesn't match
    • Update Status button is disabled

Target status modal

Image

Current status modal

Image
  1. When deleting a class it does not delete, it still shows up in the classes list like it was not deleted
  2. Within Edit class modal spacing between label and form input needs to be less of a gap
  3. Noticed that Edit class is missing an entire piece within the schedule (also noticed there is no astrisks)

Target schedule (Edit Class Modal)

Image

Current schedule (Edit Class Modal)

Image
  1. Sessions tab is unresponsive and not populating. It almost seems as if there is an infinite loop or there is a long running task here

Wanted to get some more work out to you so I don't hold you up. These are just some of my findings. Please double check to make sure everything is working correctly?

Copy link
Copy Markdown
Contributor

@carddev81 carddev81 left a comment

Choose a reason for hiding this comment

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

@CK-7vn Issues have reappeared again, not sure if you rebased again? The breadcrumbs and spacing from total refactor are missing again. I had to stop reviewing because we are out of sync with total_refactor and I was finding the same issues as before? Not sure what happened in this last push with the request of changes.

  1. Same issue is appearing as before with the schedule in the Duration metrics card see image below. Also since you are fixing this issue, might as well spell the entire month name out? Your choice)
Image
  1. Same issue exists that I found in the second review--Sessions tab when clicking on it still locks up and doesn't populate with info from classes that I created. Let me know if you need me to take a video of this and I'll send it your way--I'm unable to review it to make sure functionality is good and to do my spot checking of the ui.
  2. At 'Risk Tab' is not displaying the number in parentheses.

Please spot check current UI with target figmas.

@CK-7vn CK-7vn force-pushed the CK-7vn/class-detail-remaining branch from 416e311 to 087f0d9 Compare March 18, 2026 18:10
@carddev81
Copy link
Copy Markdown
Contributor

@CK-7vn 'Program Details' in this branch still not matching CK7_/total_refactor see below comparison--rebasing issue, not sure what else? Breadcrumbs were fixed but spacing issue exists still.

Target Figma
target-ProgramDetails

Current PR
current-PR-Programs

@carddev81
Copy link
Copy Markdown
Contributor

@CK-7vn Neither cancelling a class or completing a class completes/cancels enrolled residents, the process should do either or based on what status it is changed too. I tested the change class status modal functionality. Residents enrolled stay as enrolled.

modal

@CK-7vn CK-7vn force-pushed the CK-7vn/class-detail-remaining branch from 9b672f5 to 9bdd066 Compare April 3, 2026 19:54
@CK-7vn CK-7vn merged commit b8085b6 into CK-7vn/total-refactor Apr 3, 2026
8 checks passed
@CK-7vn CK-7vn deleted the CK-7vn/class-detail-remaining branch April 3, 2026 20:05
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.

4 participants