fix: remove unused code#1127
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (20)
💤 Files with no reviewable changes (18)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis PR removes provider platform and provider-based learning features from the frontend, replacing provider route registration with knowledge center routes. The change simplifies resident routing to only check ChangesFeature Access Routing Simplification
Route Configuration and Navigation Updates
Removed Provider Management Pages
Removed Provider-Based Student Learning Pages
Dashboard and Component Cleanup
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
Warning Review ran into problems🔥 ProblemsStopped waiting for pipeline failures after 30000ms. One of your pipelines takes longer than our 30000ms fetch window to run, so review may not consider pipeline-failure results for inline comments if any failures occurred after the fetch window. Increase the timeout if you want to wait longer or run a Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
frontend/.husky/staged-files (1)
1-12:⚠️ Potential issue | 🟠 Major | ⚡ Quick winRemove
.husky/staged-filesfrom the PR and add it to.gitignore.This file is a temporary artifact that was accidentally committed to version control. It contains stale file paths, including references to a non-existent
frontend-v2/directory and backend files that are not actually modified in this PR. The.huskydirectory is not part of the Husky framework (there is no Husky configuration inpackage.json), andstaged-filesis not a standard hook file.Remove this file from the commit and ensure
.husky/is added to.gitignoreto prevent accidental commits of temporary files.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@frontend/.husky/staged-files` around lines 1 - 12, Remove the accidental .husky/staged-files from the change set and prevent recurrence by adding .husky/ to .gitignore; specifically, delete the file from the PR (git rm --cached .husky/staged-files or remove it and amend the commit) and add a line ".husky/" to .gitignore, then commit the changes so the temporary artifact is not tracked going forward.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@frontend/.husky/staged-files`:
- Around line 1-12: Remove the accidental .husky/staged-files from the change
set and prevent recurrence by adding .husky/ to .gitignore; specifically, delete
the file from the PR (git rm --cached .husky/staged-files or remove it and amend
the commit) and add a line ".husky/" to .gitignore, then commit the changes so
the temporary artifact is not tracked going forward.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 0cace44b-b709-4675-9c65-364db3e184b1
📒 Files selected for processing (21)
frontend/.husky/staged-filesfrontend/src/auth/useAuth.tsfrontend/src/components/dashboard/WeeklyActivity.tsxfrontend/src/components/navigation/Sidebar.tsxfrontend/src/components/student/CatalogCourseCard.tsxfrontend/src/components/student/EnrolledCourseCard.tsxfrontend/src/hooks/useCheckResponse.tsfrontend/src/layouts/AuthenticatedLayout.tsxfrontend/src/pages/TakeAttendance.tsxfrontend/src/pages/Welcome.tsxfrontend/src/pages/admin/ProviderPlatformManagement.tsxfrontend/src/pages/admin/ProviderUserManagement.tsxfrontend/src/pages/insights/KnowledgeInsights.tsxfrontend/src/pages/insights/LearningInsights.tsxfrontend/src/pages/learning/CourseCatalog.tsxfrontend/src/pages/learning/MyCourses.tsxfrontend/src/pages/learning/MyProgress.tsxfrontend/src/pages/learning/ResidentOverview.tsxfrontend/src/pages/student/StudentDashboard.tsxfrontend/src/routes/index.tsxfrontend/src/routes/provider-routes.tsx
💤 Files with no reviewable changes (18)
- frontend/src/components/dashboard/WeeklyActivity.tsx
- frontend/src/pages/admin/ProviderUserManagement.tsx
- frontend/src/pages/admin/ProviderPlatformManagement.tsx
- frontend/src/auth/useAuth.ts
- frontend/src/pages/insights/LearningInsights.tsx
- frontend/src/pages/insights/KnowledgeInsights.tsx
- frontend/src/pages/learning/MyProgress.tsx
- frontend/src/pages/learning/CourseCatalog.tsx
- frontend/src/pages/student/StudentDashboard.tsx
- frontend/src/pages/Welcome.tsx
- frontend/src/pages/learning/MyCourses.tsx
- frontend/src/routes/provider-routes.tsx
- frontend/src/hooks/useCheckResponse.ts
- frontend/src/routes/index.tsx
- frontend/src/pages/TakeAttendance.tsx
- frontend/src/components/student/CatalogCourseCard.tsx
- frontend/src/components/student/EnrolledCourseCard.tsx
- frontend/src/components/navigation/Sidebar.tsx
carddev81
left a comment
There was a problem hiding this comment.
Looks good. Just had one comment, but this is good to go.
Reconcile local digital-transcript work with remote's frontend-v2 to frontend rename and the unused-code cleanup from PR UnlockedLabs#1127. Hidden developer menu: kept the new DevCommandMenu and componentLibraryCatalog under frontend/src/components/dev/. Quick-access palette for browsing the local component library, not surfaced in production navigation. Two-direction Programs routing: in both useAuth.getResidentLink and the Sidebar Programs entry, users with EITHER FeatureAccess.ProgramAccess OR FeatureAccess.ProviderAccess now land on /resident-programs. The remote had dropped the Provider direction; restoring it keeps both populations on the same Programs hub (hasProgramsHub = hasProgram || hasProvider). Other resolutions: - 33 new transcript-flow files (achievement form, learning record export, resident programs index/layout, demo data, etc.) redirected to frontend/. - 6 files deleted by PR UnlockedLabs#1127 stay deleted; the local edits were mechanical bg-muted to bg-canvas class renames and are obsolete in the new layout. - AuthenticatedLayout: kept startsWith('/resident-programs') for isResidentPage and added isAdmins to the isFullBleed list (from remote). - ResidentOverview: took the rewritten 397-line version (active/archive tabs, demo programs, embedded mode) over remote's 155-line variant. - CaptureToFigmaButton and transcriptSurveyValidation stay deleted. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Pre-Submission PR Checklist
Description of the change
PR implements a ton of deadcode removal. During the refactor a lot of old features that either don't have maximum utility at the moment and or are outdated were decided to be paused, or removed. This lead to a lot of no routes, no imports, or code that depended on provider integrations.
Carolina also asked that we remove learning path code, my courses, my progress, and the resident Programs page bug was fixed, so that it now will at least display the residents current programs.
Also worth noting, I did manually go through and test everything with dept, facility, and resident scoped users, everything seems to work as expected, but, just make sure to test thoroughly. Worst case scenario we pull back in a file from an earlier commit, just don't want to miss anything.
Pages
frontend/src/pages/student/StudentDashboard.tsx
The old "Learning Path" page for residents, which depended on 'ProviderAccess' feature flag and displayed provider-integrated course content.
frontend/src/pages/learning/MyCourses.tsx
"My Courses" page, listed enrolled courses from provider integrations, provider integrations were not ported so, essentially no need for this anymore.
frontend/src/pages/learning/MyProgress.tsx
Showed learning progress across provider platforms, same reason, provider platforms weren't ported, no need for this currently.
frontend/src/pages/learning/CourseCatalog.tsx
Another provider platform reliant page
frontend/src/pages/insights/LearningInsights.tsx
Admin analytics page fro learning/provider activity, once again, no provider integration, no need for this currently.
frontend/src/pages/admin/ProviderPlatformManagement.tsx
Admin page for managing kolibri/Canvas/Brightspace provider platform connections. Provider management intentionally excluded in redesign, so removed.
frontend/src/pages/admin/ProviderUserManagemetn.tsx
Admin page for managing users on external provider platforms. Same reason as ProviderPlatformManagement. No route, no imports.
frontend/src/pages/TakeAttendance.tsx
Old standalone attendance page. Replaced entirely by the
EventAttendancesystem (class-based event attendance with date params). The new router usesprogram-classes/:class_id/events/:event_id/attendance/— no route pointing to the old page, no imports.frontend/src/pages/Welcome.tsx
Deprecated onboarding/welcome page. No route in the new router, zero references anywhere in the codebase.
frontend/src/pages/insights/KnowledgeInsights.tsx
Insights for knowledge center activity, intentionally not included, so removed
Components
frontend/src/components/student/CatalogCourseCard.tsx
Only ever imported by CourseCatalog.tsx which was deleted
frontend/src/components/student/EnrolledCourseCard.tsx
Card component for an enrolled provider course, only 2 pages that imported this component were deleted, so removed it.
frontend/src/components/dashboard/WeeklyActivity.tsx
Only ever imported by studentDashboard.tsx which was deleted, so removed
hooks
frontend/src/hooks/useCheckResponse.tsx
No callers anywhere in the codebase, verified with ast-grep across all import patterns including dynamic imports, type imports, and re-exports. So removed.
Routes
frontend/src/routes/provider-routes.tsx
Entire provider/learning route file, all provider routes, no use for it anymore
Modified Files
frontend/src/routes/index.tsxRemoved
ProviderPlatformRoutesimport and its entry in the router array. Required after deletingprovider-routes.tsx— the import would have crashed the app.frontend/src/auth/useAuth.tsRemoved the
ProviderAccessbranch fromgetResidentLink(). The old logic redirected residents withProviderAccessto/learning-path. That page is deleted; the feature flag no longer maps to any route. Residents now route to/home(OpenContent),/resident-programs(ProgramAccess), or/temp-home(neither).frontend/src/layouts/AuthenticatedLayout.tsxRemoved
/learning-path,/my-courses,/my-progressfrom theisResidentPagearray used for layout/padding logic. Those routes no longer exist.frontend/src/components/navigation/Sidebar.tsxFour removals:
LightBulbIcon,GlobeAltIcon,BookmarkIcon,TrophyIcon,RocketLaunchIcon(only referenced by deleted nav items)const hasProvider = hasFeature(user, FeatureAccess.ProviderAccess)variable (no longer used){hasProvider && <> ... </>}block containing Learning Path, My Courses, My Progress nav linksCollapsibleSectionin AdminNav (contained learning-insights and learning-platforms links)!hasProvider && !hasProgram→!hasProgramin the temp-home fallback condition (removing the now-undefinedhasProviderreference)frontend/src/pages/learning/ResidentOverview.tsx(bug fix, not removal)Fixed a React Rules of Hooks violation. Two
useMemocalls and twouseSWRcalls were placed after an earlyif (!user) return nullguard, which is illegal — hooks must not be called conditionally. Moved all four hooks above the early return and added null-conditional SWR keys (user ? \/api/users/${user.id}/...` : null`) so they no-op safely when user is undefined.Verification Method
All deletions were verified with
ast-grepstructural pattern matching before removal. The final pass covered 10 search patterns per file:import { $X } from '$PATH'import $X from '$PATH'import('$PATH')import type { $X } from '$PATH'export { $X } from '$PATH'<$Component<Link to="$ROUTE">referencesnavigate('$ROUTE')call siteswindow.locationassignments to the route