203 Commits

Author SHA1 Message Date
Felipe Cardoso
8fdbc2b359 Improve code consistency and documentation readability
- Standardized Markdown formatting across documentation files.
- Fixed inconsistent usage of inline code blocks and improved syntax clarity.
- Updated tests and JSX for cleaner formatting and better readability.
- Adjusted E2E test navigation handlers for multiline code consistency.
- Simplified TypeScript configuration and organized JSON structure for better maintainability.
2025-11-20 12:58:46 +01:00
Felipe Cardoso
28b1cc6e48 Replace "FastNext" branding with "PragmaStack" across the project
- Updated all references, metadata, and templates to reflect the new branding, including layout files, components, and documentation.
- Replaced hardcoded color tokens like `green-600` with semantic tokens (`success`, `warning`, etc.) for improved design consistency.
- Enhanced `globals.css` with new color tokens for success, warning, and destructive states using the OKLCH color model.
- Added comprehensive branding guidelines and updated the design system documentation to align with the new identity.
- Updated tests and mocks to reflect the branding changes and ensured all visual/verbal references match "PragmaStack".
- Added new `branding/README.md` and `branding` docs for mission, values, and visual identity definition.
2025-11-20 12:55:30 +01:00
Felipe Cardoso
5a21847382 Update to Next.js 16 and enhance ESLint configuration
- Migrated from Next.js 15 to Next.js 16, updating all related dependencies and configurations.
- Enhanced ESLint setup with stricter rules, expanded plugin support, and improved type-aware linting options.
- Archived middleware by renaming it to `middleware.disabled.ts` for potential future use.
2025-11-20 12:49:45 +01:00
Felipe Cardoso
444d495f83 Refactor metadata handling for improved maintainability and localization support
- Extracted server-only metadata generation logic into separate files, reducing inline logic in page components.
- Added `/* istanbul ignore file */` annotations for E2E-covered framework-level metadata.
- Standardized `generateMetadata` export patterns across auth, admin, and error pages for consistency.
- Enhanced maintainability and readability by centralizing metadata definitions for each route.
2025-11-20 10:07:15 +01:00
Felipe Cardoso
a943f79ce7 Refactor i18n routing tests with jest mocks and enhance coverage
- Replaced i18n routing tests with new mocked implementations for `next-intl/routing` and `next-intl/navigation`.
- Improved test coverage by introducing component-based tests for navigation hooks and link behavior.
- Updated assertions for clarity and consistency in locale configuration and navigation logic.
2025-11-20 09:45:29 +01:00
Felipe Cardoso
f54905abd0 Update README and documentation with i18n, feature enhancements, and SEO improvements
- Added comprehensive details for internationalization (i18n) support via `next-intl`, including locale-based routing and type-safe translations.
- Highlighted new UX features: animated marketing landing page, toasts, charts, markdown rendering, and session tracking.
- Enhanced SEO capabilities with dynamic sitemaps, robots.txt, and locale-aware metadata.
- Updated `/dev` portal information with live component playground details.
- Documented newly integrated libraries, utilities, and testing updates for better developer insight.
2025-11-20 09:45:03 +01:00
Felipe Cardoso
0105e765b3 Add tests for auth storage logic and i18n routing configuration
- Added comprehensive unit tests for `auth/storage` to handle SSR, E2E paths, storage method selection, and error handling.
- Introduced tests for `i18n/routing` to validate locale configuration, navigation hooks, and link preservation.
- Updated Jest coverage exclusions to include `
2025-11-20 09:24:15 +01:00
Felipe Cardoso
bb06b450fd Delete outdated E2E documentation and performance optimization guides.
- Removed `E2E_COVERAGE_GUIDE.md` and `E2E_PERFORMANCE_OPTIMIZATION.md` from `frontend/docs` due to redundancy and irrelevance to recent workflows.
- Cleared unused scripts (`convert-v8-to-istanbul.ts` and `merge-coverage.ts`) from `frontend/scripts`.
2025-11-19 14:56:24 +01:00
Felipe Cardoso
d7b333385d Add test cases for session revocation and update test coverage annotations
- Introduced unit tests for individual and bulk session revocation in `SessionsManager` with success callback assertions.
- Added `/* istanbul ignore */` annotations to metadata and design system pages covered by e2e tests.
2025-11-19 14:38:46 +01:00
Felipe Cardoso
f02320e57c Add tests for LocaleSwitcher component and update metadata generation
- Introduced unit tests for `LocaleSwitcher` to cover rendering, UX, accessibility, and locale switching logic.
- Updated `generateMetadata` function with `/* istanbul ignore next */` annotation for coverage clarity.
2025-11-19 14:27:03 +01:00
Felipe Cardoso
3ec589293c Add tests for i18n metadata utilities and improve locale-based metadata generation
- Introduced comprehensive unit tests for `generateLocalizedMetadata` and `generatePageMetadata` utilities.
- Enhanced `siteConfig` validation assertions for structure and localization support.
- Updated metadata generation to handle empty paths, canonical URLs, language alternates, and Open Graph data consistently.
- Annotated server-side middleware with istanbul ignore for coverage clarity.
2025-11-19 14:23:06 +01:00
Felipe Cardoso
7b1bea2966 Refactor i18n integration and update tests for improved localization
- Updated test components (`PasswordResetConfirmForm`, `PasswordChangeForm`) to use i18n keys directly, ensuring accurate validation messages.
- Refined translations in `it.json` to standardize format and content.
- Replaced text-based labels with localized strings in `PasswordResetRequestForm` and `RegisterForm`.
- Introduced `generateLocalizedMetadata` utility and updated layout metadata generation for locale-aware SEO.
- Enhanced e2e tests with locale-prefixed routes and updated assertions for consistency.
- Added comprehensive i18n documentation (`I18N.md`) for usage, architecture, and testing.
2025-11-19 14:07:13 +01:00
Felipe Cardoso
da7b6b5bfa Implement extensive localization improvements across forms and components
- Refactored `it.json` translations with added keys for authentication, admin panel, and settings.
- Updated authentication forms (`LoginForm`, `RegisterForm`, `PasswordResetConfirmForm`) to use localized strings via `next-intl`.
- Enhanced password validation schemas with dynamic translations and refined error messages.
- Adjusted `Header` and related components to include localized navigation and status elements.
- Improved placeholder hints, button labels, and inline validation messages for seamless localization.
2025-11-19 03:02:59 +01:00
Felipe Cardoso
7aa63d79df Implement extensive localization improvements across forms and components
- Refactored `it.json` translations with added keys for authentication, admin panel, and settings.
- Updated authentication forms (`LoginForm`, `RegisterForm`, `PasswordResetConfirmForm`) to use localized strings via `next-intl`.
- Enhanced password validation schemas with dynamic translations and refined error messages.
- Adjusted `Header` and related components to include localized navigation and status elements.
- Improved placeholder hints, button labels, and inline validation messages for seamless localization.
2025-11-19 03:02:13 +01:00
Felipe Cardoso
333c9c40af Add locale switcher component and integrate internationalization improvements
- Introduced `LocaleSwitcher` component for language selection with support for locale-aware dropdown and ARIA accessibility.
- Updated layouts (`Header`, `Breadcrumbs`, `Home`) to include the new locale switcher.
- Expanded localization files (`en.json`, `it.json`) with new keys for language switching.
- Adjusted i18n configuration to enhance routing and message imports.
- Updated Jest module mappings to mock new i18n components and utilities.
2025-11-19 01:31:51 +01:00
Felipe Cardoso
0b192ce030 Update e2e tests and mocks for locale-based routing
- Adjusted assertions and navigation tests to include `/en` locale prefix for consistency.
- Updated next-intl and components-i18n mocks to support locale handling in tests.
- Renamed "Components" link and related references to "Design System" in homepage tests.
- Disabled typing delay in debounce test for improved test reliability.
2025-11-19 01:31:35 +01:00
Felipe Cardoso
da021d0640 Update tests and e2e files to support locale-based routing
- Replaced static paths with dynamic locale subpaths (`/[locale]/*`) in imports, URLs, and assertions across tests.
- Updated `next-intl` mocks for improved compatibility with `locale`-aware components.
- Standardized `page.goto` and navigation tests with `/en` as the base locale for consistency.
2025-11-18 23:26:10 +01:00
Felipe Cardoso
d1b47006f4 Remove all obsolete authentication, settings, admin, and demo-related components and pages
- Eliminated redundant components, pages, and layouts related to authentication (`login`, `register`, `password-reset`, etc.), user settings, admin, and demos.
- Simplified the frontend structure by removing unused dynamic imports, forms, and test code.
- Refactored configurations and metadata imports to exclude references to removed features.
- Streamlined the project for future development and improved maintainability by discarding legacy and unused code.
2025-11-18 12:41:57 +01:00
Felipe Cardoso
a73d3c7d3e Refactor multiline formatting, link definitions, and code consistency across components and tests
- Improved readability by updating multiline statements and object definitions.
- Applied consistent link and button wrapping in `DemoSection` and other components.
- Enhanced test assertions and helper functions with uniform formatting and parentheses usage.
2025-11-18 07:25:23 +01:00
Felipe Cardoso
55ae92c460 Refactor i18n setup and improve structure for maintainability
- Relocated `i18n` configuration files to `src/lib/i18n` for better organization.
- Removed obsolete `request.ts` and `routing.ts` files, simplifying `i18n` setup within the project.
- Added extensive tests for `i18n/utils` to validate locale-related utilities, including locale name, native name, and flag retrieval.
- Introduced a detailed `I18N_IMPLEMENTATION_PLAN.md` to document implementation phases, decisions, and recommendations for future extensions.
- Enhanced TypeScript definitions and modularity across i18n utilities for improved developer experience.
2025-11-18 07:23:54 +01:00
Felipe Cardoso
fe6a98c379 Add internationalization (i18n) with next-intl and Italian translations
- Integrated `next-intl` for server-side and client-side i18n support.
- Added English (`en.json`) and Italian (`it.json`) localization files.
- Configured routing with locale-based subdirectories (`/[locale]/path`) using `next-intl`.
- Introduced type-safe i18n utilities and TypeScript definitions for translation keys.
- Updated middleware to handle locale detection and routing.
- Implemented dynamic translation loading to reduce bundle size.
- Enhanced developer experience with auto-complete and compile-time validation for i18n keys.
2025-11-17 20:27:09 +01:00
Felipe Cardoso
c9f4772196 Add and enhance tests for mobile navigation, demo modal, and forbidden page metadata
- Added new test cases for mobile navigation links and buttons in `Header` component.
- Enhanced `Home` tests to verify demo modal behavior (open/close functionality).
- Added metadata validation test for the forbidden page.
- Introduced comprehensive test suite for the DemoTour page, covering structure, navigation, categories, accessibility, and CTAs.
2025-11-16 19:38:46 +01:00
Felipe Cardoso
14e5839476 Update test suite to reflect "Design System" renaming and improved navigation structure
- Replaced "Components" references with "Design System" in both links and test assertions.
- Adjusted `DemoCredentialsModal` tests to include separate links for user/admin login and updated text expectations.
- Enhanced `Home` tests with new demo content validation (`User Dashboard`) and renamed navigation elements.
2025-11-12 17:48:22 +01:00
Felipe Cardoso
228d12b379 Redesign DemoSection with additional layout, content adjustments, and new demos
- Added User Dashboard demo with `UserCircle` icon and "NEW" badge.
- Introduced "View Complete Demo Tour" CTA linking to the Demo Tour page.
- Adjusted grid layout to support 4 columns for better spacing: `md:grid-cols-2 lg:grid-cols-4`.
- Enhanced Demo credentials modal with richer content outlining user and admin account capabilities.
- Adjusted navigation links: renamed "Components" to "Design System" and added Demo Tour link.
- Updated Demo Tour with leisurely paths, feature checklists, and new demo categories (user and admin flows).
2025-11-12 17:36:41 +01:00
Felipe Cardoso
d8bde80d4f Add validate script to package.json for combined linting, formatting, and type-checking 2025-11-10 11:07:06 +01:00
Felipe Cardoso
35efa24ce5 Add loginViaUI import in auth.setup.ts to support UI-based authentication setup 2025-11-10 11:05:25 +01:00
Felipe Cardoso
96df7edf88 Refactor useAuth hook, settings components, and docs for formatting and readability improvements
- Consolidated multi-line arguments into single lines where appropriate in `useAuth`.
- Improved spacing and readability in data processing across components (`ProfileSettingsForm`, `PasswordChangeForm`, `SessionCard`).
- Applied consistent table and markdown formatting in design system docs (e.g., `README.md`, `08-ai-guidelines.md`, `00-quick-start.md`).
- Updated code snippets to ensure adherence to Prettier rules and streamlined JSX structures.
2025-11-10 11:03:45 +01:00
Felipe Cardoso
464a6140c4 Integrate Prettier into project configuration
- Added `eslint-config-prettier` to disable conflicting ESLint rules.
- Configured Prettier with `.prettierrc` for consistent formatting.
- Updated `package.json` scripts to apply and check formatting on entire project.
- Added `.prettierignore` to exclude unnecessary files and directories from formatting.
- Updated dependencies in `package-lock.json` and removed unused packages.
2025-11-10 11:02:51 +01:00
Felipe Cardoso
b2f3ec8f25 Refactor ESLint configuration and update test rules for clarity and consistency
- Consolidated and modularized `eslint.config.mjs` with defined rules for source, test, E2E, and scripts.
- Improved test and E2E rules with relaxed settings for flexibility and enhanced mocking.
- Standardized variable naming and removed redundant imports in unit and E2E tests.
- Updated error handling and comments to align with modern TypeScript best practices (e.g., `@ts-expect-error`).
2025-11-10 10:57:43 +01:00
Felipe Cardoso
c8f90e9e8c Refactor ESLint configuration and update lint scripts
- Reorganized `eslint.config.mjs` imports for clarity and consistency.
- Simplified eslint ignores by standardizing patterns and removing redundant file extensions.
- Updated lint scripts in `package.json` to use `eslint` directly, replacing `next lint`.
2025-11-10 10:48:24 +01:00
Felipe Cardoso
2169618bc8 Refactor unit and E2E tests to rely on onOpenDemoModal prop for improved modal integration
- Updated `Header`, `HeroSection`, and `CTASection` tests to mock `onOpenDemoModal`, ensuring consistency in demo modal handling.
- Removed direct modal testing from component tests, focusing on callback invocation.
- Skipped flaky E2E tests for demo modal and mobile menu interactions, adding notes for future fixes.
- Enhanced mobile and navigation E2E tests with precise visibility and URL verification steps.
2025-11-10 10:36:51 +01:00
Felipe Cardoso
a84fd11cc7 Refactor mobile menu E2E tests for improved reliability and selector consistency
- Replaced `waitForSelector` with `waitFor({ state: 'visible' })` for more precise wait conditions.
- Centralized mobile menu locators to minimize duplication and enhance readability.
- Added explicit visibility checks for links and buttons to improve test accuracy.
- Adjusted terminal test animation wait logic for better performance and robustness.
2025-11-09 00:39:24 +01:00
Felipe Cardoso
6824fd7c33 Add scripts for E2E and unit test coverage integration
- Added `merge-coverage.ts` to combine Jest and Playwright coverage into a unified report with comprehensive statistics and thresholds.
- Included `convert-v8-to-istanbul.ts` for transforming Playwright V8 coverage into Istanbul format, enabling seamless merging.
- Introduced E2E coverage helpers for Playwright tests (`startCoverage`, `stopAndSaveCoverage`, `withCoverage`) to collect and process both V8 and Istanbul coverage.
- Configured `.nycrc.json` with coverage thresholds and reporting formats for improved visibility and enforcement.
2025-11-09 00:31:36 +01:00
Felipe Cardoso
d5eb855ae1 Remove redundant timeout parameters across E2E tests and add performance optimization documentation.
- Reduced E2E test execution time by removing unnecessary `{ timeout: 10000 }` overrides for assertions and element waits, relying on global `expect` configuration.
- Removed redundant `networkidle` wait states for faster form render validations.
- Documented comprehensive performance optimization strategies in `E2E_PERFORMANCE_OPTIMIZATION.md`.
- Added `E2E_COVERAGE_GUIDE.md` for integrating and merging E2E test coverage with unit test coverage.
2025-11-09 00:30:56 +01:00
Felipe Cardoso
a6a10855fa Refactor Playwright tests to use cached authentication state for improved performance
- Removed redundant `loginViaUI` calls across E2E tests, leveraging cached storage state for faster test execution.
- Enhanced Playwright configuration to include a `setup` project for pre-caching admin and regular user authentication states.
- Added new `auth.setup.ts` to handle initial authentication and save storage states to `.auth` directory.
- Increased local worker count to 16 (CI unchanged) to optimize parallel execution.
- Updated `.gitignore` to exclude authentication state files.
2025-11-08 20:46:59 +01:00
Felipe Cardoso
bf95aab7ec Optimize Playwright config and refactor E2E tests for reliability and performance
- Adjusted Playwright worker count (8 locally, 1 on CI) and fine-tuned timeout values for faster and efficient execution.
- Disabled unnecessary artifact capture (screenshots, videos) to reduce overhead during retries.
- Enhanced E2E test targeting with stricter element selectors to improve clarity and avoid ambiguities.
- Improved navigation tests by refining locators for header links (`Admin Demo`, `Login`) to prevent false positives.
- Added clipboard permission handling for demo credential copy tests, ensuring cross-browser compatibility.
- Skipped a known flaky test for password change form with a detailed TODO for further investigation.
2025-11-08 19:05:04 +01:00
Felipe Cardoso
214d0b1765 Add comprehensive E2E tests for homepage and refactor demo modal logic
- Implemented E2E tests for homepage sections: `HeroSection`, `Header`, `CTASection`, `AnimatedTerminal`, `FeatureSections`, and `Footer`, ensuring proper functionality, navigation, and accessibility.
- Introduced tests for mobile menu interactions, demo credentials modal, and terminal animations.
- Refactored demo modal logic to use a shared state managed in `page.tsx` for consistency across sections (`Header`, `HeroSection`, `CTASection`).
- Updated `Header`, `HeroSection`, and `CTASection` to receive `onOpenDemoModal` as props for triggering the modal.
2025-11-08 18:22:58 +01:00
Felipe Cardoso
b630559e0b Add comprehensive unit tests for homepage components and utilities
- Introduced unit tests for homepage components: `QuickStartCode`, `Header`, `DemoCredentialsModal`, `AnimatedTerminal`, `CTASection`, and `StatsSection`.
- Added utility tests for `chart-colors` including opacity, palettes, and gradient validation.
- Mocked dependencies (`framer-motion`, `react-syntax-highlighter`, `DemoCredentialsModal`) for isolated testing.
- Verified accessibility features, animations, and interactive behaviors across components.
2025-11-08 17:06:14 +01:00
Felipe Cardoso
fe289228e1 Enhance responsive layout for homepage sections
- Updated `DemoSection`, `PhilosophySection`, `FeatureCard`, and `TechStackSection` to ensure proper alignment and height consistency.
- Added `h-full` and `flex` utility classes for better flexbox behavior and layout responsiveness.
- Improved text and description alignment within cards by introducing `flex-1`.
2025-11-08 16:11:43 +01:00
Felipe Cardoso
63c171f83e Add interactive demo components and feature sections to homepage
- Introduced `DemoSection`, showcasing live feature demos with interactive cards and test credentials for admin and auth flows.
- Added `FeatureGrid` with dynamic animations, highlighting major application features like RBAC, documentation, and deployment readiness.
- Built reusable `FeatureCard` for feature details, including icons, descriptions, and CTAs.
- Implemented `TechStackSection` to display modern tools and technologies used in the stack with tooltips.
- Updated dependencies: added `framer-motion`, `lucide-react`, and `react-syntax-highlighter`.
2025-11-08 15:46:52 +01:00
Felipe Cardoso
e02329b734 Refactor admin dashboard E2E tests to improve reliability and scope selectors
- Replaced ambiguous text-based selectors with `data-testid` and scoped element searches to specific sections (e.g., Quick Actions, dashboard stats) to avoid unintended matches.
- Updated mock data references in stat card value tests for clarity and alignment with mock structure.
- Refined navigation and accessibility checks to ensure correct link and heading targeting.
2025-11-08 09:54:07 +01:00
Felipe Cardoso
e74830bec5 Add AuthLayoutClient component and unit tests for authentication layout
- Implemented `AuthLayoutClient` with theme toggle and responsive layout.
- Replaced legacy layout implementation in `layout.tsx` with `AuthLayoutClient` for improved modularity and styling consistency.
- Added comprehensive Jest tests to verify layout structure, theme toggle placement, and responsive rendering.
2025-11-08 09:18:47 +01:00
Felipe Cardoso
51ef4632e6 Refactor charts to use centralized color palette configuration
- Introduced `chart-colors.ts` utility to manage reusable color configurations across all chart components (`UserGrowthChart`, `OrganizationDistributionChart`, `SessionActivityChart`, `UserStatusChart`).
- Updated chart components to replace inline color definitions with `CHART_PALETTES` for improved consistency and maintainability.
- Enhanced tooltip, legend, and axis styles to align with updated project theming.
2025-11-07 12:41:53 +01:00
Felipe Cardoso
b749f62abd Complete Phase 9: Charts & Analytics
- Added 5 new reusable chart components (`ChartCard`, `UserGrowthChart`, `OrganizationDistributionChart`, `SessionActivityChart`, and `UserStatusChart`) with full TypeScript definitions, responsive designs, and mock data generators for demo purposes.
- Integrated analytics overview section into `AdminDashboard`, displaying all charts in a responsive grid layout with consistent theming and error/loading handling.
- Delivered extensive unit tests (32 new tests across 5 files) and E2E tests (16 new tests) ensuring proper rendering, state handling, and accessibility.
- Updated `IMPLEMENTATION_PLAN.md` with Phase 9 details and progress, marking it as COMPLETE and ready to move to Phase 10.
- Maintained 100% unit test pass rate, with overall code coverage at 95.6%, zero build/lint errors, and production readiness achieved.
2025-11-07 12:27:54 +01:00
Felipe Cardoso
3b28b5cf97 Complete Phase 8: Organization Management
- Delivered a fully functional and production-ready organization management system, including CRUD operations, member management, and role-based access control.
- Added 8 new components and 8 hooks with comprehensive unit and E2E test coverage (49 new E2E tests, 96.92% overall coverage achieved).
- Implemented robust error handling, validation, and accessibility across all features.
- Updated documentation and marked Phase 8 as COMPLETE, ready to progress to Phase 9 (Charts & Analytics).
2025-11-07 08:43:34 +01:00
Felipe Cardoso
652fb6b180 Remove obsolete tests and unused imports in organization members and management components
- Deleted `OrganizationMembersPage` tests as they are no longer relevant.
- Removed unused `updated_at` property from test data in multiple components.
- Cleaned up redundant `useAuth` imports from `OrganizationMembersContent` and `OrganizationManagementContent`.
2025-11-07 07:55:05 +01:00
Felipe Cardoso
6b556431d3 Refactor organization and user management components/tests for simplification and improved clarity
- Removed unused properties (`slug`, `is_active`, etc.) in organization and user-related components and test data.
- Simplified function data typing by removing redundant `any` usage.
- Updated `params` in `OrganizationMembersPage` for Promise resolution and async handling.
- Cleaned up unused variables and streamlined form handling in `AddMemberDialog`.
2025-11-07 00:14:10 +01:00
Felipe Cardoso
f8b77200f0 Refactor E2E tests and mock APIs for improved reliability and maintainability
- Updated E2E tests to use specific role-based heading selectors for better robustness.
- Enhanced mock routes in `auth.ts` to handle detailed organization endpoints more effectively.
- Improved test flow by adding `waitUntil: 'networkidle'` to navigation steps.
- Refined `admin-access.spec.ts` interactions to use optimized wait and click implementations for better performance.
- Updated dialog texts and field labels to match latest UI changes.
2025-11-07 00:02:01 +01:00
Felipe Cardoso
f99de75dc6 Add tests for Organization Members, handling roles and pagination
- Introduced unit tests for `OrganizationMembersPage` and `OrganizationMembersTable`, covering rendering, role badges, and pagination controls.
- Enhanced E2E tests with updated admin organization navigation and asserted breadcrumbs structure.
- Mocked API routes for members, organizations, and sessions in E2E helpers to support dynamic test scenarios.
2025-11-06 23:24:37 +01:00
Felipe Cardoso
4420756741 Add organization members management components and tests
- Implemented `OrganizationMembersContent`, `OrganizationMembersTable`, and `AddMemberDialog` components for organization members management.
- Added unit tests for `OrganizationMembersContent` and `OrganizationMembersTable`, covering rendering, state handling, and edge cases.
- Enhanced `useOrganizationMembers` and `useGetOrganization` hooks to support members list and pagination data integration.
- Updated E2E tests to include organization members page interactions and improved reliability.
2025-11-06 21:57:57 +01:00