Skip to content

feat: add a recently-viewed commitments rail to the detail page - #1709

Merged
1nonlypiece merged 2 commits into
Commitlabs-Org:masterfrom
mikewheeleer:issue-968-recently-viewed-commitments
Jul 30, 2026
Merged

feat: add a recently-viewed commitments rail to the detail page#1709
1nonlypiece merged 2 commits into
Commitlabs-Org:masterfrom
mikewheeleer:issue-968-recently-viewed-commitments

Conversation

@mikewheeleer

Copy link
Copy Markdown
Contributor

Summary

Context: as noted on #924's PR, this repo has a large amount of previously-deleted UI infrastructure from a prior incident (a single commit deleted ~2,500 files / 170K lines). There's no "My Commitments" list page currently -- it was among the deleted files and hasn't been rebuilt -- so per maintainer guidance I'm wiring this feature into the commitment detail page instead, the one real, existing page in the commitments domain.

What this adds

  • Generalizes useRecentlyViewed to accept an optional storageKey parameter (defaulting to the existing 'marketplace-recently-viewed' key, so its current behavior and all existing tests are unchanged) instead of duplicating the whole hook for a second domain. Adds RECENTLY_VIEWED_COMMITMENTS_KEY as the commitments-domain key.
  • Adds RecentlyViewedCommitmentsRail, a small presentational component (pure props in, renders nothing when the entry list is empty).
  • The commitment detail page (src/app/commitments/[id]/page.tsx) now records each view via addView and renders a rail of other recently-viewed commitments (current one excluded) in the sidebar, each linking to its own detail page.

Testing

  • useRecentlyViewed.test.ts -- added a test confirming a custom storageKey tracks independently of the default marketplace key (reads/writes don't cross-contaminate).
  • RecentlyViewedCommitmentsRail.test.tsx -- 3 tests (renders nothing when empty, renders a link per entry with correct href/labels, accessible nav label).
  • All existing tests for useRecentlyViewed still pass unchanged.

Note on verification: this page doesn't currently build end-to-end (pre-existing, unrelated missing modules -- @/lib/clientEnv, @/components/ErrorBoundary, @/components/dashboard/CommitmentHealthMetrics, etc. -- part of the same deletion incident, same as #924). Confirmed via git stash A/B comparison that this diff adds zero new build errors (identical Module not found list with and without this change) and zero new test failures.

Closes #968

There's no "My Commitments" list page in this repo currently (it was
among the ~2,500 files deleted in a prior incident and hasn't been
rebuilt), so this wires the feature into the commitment detail page
instead -- the one real, existing page in the commitments domain.

- Generalizes useRecentlyViewed to accept an optional storageKey
  (defaulting to the existing marketplace key, so its current
  behavior/tests are unchanged) instead of duplicating the hook for a
  second domain.
- Adds RECENTLY_VIEWED_COMMITMENTS_KEY and a small
  RecentlyViewedCommitmentsRail presentational component.
- The detail page now records each view and renders a rail of other
  recently-viewed commitments (excluding the current one), linking to
  their own detail pages. Renders nothing when there's nothing to
  show.

Note: this page currently doesn't build end-to-end (pre-existing,
unrelated missing modules -- @/lib/clientEnv, @/components/ErrorBoundary,
etc., part of the same deletion incident). Confirmed via git stash A/B
comparison that this diff adds zero new build errors and zero new test
failures.

Closes Commitlabs-Org#968
@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

@mikewheeleer is attempting to deploy a commit to the 1nonly's projects Team on Vercel.

A member of the Team first needs to authorize it.

@1nonlypiece
1nonlypiece merged commit ab646f5 into Commitlabs-Org:master Jul 30, 2026
9 of 11 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.

Add a recently-viewed commitments rail to the My Commitments page

2 participants