feat: add a recently-viewed commitments rail to the detail page - #1709
Merged
1nonlypiece merged 2 commits intoJul 30, 2026
Merged
Conversation
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
|
@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. |
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.
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
useRecentlyViewedto accept an optionalstorageKeyparameter (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. AddsRECENTLY_VIEWED_COMMITMENTS_KEYas the commitments-domain key.RecentlyViewedCommitmentsRail, a small presentational component (pure props in, renders nothing when the entry list is empty).src/app/commitments/[id]/page.tsx) now records each view viaaddViewand 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 customstorageKeytracks 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, accessiblenavlabel).useRecentlyViewedstill 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 viagit stashA/B comparison that this diff adds zero new build errors (identicalModule not foundlist with and without this change) and zero new test failures.Closes #968