Skip to content

modify design#5

Merged
seriwb merged 7 commits into
mainfrom
feature/modify-design
Mar 3, 2026
Merged

modify design#5
seriwb merged 7 commits into
mainfrom
feature/modify-design

Conversation

@seriwb
Copy link
Copy Markdown
Owner

@seriwb seriwb commented Mar 2, 2026

No description provided.

@seriwb seriwb self-assigned this Mar 2, 2026
Copy link
Copy Markdown

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 updates the Admin app’s UI/design by migrating several components/layouts to shadcn/ui + Radix primitives, cleaning up legacy SCSS-based components, and aligning auth/session defaults with centralized account privilege/status constants.

Changes:

  • Replace legacy Admin layout pieces (sidebar/header/footer/breadcrumb/sign-in) with shadcn/ui-based implementations.
  • Centralize account status/privilege defaults via new constants and wire them into Better Auth session shaping.
  • Update dependencies (Radix Collapsible, lucide-react, @types/*), remove simplebar-react, and adjust CI/env templates for Better Auth.

Reviewed changes

Copilot reviewed 61 out of 64 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
yarn.lock Dependency lock updates (types bumps, add Radix Collapsible, remove simplebar).
packages/db/package.json Bump @types/node / @types/pg devDependencies.
apps/admin/src/types/app.ts Add shared LoginUser type.
apps/admin/src/styles/globals.scss Remove legacy global SCSS reset/styles.
apps/admin/src/server/domains/account.ts Comment out getAccountList implementation.
apps/admin/src/proxy.ts Remove inline security warning comments.
apps/admin/src/lib/auth.ts Use centralized account status/privilege constants for defaults/session shaping.
apps/admin/src/constants/application.ts Add DEFAULT_VIEW, normalize ACCOUNT_PRIVILEGE keys, add ACCOUNT_STATUS.
apps/admin/src/components/ui/sidebar.tsx Modify sidebar layout class strings and sizing behavior.
apps/admin/src/components/ui/field.tsx Add new shadcn-style Field components.
apps/admin/src/components/ui/collapsible.tsx Add Radix Collapsible wrapper.
apps/admin/src/components/ui/button.tsx Update shadcn Button implementation (variants + forwardRef).
apps/admin/src/components/divider/index.ts Remove legacy Divider barrel export.
apps/admin/src/components/divider/divider.tsx Remove legacy Divider component.
apps/admin/src/components/divider/divider.module.scss Remove legacy Divider styles.
apps/admin/src/components/buttons/button/index.ts Remove legacy nested button barrel export.
apps/admin/src/components/buttons/button/button.tsx Remove legacy SCSS-based Button implementation.
apps/admin/src/components/buttons/button/button.module.scss Remove legacy Button styles.
apps/admin/src/components/buttons/button.tsx Add new wrapper Button using shadcn BaseButton + spinner.
apps/admin/src/components/breadcrumb/breadcrumb.tsx Migrate Breadcrumb rendering to shadcn/ui breadcrumb components.
apps/admin/src/components/breadcrumb/breadcrumb.module.scss Remove legacy breadcrumb SCSS.
apps/admin/src/components/breadcrumb/_routes.ts Remove legacy breadcrumb route table.
apps/admin/src/components/badge/index.ts Remove legacy Badge barrel export.
apps/admin/src/components/badge/badge.tsx Remove legacy Badge component.
apps/admin/src/components/badge/badge.module.scss Remove legacy Badge styles.
apps/admin/src/app/signout/page.tsx Change sign-out redirect to window.location.href.
apps/admin/src/app/page.tsx Use centralized constants; update auth layout + SignIn component import paths.
apps/admin/src/app/layout.tsx Remove SimpleBar CSS import.
apps/admin/src/app/api/accounts/create-first-account/route.ts Create first account with superAdmin privilege constant.
apps/admin/src/app/(auth)/signin/page.tsx Make Sign-in page server component with metadata + Suspense boundary.
apps/admin/src/app/(auth)/signin/_lib/schemas.ts Add zod schema/type for sign-in form input.
apps/admin/src/app/(auth)/signin/_lib/constants.ts Add Better Auth error-message mapping.
apps/admin/src/app/(auth)/signin/_components/types.ts Remove local LoginUser type (moved to shared types).
apps/admin/src/app/(auth)/signin/_components/signin/signin.tsx Remove legacy SCSS-based SignIn implementation.
apps/admin/src/app/(auth)/signin/_components/signin/signin.module.scss Remove legacy SignIn styles.
apps/admin/src/app/(auth)/signin/_components/signin/index.ts Remove legacy SignIn barrel export.
apps/admin/src/app/(auth)/signin/_components/signin.tsx Add new Card/Form-based SignIn component with toast handling.
apps/admin/src/app/(auth)/layout.tsx Update AuthLayout import path.
apps/admin/src/app/(auth)/_layout/index.ts Remove AuthLayout barrel export.
apps/admin/src/app/(auth)/_layout/auth-layout.tsx Replace SCSS layout with Tailwind-based layout.
apps/admin/src/app/(auth)/_layout/auth-layout.module.scss Remove legacy AuthLayout styles.
apps/admin/src/app/(app)/system/accounts/_components/account-list/condition/condition.tsx Comment out “New” button in condition UI.
apps/admin/src/app/(app)/layout.tsx Convert app layout to async session-aware layout + navigation filtering.
apps/admin/src/app/(app)/_layout/sidebar/sidebar.tsx Remove legacy SimpleBar/SCSS sidebar implementation.
apps/admin/src/app/(app)/_layout/sidebar/sidebar.module.scss Remove legacy sidebar styles.
apps/admin/src/app/(app)/_layout/sidebar/index.ts Remove legacy sidebar barrel export.
apps/admin/src/app/(app)/_layout/sidebar/_nav.tsx Remove legacy sidebar nav config.
apps/admin/src/app/(app)/_layout/sidebar.tsx Add new shadcn/ui-based AppSidebar implementation.
apps/admin/src/app/(app)/_layout/protected-view.tsx Use centralized account status constants.
apps/admin/src/app/(app)/_layout/index.tsx Add new shadcn/ui-based AppLayout wrapper.
apps/admin/src/app/(app)/_layout/index.ts Remove legacy AppLayout barrel export.
apps/admin/src/app/(app)/_layout/header/index.ts Remove legacy header barrel export.
apps/admin/src/app/(app)/_layout/header/header.tsx Remove legacy header implementation.
apps/admin/src/app/(app)/_layout/header/header.module.scss Remove legacy header styles.
apps/admin/src/app/(app)/_layout/footer/index.ts Remove legacy footer barrel export.
apps/admin/src/app/(app)/_layout/footer/footer.tsx Remove legacy footer component.
apps/admin/src/app/(app)/_layout/footer/footer.module.scss Remove legacy footer styles.
apps/admin/src/app/(app)/_layout/app-layout.tsx Remove legacy app layout implementation.
apps/admin/src/app/(app)/_layout/app-layout.module.scss Remove legacy app layout styles.
apps/admin/package.json Add Radix Collapsible, bump lucide-react, remove simplebar-react, bump @types/node.
apps/admin/.prettierignore Ignore shadcn/ui sources and backups.
apps/admin/.env.template Add INTERNAL_API_URL variable.
.github/workflows/ci.yml Add BETTER_AUTH_SECRET env var for admin build step.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 681 to 683
<Skeleton
className="h-4 max-w-[--skeleton-width] flex-1"
className="h-4 max-w-(--skeleton-width) flex-1"
data-sidebar="menu-skeleton-text"
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

max-w-(--skeleton-width) is not valid Tailwind arbitrary value syntax and will be ignored. Use max-w-[--skeleton-width] (or max-w-[var(--skeleton-width)]) so the skeleton width respects the CSS var set in style.

Copilot uses AI. Check for mistakes.
Comment on lines +5 to +9
const Collapsible = CollapsiblePrimitive.Root

const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger

const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

@radix-ui/react-collapsible exports Root, Trigger, and Content (and the codebase’s other Radix wrappers use .Trigger/.Content). CollapsiblePrimitive.CollapsibleTrigger / .CollapsibleContent are not valid exports and will cause a runtime/TS error. Use CollapsiblePrimitive.Trigger and CollapsiblePrimitive.Content.

Copilot uses AI. Check for mistakes.
Comment on lines +2 to +3
import { ACCOUNT_STATUS } from "@/constants/application";
import { NAVIGATION, filterNavigationByPrivilege } from "@/constants/navigation";
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

@/constants/navigation doesn’t exist in the current repo (only src/constants/application.ts is present), so this import will fail and the app won’t build. Add the missing module (with NAVIGATION and filterNavigationByPrivilege) or update the import to the correct existing path.

Suggested change
import { ACCOUNT_STATUS } from "@/constants/application";
import { NAVIGATION, filterNavigationByPrivilege } from "@/constants/navigation";
import { ACCOUNT_STATUS, NAVIGATION, filterNavigationByPrivilege } from "@/constants/application";

Copilot uses AI. Check for mistakes.
Comment on lines +7 to +12
export default async function AppLayout({ children }: { children: React.ReactNode }) {
const session = await getAppSession();

if (session?.user.status !== ACCOUNT_STATUS.active) {
return null;
}
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

When getAppSession() returns null (unauthenticated), this layout returns null, which prevents the client-side ProtectedView from rendering and results in a blank page instead of redirecting. Consider using Next.js redirect() to the sign-in route (e.g. with a code=E401) or rendering a fallback that triggers navigation.

Copilot uses AI. Check for mistakes.
Comment on lines +12 to 15
BreadcrumbSeparator,
} from "@/components/ui/breadcrumb";
import { BREADCRUMB_ROUTES } from "@/constants/navigation";

Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

@/constants/navigation is imported here but the module isn’t present in the repo, so this component won’t compile. Either add src/constants/navigation (exporting BREADCRUMB_ROUTES) or revert to the previous local routes source.

Copilot uses AI. Check for mistakes.
Comment thread apps/admin/src/components/ui/sidebar.tsx
Comment thread apps/admin/src/components/ui/sidebar.tsx
Comment thread apps/admin/src/server/domains/account.ts
Comment thread apps/admin/src/components/ui/sidebar.tsx
@seriwb seriwb merged commit a4240eb into main Mar 3, 2026
2 checks passed
@seriwb seriwb deleted the feature/modify-design branch March 3, 2026 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants