Commit Graph

79 Commits

Author SHA1 Message Date
hykocx a3aff9fa49 feat(modules): add external module system with auto-discovery and public pages support
- add `src/core/modules/` with registry, discovery (server), and public index
- add `src/core/public-pages/` with registry, server component, and public index
- add `src/core/users/permissions-registry.js` for runtime permission registration
- expose `./modules`, `./public-pages`, and `./public-pages/server` package exports
- rename `registerFeatureRoutes` to `registerApiRoutes` with backward-compatible alias
- extend `seedDefaultRolesAndPermissions` to include module-registered permissions
- update `initializeZen` and shared init to wire module discovery and registration
- add `docs/MODULES.md` documenting the `@zen/module-*` authoring contract
- update `docs/DEV.md` with references to module system docs
2026-04-25 10:50:13 -04:00
hykocx efc7c93c6b fix(auth): prevent admin from revoking their last users.manage role
- add self-lockout guard in handleRevokeUserRole api handler
- sequence role additions before removals and handle delete errors in UserEditModal
- document the security rule in core/users README
2026-04-25 10:12:31 -04:00
hykocx 0d6b06f217 feat(users): allow system roles to be renamed but not have permissions changed
- update `updateRole` to allow name changes for system roles while blocking permission updates
- remove edit button restriction for system roles in roles page
- disable name field only was replaced by disabling permissions checkboxes for system roles in edit modal
- update README to reflect new system role update policy
2026-04-25 10:02:51 -04:00
hykocx abd9d651dc feat(auth): add user invitation flow with account setup
- add `createAccountSetup`, `verifyAccountSetupToken`, `deleteAccountSetupToken` to verifications core
- add `completeAccountSetup` function to auth core for password creation on invite
- add `InvitationEmail` template for sending invite links
- add `SetupAccountPage` client page for invited users to set their password
- add `UserCreateModal` admin component to invite new users
- wire invitation action and API endpoint in auth feature
- update admin `UsersPage` to include user creation modal
- update auth and admin README docs
2026-04-25 09:03:15 -04:00
hykocx b39e316b4a fix(admin): improve breadcrumb segment matching for nested nav items
- replace fixed `[first, second]` destructuring with dynamic segment-aware matching
- find nav items using prefix segment comparison instead of first-segment-only match
- compute `itemSegCount` from matched nav item href to support multi-segment routes
- derive sub-segment index dynamically so breadcrumb labels resolve correctly for nested paths
2026-04-24 21:16:25 -04:00
hykocx 1032276d49 refactor(ui): replace chevron icons with arrow icon variants
- swap `ChevronDownIcon` and `ChevronRightIcon` for `ArrowDown01Icon` and `ArrowRight01Icon` in AdminSidebar and AdminTop
- add `ArrowDown01Icon`, `ArrowLeft01Icon`, `ArrowRight01Icon`, and `ArrowUp01Icon` to shared icons index
- remove `ChevronDownIcon` and `ChevronRightIcon` from shared icons index
2026-04-24 21:11:53 -04:00
hykocx 759184f0ed refactor(admin): replace inline svgs with icon components and fix icon colors
- replace inline hamburger/close svg with Menu01Icon component in AdminTop
- replace inline chevron svg with ChevronRightIcon component for breadcrumbs
- add ChevronRightIcon and Menu01Icon imports to AdminTop
- fix UserCircle02Icon fill values from hardcoded #ffffff to currentColor
2026-04-24 21:02:33 -04:00
hykocx 2d3d450e19 refactor(admin): replace inline svgs with icon components
- add `Logout02Icon` to admin top bar logout button
- add `SmartPhone01Icon` and `ComputerIcon` to profile page session list
- update icons index to use hugeicons react package imports
2026-04-24 20:52:51 -04:00
hykocx 77ca4fe66f fix(ui): improve mobile responsiveness across admin components
- reduce app name font size from text-lg to text-sm in AdminTop mobile header
- make profile page cards full-width on mobile with sm:min-w-3/5 breakpoint
- stack photo upload layout vertically on mobile using flex-col sm:flex-row
- add flex-wrap to photo action buttons for small screens
- make TabNav horizontally scrollable with hidden scrollbar on mobile
- add shrink-0 and whitespace-nowrap to tab buttons to prevent wrapping
2026-04-24 17:54:37 -04:00
hykocx 932e9b9373 style(admin): simplify mobile menu toggle button styling 2026-04-24 17:48:46 -04:00
hykocx f60137011d style(admin): simplify password reset button markup and remove border separator 2026-04-24 16:50:39 -04:00
hykocx 4549299d50 style(admin): update dark mode border color to neutral-800 in UserEditModal 2026-04-24 16:48:18 -04:00
hykocx 3f5bbfda0b style(admin): clean up password section layout in user edit modal 2026-04-24 16:47:56 -04:00
hykocx ec0edf89b9 fix(admin): require current password for self password change and fix field ordering
- initialize `newPassword` in form state on load
- add `needsCurrentPassword` flag triggered by email or password change when editing self
- route self password change to profile endpoint with current password verification
- move role tag input above password section and update current password field visibility logic
2026-04-24 15:52:34 -04:00
hykocx c844bc5e86 feat(admin): add password management to user edit modal and profile page
- add new password field in UserEditModal with optional admin-set password on save
- add send password reset link button with loading state in UserEditModal
- add password change section with strength indicator in ProfilePage
- expose sendPasswordResetEmail utility in auth api
2026-04-24 15:45:56 -04:00
hykocx 25f93526a5 feat(admin): add RoleBadge component and integrate it in user management views
- add new RoleBadge shared component for consistent role display
- export RoleBadge from shared components index
- replace inline Badge usage with RoleBadge in UsersPage role column
- use RoleBadge via renderTag prop in UserEditModal role TagInput
- simplify TagInput Pill to a generic unstyled pill, removing color logic
2026-04-24 15:31:28 -04:00
hykocx 48755c03f3 refactor(admin): remove email_verified field from user edit modal 2026-04-24 15:17:00 -04:00
hykocx 66c862cf73 feat(admin): add email change flow with confirmation for users
- add `ConfirmEmailChangePage.client.js` for email change token confirmation
- add `emailChange.js` core utility to generate and verify email change tokens
- add `EmailChangeConfirmEmail.js` and `EmailChangeNotifyEmail.js` email templates
- update `UserEditModal` to handle email changes with password verification for self-edits
- update `ProfilePage` to support email change initiation
- update `UsersPage` to pass `currentUserId` to `UserEditModal`
- add email change API endpoints in `auth/api.js` and `auth/email.js`
- register `ConfirmEmailChangePage` in `AdminPage.client.js`
2026-04-24 15:04:36 -04:00
hykocx 3e7e0387a1 refactor(admin): generalize breadcrumb fallback to handle unknown single-segment routes 2026-04-22 20:16:07 -04:00
hykocx ccdd309414 feat(admin): add bottom navigation items and settings page to admin panel 2026-04-22 20:12:18 -04:00
hykocx fef71aaf92 refactor(admin): remove quick links section and replace anchor tags with Next.js Link components 2026-04-22 19:58:43 -04:00
hykocx e99970b9b2 style(admin): update logout button text and hover colors for better contrast 2026-04-22 19:54:48 -04:00
hykocx 18f1fcdbd0 style(ui): change default button size from sm to md and remove explicit size="sm" props 2026-04-22 19:45:56 -04:00
hykocx 52f8ea2b13 style(ui): update dark mode background color from #090909 to #0B0B0B across auth and admin components 2026-04-22 19:33:40 -04:00
hykocx 869afbcb85 style(ui): update dark mode background colors to use #090909 instead of neutral variants 2026-04-22 19:32:14 -04:00
hykocx 312c8e0239 fix(admin): remove active section override on collapsed state 2026-04-22 19:30:05 -04:00
hykocx 456b1746bd feat(admin): extract AdminLayout as a separate server component 2026-04-22 19:22:14 -04:00
hykocx cc4527d488 feat(admin): persist sidebar collapsed sections state in sessionStorage 2026-04-22 19:13:00 -04:00
hykocx 35cfa8b51a fix(admin): collapse inactive sidebar sections by default and fix toggle logic 2026-04-22 19:10:17 -04:00
hykocx 6cff764e2f fix(admin): keep active section expanded in sidebar without useEffect 2026-04-22 19:07:18 -04:00
hykocx f45d295961 refactor(admin): derive pageTitle from state instead of inline in breadcrumb function 2026-04-22 19:03:43 -04:00
hykocx 4e56882dd4 refactor(admin): replace AdminPageTitleContext with direct registry lookup for breadcrumbs 2026-04-22 19:00:32 -04:00
hykocx 0317a83ec6 refactor(admin): simplify sidebar toggle by removing router navigation and active section guard 2026-04-22 18:54:49 -04:00
hykocx 843f992b1f feat(admin): replace prop-based page title with context provider 2026-04-22 17:58:04 -04:00
hykocx 7c92f34245 feat(admin): pass current page title from server to AdminTop via props 2026-04-22 17:52:48 -04:00
hykocx fa40565686 refactor(admin): migrate page titles from static map to self-registering pages 2026-04-22 17:46:53 -04:00
hykocx 94aaeb241b refactor(admin): extract page titles into a shared constants file 2026-04-22 17:43:23 -04:00
hykocx 5feceb09f2 refactor(admin): use registry titles for breadcrumb labels 2026-04-22 17:39:24 -04:00
hykocx 5fec68c1fc fix(admin): add profile breadcrumb and fix badge dark mode styling 2026-04-22 17:36:29 -04:00
hykocx 84f03a2d79 fix(admin): always render breadcrumb container to keep user menu pinned right 2026-04-22 17:23:59 -04:00
hykocx 3bd2e4bfba feat(admin): replace app name with dashboard icon in breadcrumb root 2026-04-22 17:22:33 -04:00
hykocx 866da94f06 feat(ui): add ColorPicker component and replace native color input in RoleEditModal 2026-04-22 16:30:41 -04:00
hykocx 71fe05bd2b feat(users): add description field to permission definitions 2026-04-22 16:20:43 -04:00
hykocx f54b2640ad refactor(admin): replace parameterized routes with modal-based editing for users and roles 2026-04-22 16:15:43 -04:00
hykocx 5ab789667c fix(admin): update sidebar and breadcrumb links to point to /admin/dashboard 2026-04-22 15:57:09 -04:00
hykocx 0c860d9fe5 feat(admin): replace single page name with dynamic breadcrumb navigation in AdminTop 2026-04-22 15:51:01 -04:00
hykocx 118f399208 refactor(admin): move back button and action to a flex container on the right side of AdminHeader 2026-04-22 15:38:39 -04:00
hykocx fe4ca228cc refactor(admin): simplify AdminHeader component by removing inline logic 2026-04-22 15:36:48 -04:00
hykocx 18270540cc refactor(admin): replace inline avatar logic with shared UserAvatar component 2026-04-22 15:14:07 -04:00
hykocx 0106bc4ea0 feat(core)!: introduce runtime extension registry and flat module conventions
BREAKING CHANGE: sup config now derives entries from package.json#exports and a server/client glob instead of manual lists; module structure follows flat + barrel convention with .server.js/.client.js runtime suffixes
2026-04-22 14:13:30 -04:00