Skip to content

Conversation

@alexsapps
Copy link
Collaborator

@alexsapps alexsapps commented Nov 29, 2025

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.

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.
@alexsapps alexsapps requested a review from jakehobbs as a code owner November 29, 2025 05:23
@alexsapps
Copy link
Collaborator Author

not done yet. things i still want to add before merging:

  • add validation (some fields should never be blank, validate roles are known/valid strings)
  • new uses of sendErrorMessage should get non-200 HTTP error code
  • should not have GetUsers(id=x) and GetUser both. will remove id option from GetUsers.

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.
@alexsapps
Copy link
Collaborator Author

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."

@jakehobbs jakehobbs requested a review from Copilot November 30, 2025 00:50
Copy link

Copilot AI left a 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')],
Copy link

Copilot AI Nov 30, 2025

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.

Suggested change
plugins: [twAnimate, require('tailwindcss-animate')],
plugins: [twAnimate],

Copilot uses AI. Check for mistakes.
jakehobbs
jakehobbs previously approved these changes Nov 30, 2025
Copy link
Member

@jakehobbs jakehobbs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks goooood

@alexsapps alexsapps merged commit 3ee6773 into main Dec 7, 2025
1 check passed
@alexsapps alexsapps deleted the alex/users-page branch December 7, 2025 19:51
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.

3 participants