Skip to content

T1 Bounty: Add TimeAgo relative timestamps component (fixed)#614

Closed
davidweb3-ctrl wants to merge 3 commits intoSolFoundry:mainfrom
davidweb3-ctrl:fix/bounty-486-timeago
Closed

T1 Bounty: Add TimeAgo relative timestamps component (fixed)#614
davidweb3-ctrl wants to merge 3 commits intoSolFoundry:mainfrom
davidweb3-ctrl:fix/bounty-486-timeago

Conversation

@davidweb3-ctrl
Copy link
Contributor

Summary

Add reusable TimeAgo component for displaying relative timestamps with auto-updates and hover tooltips.

Changes

  • TimeAgo.tsx - Core component with relative time formatting
  • TimeAgo.test.tsx - Full test coverage (16 tests passing)
  • Applied to: BountyCard, BountyListView, BountyTimeline, ActivityFeed

Fixes Applied

  • Fixed 7-day boundary logic (< 7 to <= 7)
  • Added invalid date handling
  • Fixed test timing issues
  • Added act() wrapper for React state updates

Test Results

Wallet: EDFxPF6yAQNod3nFzwV7z1qwSjt42WDYzmdT6b6YHDh7

Bounty


Previous PR #593 was auto-closed due to package-lock.json - this is the fixed version

- Create reusable TimeAgo component with auto-update
- Add comprehensive test suite
- Apply to bounty cards, list view, timeline, and activity feed
- Supports multiple formats: just now, Xm ago, Xh ago, Xd ago, date
- Includes tooltip with full datetime on hover
- Fix 7-day boundary logic (< 7 to <= 7)
- Add invalid date handling with safe fallbacks
- Fix test expectations for 60-minute boundary
- Add tests for invalid date inputs

Fixes critical issues from multi-LLM review (score: 6.4/10)
- Fix 'just now' test with deterministic timing
- Add act() wrapper for auto-update test
- Import act from testing-library/react
@coderabbitai
Copy link

coderabbitai bot commented Mar 22, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR introduces a new reusable TimeAgo component that displays relative timestamps (e.g., "just now", "2 hours ago") with auto-refresh capability for recent dates. The component is integrated across four existing components: BountyDetailPage (activity feed), BountyTimeline (stage headers), BountyCard (creation time), and BountyListView (new column). Each integration conditionally renders the relative timestamp with appropriate styling. A comprehensive test suite validates the relative-time formatting logic, date validation, interval-based updates, and component rendering behavior.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~28 minutes

Possibly related issues

Possibly related PRs

Suggested labels

missing-wallet

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'T1 Bounty: Add TimeAgo relative timestamps component (fixed)' accurately and concisely describes the main change: adding a new reusable TimeAgo component for relative timestamp display.
Description check ✅ Passed The description is well-organized, directly related to the changeset, covering the new component, test coverage, where it's applied, fixes applied, and references the related bounty issue.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Tip

You can customize the high-level summary generated by CodeRabbit.

Configure the reviews.high_level_summary_instructions setting to provide custom instructions for generating the high-level summary.

@davidweb3-ctrl
Copy link
Contributor Author

Closing as duplicate - PR #593 was reopened by the team. Thanks!

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.

1 participant