Skip to content

feat: implement presentation activity view (#93) - #96

Draft
Vitalisn4 wants to merge 16 commits into
mainfrom
feat/93-presentation-activity-view
Draft

feat: implement presentation activity view (#93)#96
Vitalisn4 wants to merge 16 commits into
mainfrom
feat/93-presentation-activity-view

Conversation

@Vitalisn4

@Vitalisn4 Vitalisn4 commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Implements Presentation Activity (#93): Activity History list, Shared Claims detail, and delete confirmation — aligned with Figma and wired to the live API.

Changes

  • Activity History (/activity) — sticky header/footer, scrollable cards, settings icon
  • Shared Claims (/activity/:id) — full-width detail view from card click
  • Cards — full-card click, mint hover (#e6f4e6), trash opens delete modal
  • Delete modal — Figma copy; red Yes, delete activity button
  • APIGET/DELETE /presentation/activity; mock data and filter UI removed

Test plan

  • Activity list loads from backend (or shows empty state)
  • Header/footer stay fixed while scrolling
  • Card click opens Shared Claims; hover shows mint green
  • Delete flow works via API; Cancel closes modal
  • npm test passes for presentation activity modules

Closes #93

Add activity history list and detail pages with filters, pagination,
delete confirmation, and API client for /presentation/activity.
Vitalisn4 and others added 2 commits June 4, 2026 17:57
Keep OpenAPI presentation endpoints out of this UI PR; file remains
editable locally for backend alignment.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Ngha-Boris

Copy link
Copy Markdown
Collaborator

Hello @Vitalisn4
Please dispay a better error here
image

@Ngha-Boris

Copy link
Copy Markdown
Collaborator

Hello @Vitalisn4 Please dispay a better error here image

I don't even think we should have an error massage like the one in red on this page, @mbunwe-victor what do you think?

Vitalisn4 and others added 3 commits June 5, 2026 09:27
Map API failures to readable copy instead of raw GET paths and status
codes; hide empty state when the list fails to load.
Bring in CI workflow update (e2e job removed from GitHub Actions).

Co-authored-by: Cursor <cursoragent@cursor.com>
@mbunwe-victor

Copy link
Copy Markdown
Collaborator

Hello @Vitalisn4 Please dispay a better error here image

I don't even think we should have an error massage like the one in red on this page, @mbunwe-victor what do you think?

Yes, we shouldn't have the error displayed on this page, after which we get the note saying there was no "past activity," which I also understand because we are calling the backend to check for the various activities, which is not yet fully implemented.

We should gladly just move to the Activity page for now, without the error pop-up.

@mbunwe-victor mbunwe-victor left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hello @Vitalisn4, thank you so much for this PR. I have a concern.
So, going through the implementation, I noticed you added a certain page, PresentationActivityDetailsPage, and I don't recall us having that, or maybe it's a missing design. Does it follow the happy path?

Comment thread .env.example Outdated

@Ngha-Boris Ngha-Boris left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Code Review: Presentation Activity View Implementation

Summary

The implementation largely meets the ticket requirements with good overall code quality, strong type safety, and proper privacy considerations. Most acceptance criteria are satisfied including chronological ordering, pagination, filtering, deletion with confirmation, and privacy safeguards.

✅ Requirements Met

  • PresentationActivityPage and PresentationActivityItem components created
  • GET /presentation/activity and DELETE /presentation/activity/:id endpoints integrated
  • Chronological ordering (newest first) with proper sorting
  • Verifier information (name, logo, client_id) displayed
  • Credential types and claim count (metadata only) shown
  • Details view with PresentationActivityDetailPage
  • Pagination with "Load more" pattern
  • Date range and verifier name filters
  • Delete/forget option with confirmation dialog
  • Auto-expiry configuration (30 days default)
  • No sensitive claim values stored

🔴 Issues Requiring Attention

Issue 1: Race Condition in Filter Debounce

File: src/hooks/usePresentationActivity.ts (lines 68-71)

The debounce pattern can cause stale filter updates to overwrite newer ones if filters change rapidly within the 350ms window.

useEffect(() => {
  const timeoutId = window.setTimeout(() => setAppliedFilters(filters), 350)
  return () => window.clearTimeout(timeoutId)
}, [filters])

Suggestion: Use a ref to track latest filters:

const latestFilters = useRef(filters)
latestFilters.current = filters

useEffect(() => {
  const timeoutId = window.setTimeout(() => {
    setAppliedFilters(latestFilters.current)
  }, 350)
  return () => window.clearTimeout(timeoutId)
}, [filters])

Issue 2: Stale Closure in removeItem Callback

File: src/hooks/usePresentationActivity.ts (lines 122-130)

The setHasMore calculation uses page and total from closure which may be stale due to React's batched state updates.

setHasMore(page * DEFAULT_PRESENTATION_ACTIVITY_PAGE_SIZE < total - 1)

Suggestion: Calculate reactively in a separate useEffect based on items.length, page, and total, or use functional updates to ensure consistency.


Issue 3: Error State Not Cleared on Successful Delete

File: src/hooks/usePresentationActivity.ts (lines 122-130)

After successful deletion, any previous error message remains displayed.

Suggestion: Add setErrorMessage(null) or call clearError() after successful deletion in the removeItem function.


🟡 Suggestions for Improvement

  1. Date Range Validation: Add validation to ensure from date is not after to date in PresentationActivityFilters.tsx

  2. Accessibility Enhancement: Add aria-busy={loadingMore} to the "Load more" button for better screen reader support

  3. Zero Claims Message: Consider showing "No claims shared" instead of "0 claims shared" for better UX

  4. Test Coverage: Add tests for:

    • PresentationActivityDetailPage error states
    • DeletePresentationActivityDialog interactions
    • Filter functionality and edge cases

Positive Highlights

  • ✅ Strong privacy practices (metadata only, no claim values)
  • ✅ Defensive client-side retention filtering
  • ✅ Proper UUID validation before API calls
  • ✅ Context-specific, user-friendly error messages
  • ✅ Good accessibility with ARIA labels and roles
  • ✅ Comprehensive TypeScript types with runtime validation
  • ✅ Proper AbortController cleanup for API requests
  • ✅ Clean architecture with separation of concerns

Overall: Good implementation that meets the requirements. Please address the race condition (Issue 1) and stale closure (Issue 2) before merging, as these could cause subtle bugs in production.

Vitalisn4 added 2 commits June 9, 2026 08:23
Align Activity History and Shared Claims with design specs: sticky header/footer,
clickable activity cards with hover, Figma-style delete confirmation, and full-width
Shared Claims detail. Remove dev filters and mock activity data so all screens call
the real presentation activity endpoints.
@Vitalisn4

Copy link
Copy Markdown
Collaborator Author

Here are the different screens
image
image
image

Vitalisn4 added 3 commits June 9, 2026 09:41
Reduce the Shared Claims title and header padding to match Figma via a
reusable compact mode on Header.
Keep both presentation request entry (/present) from main and
presentation activity routes (/activity) from this branch.
Match delete confirmation width to activity cards and use compact outline buttons. Limit Show All to expanding the credential description only and update detail page tests.

@mbunwe-victor mbunwe-victor left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hello @Vitalisn4, I have a few comments I would like you to check. Also, the screens you shared earlier looked good, and now I am waiting for the delete card as we spoke about, if you can share a screenshot.

Comment thread src/components/Header.tsx

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I honestly don't know why we have all these changes here

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I honestly don't know why we have all these changes here

That's for the Shared Claims page to mirror our existing wallet in the word size and card thickness

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Oh, I see, thanks. I'd prefer we stay consistent with the existing wallet pattern link in CredentialTypesPage and CredentialTypeDetailsPage, where we made use of a sub-header. Rather than adding a compact mode to the shared Header. WDYT

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Oh, I see, thanks. I'd prefer we stay consistent with the existing wallet pattern link in CredentialTypesPage and CredentialTypeDetailsPage, where we made use of a sub-header. Rather than adding a compact mode to the shared Header. WDYT

That makes sense, meaning the header for that Share Claims will have to be left as big as it was before trying to reduce right?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

No, if it should follow the flow in the files I mentioned, I suppose the only thing that needs to change is the title, and everything else stays the same.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

No, if it should follow the flow in the files I mentioned, I suppose the only thing that needs to change is the title, and everything else stays the same.

Great, working on that

Comment thread src/pages/PresentationActivityPage.tsx Outdated
@mbunwe-victor

Copy link
Copy Markdown
Collaborator
image

The text is so centralised, and compared with the positioning of text in the Figma design, it doesn't align. Could you check that too?

@Vitalisn4

Copy link
Copy Markdown
Collaborator Author

Here is the confirm deletion
image

Vitalisn4 added 3 commits June 9, 2026 18:09
Remove unused rightSlot and titleClassName from Header, keeping only compact mode for Shared Claims. Drop the settings icon from Activity History, top-align empty state copy, and update tests.
Size the modal slightly inside the card column, tighten edge padding, and offset margins so the dialog sits centered under the activity list.
@Vitalisn4

Copy link
Copy Markdown
Collaborator Author
image

The text is so centralised, and compared with the positioning of text in the Figma design, it doesn't align. Could you check that too?

Addressed

@Vitalisn4
Vitalisn4 requested a review from mbunwe-victor June 10, 2026 07:21
@Vitalisn4

Copy link
Copy Markdown
Collaborator Author

Hello @mbunwe-victor @Ngha-Boris , can you check again now, I have implemented the reviews

@Vitalisn4
Vitalisn4 marked this pull request as draft June 10, 2026 14:56
@Vitalisn4
Vitalisn4 marked this pull request as ready for review June 16, 2026 07:06
@Vitalisn4
Vitalisn4 marked this pull request as draft June 16, 2026 07:45
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.

Implement Presentation Activity View

3 participants