Render webhook timestamps#218
Merged
mikewheeleer merged 3 commits intoJun 29, 2026
Merged
Conversation
…imeago feat(webhooks): render created-at relative time with TimeAgo
Contributor
Author
|
** @mikewheeleer please merge. |
Contributor
|
nice work — in it goes 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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