Repository navigation
Add Recently Viewed Companies section to Dashboard - #81
Closed
arnavgoel17 wants to merge 1 commit into
Closed
arnavgoel17 wants to merge 1 commit into
arnavgoel17 wants to merge 1 commit into
Conversation
Add a localStorage-backed recent companies list (max 5, most-recent-first, deduplicated) and surface a 'Recently Viewed Companies' section on the Dashboard that navigates to the company guide when clicked. Closes pari-28#32
|
@arnavgoel17 is attempting to deploy a commit to the Pari's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
This pull request has been marked as stale because it has been inactive for 30 days. It will be closed in 7 days if no further activity occurs. |
|
Closing this pull request due to inactivity. |
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.
Fixes #32
📌 Related Issue
Closes #32 — [FEAT] Add Recently Viewed Companies Section.
📝 Description
Track recently visited company preparation pages and display them on the dashboard.
Changes
src/use-cases/recent-companies.ts(new): pure logic for the feature.pushRecent(list, company, max=5)— pure helper that moves a company to thefront, drops duplicate ids (by
id), and caps to 5 (most-recent-first).getRecentCompanies()— reads & defensively parses localStorage.recordRecentCompany(company)— read/modify/write round-trip to localStorage.src/components/CompanyPrep.tsx: callsrecordRecentCompany(company)when auser opens a company guide (the "View Guide" click).
src/components/Dashboard.tsx: adds a Recently Viewed Companies sectionthat loads on mount, lists up to 5 companies (most-recent-first), shows a
relative "Viewed X minutes ago" recency, handles empty state, and navigates to
the company tab + records a re-view on click. Reuses the existing dark theme,
rounded-3xl card, and company-card visual style for consistency.
Acceptance Criteria
pushRecentcap +.slice(0, 5)).pushRecent).🚀 Type of Change
🧪 Testing
How the changes were validated:
npm test✓)npm teston this repo is a smoke stub (0 unit tests found. Smoke test passed.).Because the repo has no test framework wired up (no
vitest/jestconfig;self-check.tslives only on the unmerged #76 branch, not onmain), a formaltest suite could not be added without first introducing a new test dependency —
which this issue's scope (frontend-only feature) does not request.
Instead, the pure-domain logic (
pushRecent: dedupe-by-id, most-recent-first,cap-at-5, custom-max) was verified with a throwaway
tsxself-check (plainnode:assert), run in-repo and then removed; all assertions passed.Run:
npm run lint(tsc --noEmit),npm run build(vite + esbuild) — both green.Backend only: no. Frontend only: yes (
Dashboard.tsx,CompanyPrep.tsx, newuse-cases/recent-companies.ts).📸 Screenshots / Demo
N/A — new dashboard card; visually consistent with neighboring "Recently Solved"
section (same
bg-slate-900/40card +rounded-3xltreatment). Empty state shows aBuilding2icon placeholder.✅ Checklist
npm run lintclean,npm run buildclean).Fixes #32).Pre-Push Checklist
npm run lint— clean (tsc --noEmit, exit 0).npm run build— passes (vite 1693 modules transformed, dist emitted).npm test— passes (smoke).main(branched fresh fromorigin/main,git diff --stat= 3 files, 139 insertions, 15 deletions).AI/co-author markers added.
pari-28/PrepVersetouched; only files needed for this issue modified.
Dashboard.tsx,CompanyPrep.tsx, newuse-cases/recent-companies.ts—frontend only.