Skip to content

feat: implement timestamp-based standup slot classification (GOOD / DELAYED / MISSING) with strict full-data status loading

Kushal Lagichetty requested to merge feat/timestamp into main

Context

The status dashboard needed deterministic, slot-level classification of standup uploads for the selected date, while preserving existing validity rules (standup + internship labels). It also needed to stop showing partial results when some intern fetches fail.

Problem Statement

Current behavior had two gaps:

  1. Slot status logic did not fully enforce consistent timestamp boundaries across all four daily slots.
  2. Status view could render partial data when some intern requests failed, which made the UI look complete even when it was not.

What This MR Changes

1) Slot classification utility (reusable, timezone-aware)

  • Introduces/updates reusable slot classification in:
    • src/utils/verification/standupSlots.ts
  • Uses explicit timezone handling (Asia/Kolkata) for all timestamp-to-slot mapping.
  • Enforces per-slot timing behavior:
    • GOOD when upload is before the slot’s on-time deadline.
    • DELAYED when upload is after on-time deadline but before late cutoff.
    • MISSING when no valid upload is assigned to that slot.
  • Uses strict comparisons for boundaries to avoid ambiguous equality behavior.
  • Ensures each slot resolves to a single visible state (GOOD / DELAYED / MISSING).

2) Verification integration in dashboard flow

  • Integrates slot statuses into team/intern verification and state in:
    • src/components/dashboard/DashboardLayout.tsx
    • src/components/dashboard/TeamList.tsx
    • src/components/intern/InternCard.tsx
  • Keeps existing completion/pending indicators intact while adding slot-level detail.
  • Slot results are computed only from already valid standup uploads (existing label criteria remains respected).

3) Status panel reliability (no partial-data rendering)

  • Refactors status summary loading to enforce all-or-nothing data integrity:
    • Uses Promise.all(...) for batch intern fetches.
    • Adds retry (up to 3 attempts) per failed intern request before surfacing failure.
  • Removes partial-data warning/banner entirely.
  • If data cannot be fully fetched after retries:
    • shows clear error state + refresh action
    • does not render partial rows as complete output.

4) Alias/token normalization improvements

  • Improves alias parsing to correctly handle whitespace tokenization in:
    • src/utils/verification/verifyStandup.ts
    • src/components/dashboard/DashboardLayout.tsx
  • Prevents missed matches for multi-word labels.

5) Changelog workflow improvement

  • Adds changelog automation helper:
    • scripts/updateChangelog.js
    • package.json script: npm run changelog:update
  • Updates CHANGELOG.md to reflect the above behavior changes.

Slot Rules Implemented

Slots

  • S1: 09:00-09:30 (late cutoff 12:00)
  • S2: 12:00-12:30 (late cutoff 14:00)
  • S3: 14:00-14:30 (late cutoff 16:30)
  • S4: 16:30-17:00 (late cutoff 23:59)

Evaluation order

  1. Missing/null upload => MISSING
  2. Upload < on_time_deadline => GOOD
  3. Upload < late_cutoff => DELAYED
  4. Otherwise => MISSING

Acceptance Criteria Mapping

  • Upload at slot end boundary behavior is covered and enforced by tests.
  • Classification behavior is applied consistently for all 4 slots.
  • Each slot has exactly one visible state per selected date.
  • Existing valid-standup filtering remains a prerequisite to slot classification.
  • Team and intern dashboard views now surface slot statuses.
  • Unit tests include slot boundary scenarios and verification flow coverage.

Files Touched (high-level)

  • src/utils/verification/standupSlots.ts
  • src/utils/verification/verifyStandup.ts
  • src/components/dashboard/DashboardLayout.tsx
  • src/components/dashboard/TeamList.tsx
  • src/components/intern/InternCard.tsx
  • tests/standupSlots.test.ts
  • tests/verifyStandup.test.ts
  • CHANGELOG.md
  • scripts/updateChangelog.js
  • package.json

Testing Performed

  • npm test
  • npm run build

Both pass after this MR’s changes.

Notes for Reviewers

  • Focus review on slot boundary comparisons and date/timezone conversion path in standupSlots.ts.
  • Confirm status panel behavior now fails closed (error+refresh) instead of silently showing partial data.
  • Verify UI semantics for MISSING remain neutral/grey and never default to GOOD.

Merge request reports

Loading