Skip to content

feat(progress): integrate real admin updates as a project journey timeline (#206)#212

Merged
hrx01-dev merged 5 commits into
hrx01-dev:mainfrom
Harsh-goswami-103:feat/progress-real-updates
Jun 26, 2026
Merged

feat(progress): integrate real admin updates as a project journey timeline (#206)#212
hrx01-dev merged 5 commits into
hrx01-dev:mainfrom
Harsh-goswami-103:feat/progress-real-updates

Conversation

@Harsh-goswami-103

@Harsh-goswami-103 Harsh-goswami-103 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Replaces the mock project-stage data in the client dashboard's Progress section with the real, admin-authored updates already managed by the existing Updates system (projectUpdates / useClientUpdates, from #167) — scoped to the signed-in client's own verified email and updating live.

Closes #206

The creative bit

The dashboard already has a flat Updates feed, so rather than duplicate it, the Progress section is reimagined as a "project journey" — a progress-oriented view of the same real data:

  • A gradient summary card: updates posted · milestones reached · latest activity (relative) · journey started, plus a row of milestone "dots".
  • A vertical, newest-first timeline with type-coloured gradient nodes, milestone glow rings, per-update cards (title, type-as-status badge, description, relative + absolute timestamp), and staggered, reduced-motion-aware animations.
  • A friendly empty state ("Your journey is about to begin"), plus loading / error / verify-email states.

A small, pure, unit-tested summarizeUpdates() helper backs the summary.

Acceptance criteria

  • Mock data completely removed from the Progress section (no more project.stages / useProjects)
  • Fetches from the existing Updates module (useClientUpdates)
  • Clients only see their own project's updates (enforced by the existing projectUpdates security rules — verified-email match)
  • Newly published admin updates appear automatically (real-time onSnapshot)
  • Shows title, description, status (update type), date & time, and milestone progress
  • Loading, empty, and error states implemented
  • Existing admin update functionality unchanged (no admin/collection/rules changes)
  • No regressions — the page is code-split and slightly smaller than before

Testing

  • typecheck, lint, test (213 passing, incl. 3 new summarizeUpdates tests), build — all green.
  • Multi-agent adversarial review (integration-correctness / UX-accessibility / regression). Integration came back clean; the two low-severity findings — timestamp contrast below WCAG AA, and a silent resend-verification failure — are fixed in the final two commits (the latter now mirrors UpdatesFeed's auth/too-many-requests handling).

No deploy steps needed (no rules or schema changes).

Summary by CodeRabbit

  • New Features

    • Added a live project updates timeline with newest-first entries, relative timestamps, and clearer type-based badges.
    • Added a progress summary showing total updates, milestone count, and the date range of activity.
    • Added an email verification prompt with a resend option and success/error feedback.
  • Bug Fixes

    • Improved handling for empty updates and missing dates.
    • Summary counts and dates now remain correct regardless of update order.

Pure, order-independent helper deriving the headline progress figures (total,
milestones reached, latest activity, journey start) the Progress section shows
above the timeline.

Refs hrx01-dev#206
Cover totals, milestone counting, the date range (order-independent), the empty
case, and timestamp-less updates.

Refs hrx01-dev#206
Replace the Progress section's mock project-stage data with the real,
admin-authored updates from useClientUpdates (issue hrx01-dev#167's projectUpdates
system) — scoped to the signed-in client's own verified email and updating in
real time.

To stay distinct from the flat Updates feed, the Progress section is a
progress-oriented "project journey": a gradient summary card (updates posted,
milestones reached, latest activity, journey start, plus a milestone dot row)
above a vertical, newest-first timeline with type-coloured nodes, milestone
glow, relative + absolute timestamps, and staggered (reduced-motion-aware)
animations. Loading / verify-email / error / empty states are all handled.

Closes hrx01-dev#206
The resend handler swallowed errors, so a failed/rate-limited resend silently
re-enabled the button with no feedback. Mirror UpdatesFeed: track a sendError,
distinguish auth/too-many-requests, and render it in a role="alert".

Refs hrx01-dev#206
The per-update timestamp used text-gray-400/dark:gray-500 (~2.5:1 / ~3.7:1),
below the 4.5:1 AA threshold for small text. Bump to gray-500/dark:gray-400
(matching the summary stat labels), which passes AA in both themes.

Refs hrx01-dev#206
@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

@Harsh-goswami-103 is attempting to deploy a commit to the hrx01-dev's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

The dashboard progress view now uses client updates to show summary stats, newest-first timeline entries, loading/error/empty states, and email-verification resend handling. A new summarizeUpdates helper aggregates total updates, milestone counts, and date bounds, with tests for ordering and null timestamps.

Changes

Client progress timeline

Layer / File(s) Summary
Update summary helper
src/dashboard/lib/updates.ts, src/dashboard/lib/updates.test.ts
UpdatesSummary and summarizeUpdates aggregate totals, milestone counts, and date bounds, with tests for order independence, empty input, and null timestamps.
Page primitives and formatting
src/dashboard/pages/ProjectProgress.tsx
Adds TYPE_CONFIG, relative-time formatting, and shared header/stat components for the rewritten page.
Verification and early states
src/dashboard/pages/ProjectProgress.tsx
Adds resend-verification state and handlers, plus loading, verification, error, and empty-update branches.
Progress summary card
src/dashboard/pages/ProjectProgress.tsx
Renders the summary metrics card from summarizeUpdates(updates) with total updates, milestones, latest activity, and journey start.
Update timeline
src/dashboard/pages/ProjectProgress.tsx
Renders newest-first update cards with type-specific icons, badges, connectors, and relative/absolute timestamps.

Sequence Diagram(s)

sequenceDiagram
  participant ProjectProgress
  participant useClientUpdates
  participant summarizeUpdates
  participant sendEmailVerification

  ProjectProgress->>useClientUpdates: fetch updates state
  useClientUpdates-->>ProjectProgress: updates, loading, error, needsEmailVerification
  ProjectProgress->>summarizeUpdates: aggregate updates
  summarizeUpdates-->>ProjectProgress: total, milestones, latest, started
  ProjectProgress->>sendEmailVerification: resend verification for auth.currentUser
  sendEmailVerification-->>ProjectProgress: success or auth/too-many-requests
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • hrx01-dev/Servio#68: Introduced the earlier stage-based ProjectProgress page that this PR replaces with client updates.
  • hrx01-dev/Servio#170: Added the dashboard updates model/hook pipeline that this PR now consumes in ProjectProgress.

Suggested reviewers

  • hrx01-dev

Poem

I hopped through updates, bright and new,
With milestones sparkling in the view.
The timeline twinkled, newest first,
And resend hops quenched my thirst.
Thump! 🐰

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 42.86% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: replacing the progress section with a real updates-driven journey timeline.
Linked Issues check ✅ Passed The PR appears to replace mock progress data with client-scoped live updates, adds graceful states, and keeps admin functionality unchanged.
Out of Scope Changes check ✅ Passed No clearly unrelated code changes are indicated beyond the timeline, summary, verification, and testing work needed for the updates integration.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@hrx01-dev hrx01-dev left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Nice work CI green

@hrx01-dev hrx01-dev merged commit 03cf99f into hrx01-dev:main Jun 26, 2026
4 of 6 checks passed
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.

Integrate Admin Project Updates with Client Dashboard Progress Section

2 participants