Skip to content

Refactor auth pages and extract reusable UI components#202

Merged
Swopper050 merged 2 commits into
developfrom
claude/refactor-ui-components-QoWIA
May 11, 2026
Merged

Refactor auth pages and extract reusable UI components#202
Swopper050 merged 2 commits into
developfrom
claude/refactor-ui-components-QoWIA

Conversation

@Swopper050
Copy link
Copy Markdown
Owner

Summary

This PR refactors the authentication pages (Login and Register) to use a shared layout component and extracts common UI patterns into reusable components. The changes improve code maintainability, reduce duplication, and establish a consistent design system for auth-related UI.

Key Changes

New Reusable Components

  • MarketingAuthLayout: Two-column layout component used by Login and Register pages, handling topbar, logo, headline, subtitle, and form panel sections
  • AuthFormField: Standardized input field component with icon, label, and inline error display
  • ConfirmModal: Generic confirmation modal for destructive actions (delete account, leave workspace, etc.)
  • Spinner & FullScreenSpinner: Extracted spinner components with configurable size, variant, and color
  • StatusBanner: Compact status pill for billing/checkout feedback messages
  • PlanBadge: Small "Pro" badge shown next to paid workspaces
  • BillingStatCard: Card component for billing stats grid
  • WorkspaceAvatar: Colored square avatar showing workspace initial
  • auth-icons.tsx: Centralized icon components (EnvelopeIcon, LockIcon, UserIcon, ShieldIcon, ArrowRightIcon, AppLogo)

Refactored Pages

  • Login & Register pages: Replaced inline HTML with MarketingAuthLayout and AuthFormField components, reducing boilerplate by ~150 lines per page
  • BillingTabContent: Replaced inline status banner HTML with StatusBanner component
  • WorkspaceSettingsModal: Replaced inline plan badge with PlanBadge component
  • UsersAdmin & DeleteAccount: Replaced inline modals with ConfirmModal component

Validator Updates

  • Extracted password validation rules into passwordRules function in validators.ts
  • Removed unused imports of minLength and pattern from auth pages (now centralized in validators)

UI Improvements

  • Consistent spinner usage across loading states
  • Standardized form field styling with icon support
  • Unified confirmation modal pattern for destructive actions
  • Improved icon reusability through centralized icon components

Implementation Details

  • All new components follow the existing Solid.js patterns with proper TypeScript typing
  • Components are composable and accept standard props for customization (size, color, class, etc.)
  • Maintained backward compatibility with existing styles and functionality
  • Reduced code duplication while preserving all original features

https://claude.ai/code/session_01WfzRS6PXwxNbyEZS3A1PF9

claude added 2 commits April 27, 2026 11:55
Add reusable building blocks and refactor existing pages/components
to consume them, cutting net ~370 lines of duplicated JSX/validation:

- Spinner / FullScreenSpinner / CenteredSpinner replace ad-hoc loading
  markup across Login, Register, AcceptInvitation, VerifyEmail,
  Pagination and UsersAdmin.
- ConfirmModal consolidates the delete/cancel/leave/remove confirmation
  dialogs in DeleteAccount, UsersAdmin (delete user), BillingTabContent
  (cancel subscription) and WorkspaceSettingsModal (leave workspace,
  remove member).
- MarketingAuthLayout + AuthFormField + auth-icons (EnvelopeIcon,
  LockIcon, UserIcon, ShieldIcon, ArrowRightIcon, AppLogo) replace the
  ~80-line shell and 7 near-identical icon/input wrappers shared by
  Login.tsx and Register.tsx.
- WorkspaceAvatar replaces four open-coded coloured-initial avatars in
  WorkspaceSwitcher and WorkspaceSettingsModal.
- passwordRules(t) helper in validators.ts replaces the 5-rule password
  validation duplicated across Register, ResetPassword, ChangePassword,
  RegisterModal and the create-user form.
Follow-up to the UI DRY pass: pull the repeated billing/checkout UI
primitives into shared components.

- StatusBanner replaces the 7 hand-rolled tinted feedback pills in
  BillingTabContent and BillingCheckoutPage (success / cancelled /
  method_updated / pending / checkout error).
- PlanBadge replaces the 3 open-coded "Pro" pills in BillingTabContent
  and WorkspaceSettingsModal (supports success/primary colour and a
  small size variant).
- BillingStatCard replaces the 9 copies of the stat cell used inside
  the billing plan cards.
@Swopper050 Swopper050 merged commit 039e441 into develop May 11, 2026
9 checks passed
@Swopper050 Swopper050 deleted the claude/refactor-ui-components-QoWIA branch May 11, 2026 09:24
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.

2 participants