Skip to content

Render webhook timestamps#218

Merged
mikewheeleer merged 3 commits into
Agentpay-Org:mainfrom
gloskull:Render-webhook-timestamps
Jun 29, 2026
Merged

Render webhook timestamps#218
mikewheeleer merged 3 commits into
Agentpay-Org:mainfrom
gloskull:Render-webhook-timestamps

Conversation

@gloskull

Copy link
Copy Markdown
Contributor

Motivation
Operators need to see when each webhook was registered, so the list should show a relative created-at alongside an absolute timestamp tooltip.
The UI must tolerate missing or invalid createdAt values so rows still render for older or malformed webhooks.
Description
Render each webhook's createdAt as a relative time using the shared TimeAgo component inside a element and pass a sanitized absolute timestamp via safeFormatTimestamp for the title attribute.
Make createdAt optional in the Webhook type and guard rendering with a hasValidCreatedAt check so missing/invalid values do not break the row.
Add an optional title prop to TimeAgo so callers can provide a precomputed ISO timestamp while preserving the component's dateTime output.
Extend src/app/webhooks/page.test.tsx with tests for valid relative timestamps, missing timestamps, zero/very-old timestamps, unsafe URLs, create/load/delete error flows, and an event-trimming create case, and document the feature in README.md.
Testing
Ran tsc --noEmit (npm run typecheck) which succeeded.
Linted the changed files with npx eslint src/app/webhooks/page.tsx src/app/webhooks/page.test.tsx src/components/TimeAgo.tsx which passed for the modified files, while a full npm run lint failed on unrelated pre-existing lint issues.
Ran the webhook unit tests with npm test -- --runInBand src/app/webhooks/page.test.tsx and the focused suite passed (12 tests).
Collected coverage for the page with --coverage --collectCoverageFrom=src/app/webhooks/page.tsx which reports 100% coverage for the page.
Full npm test and npm run build were attempted but failed due to unrelated pre-existing test failures in other suites and an environment issue fetching Google Fonts during Next.js build, respectively.
Closes #153

@gloskull

gloskull commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

** @mikewheeleer please merge.
If there are anymore tasks, even greater that 10 tasks please assign to me, i'd make sure to complete them in 2hours and submit PR**

@mikewheeleer

Copy link
Copy Markdown
Contributor

nice work — in it goes 👍

@mikewheeleer mikewheeleer merged commit 9d3f59b into Agentpay-Org:main Jun 29, 2026
1 check failed
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.

Render webhook timestamps with TimeAgo on the webhooks list

2 participants