-
Notifications
You must be signed in to change notification settings - Fork 7
Rewrite users page #291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite users page #291
Conversation
Shadcn recently added support for Tanstack forms. Before adding our first usage of this feature, this change more or less removes our shadcn usage and re-adds it from scratch in order to get updates not just to dependencies like radix-ui components, but also updates to the components themselves. Updating components themselves usually isn't necessary, but sometimes it is (such as was needed recently to upgrade to Tailwind 4). Not many customizations needed to be reapplied so it was easy to change now, just in case.
This breaks the circular package dependency between persistence and model packages and allows the persistence package to import models while still allowing the models package to indirectly depend on the persistence package.
<chapter-switcher>, a client component in the navbar, was outside the hydration boundary, which seemed to break SSR for other client components. Moving the hydration boundary up to include the navbar seems to fix it.
|
not done yet. things i still want to add before merging:
|
Number of rows affected may be 0 if no direct fields on the users table are changed. This does not mean the user doesn't exist. There may still be changes to roles so the transaction should not be aborted.
|
ok, done making changes now. also skipping this pre-existing issue for now: "should not have GetUsers(id=x) and GetUser both. will remove id option from GetUsers." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR rewrites the users management page in React using Next.js and modernizes the codebase architecture by:
- Moving user management logic from the old Vue.js implementation to a new React-based users page
- Refactoring user-related data access into dedicated repository patterns
- Updating the authentication flow to use the new repository interface
- Configuring Shadcn UI components with CSS variables for a consistent design system
Reviewed changes
Copilot reviewed 41 out of 44 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| shared/nav.json | Updates navigation href to point to new users page at /v2/users |
| server/templates/user_list.html | Removes old Vue.js template file for user list page |
| server/src/transport/users.go | Adds new HTTP handlers for user CRUD operations with JSON transport layer |
| server/src/transport/common.go | Adds shared JSON writing and error handling utilities for transport layer |
| server/src/persistence/users.go | Implements database repository for user operations (CRUD, role management) |
| server/src/model/adb_auth.go | Refactors user model to use string slice for roles instead of UserRole struct array and adds repository interface |
| server/src/model/activist.go | Updates CleanActivistData to accept UserRepository parameter |
| server/src/main.go | Refactors authentication flow to use new UserRepository interface throughout controllers |
| server/scripts/create_db_wrapper/create_db.go | Updates dev database seed to use new schema without admin field |
| server/debug.env | Adds CSRF_AUTH_KEY for local development |
| package.json | Updates prettier version constraint |
| frontend/adb.ts | Removes UserList Vue component registration |
| frontend/UserList.vue | Deletes entire old Vue.js user list component |
| frontend-v2/tailwind.config.ts | Updates to use Shadcn color variables with hsl() function |
| frontend-v2/src/styles/globals.css | Replaces custom CSS variables with Shadcn-generated theme tokens |
| frontend-v2/src/styles/README.md | Documents Shadcn customizations for future reference |
| frontend-v2/src/lib/api.ts | Adds user management API methods and CSRF token handling |
| frontend-v2/src/components/ui/* | Updates Shadcn components to use CSS variable tokens |
| frontend-v2/src/app/users/* | Implements new React-based users pages (list, create, edit) |
| frontend-v2/src/app/layout.tsx | Adds CSRF token fetching in root layout |
| frontend-v2/README.md | Documents CSRF implementation approach |
| README.md | Documents prettier configuration at repository root |
Files not reviewed (2)
- frontend-v2/pnpm-lock.yaml: Language not supported
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| }, | ||
| }, | ||
| plugins: [twAnimate], | ||
| plugins: [twAnimate, require('tailwindcss-animate')], |
Copilot
AI
Nov 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The plugin tailwindcss-animate is included twice: once as the imported twAnimate and again via require('tailwindcss-animate'). Remove the duplicate require call.
| plugins: [twAnimate, require('tailwindcss-animate')], | |
| plugins: [twAnimate], |
jakehobbs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks goooood
Rewrite the users page in React and related refactors / cleanup tasks. Remove the old users page because it was too messy to have so many users endpoints at once, and the old endpoints could not be reused effectively.