Commit Graph

66 Commits

Author SHA1 Message Date
5af9d88db7
feat: update main branch (#45)
Some checks failed
Build & Push Judge4c Docker Image / build-and-push-judge4c-docker-image (., Dockerfile, judge4c) (push) Failing after 17s
* chore(deps): add pino and pino-pretty packages

* feat(log): add pino logging support

* chore(tailwind): update config with features path and animate import

* chore(deps): add react-icons package

* refactor(auth)!: replace credentials with OAuth providers and add logging

BREAKING CHANGE:
- Removed credentials-based authentication
- Added Google OAuth provider
- Implemented detailed logging for auth events
- Removed custom JWT/session handling
- Added sign-in page configuration
- Marked as server-only

* refactor(auth)!: remove components and rewrite sign-in page

* feat(user-avatar): refactor avatar component into user-avatar with improved structure

* style(dockview): reduce tabs container height and center align items

- Changed --dv-tabs-and-actions-container-height from 44px to 36px
- Added align-items: center to .dv-tabs-container
- Improved CSS formatting for better readability

* refactor(stores): split dockview store into problem-specific store

- Remove generic dockview store (`src/stores/dockview.tsx`)
- Add problem-specific dockview store (`src/stores/problem-dockview.tsx`)
- Remove submission-related state as it's no longer needed

* feat(dockview): refactor dockview component and add problem-specific implementation

- Refactor Dockview component into more modular structure:
  - Extract layout persistence logic to custom hook
  - Extract component conversion logic to custom hook
  - Make storageKey optional
  - Improve type safety with PanelParams interface
  - Add better error handling and duplicate panel detection
- Add new ProblemDockview wrapper component:
  - Integrates with problem-dockview store
  - Adds locale awareness
  - Provides standardized storage key
- Update related type definitions and imports

* refactor(problems): migrate description and solution to feature-based structure

- Remove old parallel route implementations (@Description and @Solutions)
- Add new feature-based components for problem description and solution
  - Create content and panel components for both features
  - Implement skeleton loading states
  - Use cached data fetching
- Update MDX rendering and scroll area implementations

* chore(problems): move problem-dockview to components directory

* refactor(layouts): overhaul problem and problemset page structures

- Simplify ProblemLayout to use children prop and remove ProblemStoreProvider
- Replace PlaygroundHeader with dedicated ProblemHeader component
- Streamline ProblemsetLayout with new ProblemsetHeader
- Remove deprecated BackButton in favor of NavigateBackButton
- Delete unused ProblemStoreProvider and related dependencies

* feat(prisma): add server-only caching for problems queries

- Add 'server-only' import to enforce server-side usage
- Implement cached problem queries with logging:
  - Add getProblems/getCachedProblems for all problems
  - Add getProblem/getCachedProblem for single problem by ID
- Use React cache and Next.js unstable_cache with tags
- Add detailed logging with timing metrics

* refactor(mdx-renderer): simplify component implementation

- Remove Suspense and Skeleton loading state
- Convert to arrow function syntax
- Reorganize import statements
- Simplify export syntax

* feat(components): add TooltipButton component

- A reusable button with tooltip functionality
- Supports customizable delay, tooltip content, and className
- Uses shadcn/ui Tooltip and Button components

* refactor(editor): consolidate editor toolbar actions into unified structure

- Moved all editor action buttons (copy, format, undo, redo, reset) from `src/components/features/playground/workspace/editor/components/` to new location `src/features/problems/code/components/toolbar/actions/`
- Introduced shared `TooltipButton` component to reduce duplication
- Created centralized `useProblemEditorActions` hook for common editor operations
- Updated imports and exports through new index file
- Maintained all existing functionality while improving code organization

* refactor(structure): reorganize page and component exports

- Move root page from /(app) to / directory
- Convert default exports to named exports in components
- Rename MainView component to HeroSection for better semantics

* refactor(route): rename [id] to [problemId] in problems route

* chore(components): remove unused problem-related components

- Delete footer.tsx from problem/description
- Delete solution.tsx from problem/description
- Delete header.tsx from problem/workspace/editor/components

* fix(page): add missing return statement in RootPage component

* feat(prisma/schema): add multilingual support for problem descriptions and solutions

BREAKING CHANGE:
- Removed `description` and `solution` fields from Problem model
- Added new models `ProblemDescription` and `ProblemSolution` with language support (EN/ZH)
- Updated seed data structure to support multilingual content
- Requires database migration and data migration from old structure

* chore(prisma/migrations): add migration for multilingual problem support

* fix(styles): adjust tabs overflow container height in abyss theme

Changed height property from 'unset !important' to '100%' for .dv-tabs-overflow-container and .dv-tabs-overflow-dropdown-default in the abyss-spaced theme to fix layout issues.

* refactor(loading): change to named export and arrow function

- Switch from default export to named export
- Convert component to arrow function
- Remove unused props parameter

* chore(shiki): convert function to arrow function

* chore(scripts): remove --turbopack flag from dev script

* refactor(prisma): simplify schema and remove zod-prisma-types

- Reorganized Prisma schema structure with simplified models and relations
- Removed zod-prisma-types generator as it's no longer needed
- Consolidated problem content types into a single ProblemLocalization model
- Simplified testcase and template structures
- Removed unused prisma types file

* refactor(prisma): simplify schema and remove zod-prisma-types

- Reorganized Prisma schema structure with simplified models and relations
- Removed zod-prisma-types generator as it's no longer needed
- Consolidated problem content types into a single ProblemLocalization model
- Simplified testcase and template structures
- Removed unused prisma types file

* refactor(i18n): migrate locale configuration to generated types

- Replace hardcoded locale strings with generated Locale enum from client
- Update cookie key name to be more specific (LOCALE_COOKIE_NAME -> JUDGE4C_LOCALE_KEY)
- Rename defaultLocale to DEFAULT_LOCALE for consistency
- Add 'server-only' imports to ensure server-side usage
- Simplify locale validation using Object.values(Locale)
- Clean up accept-language header parsing logic

* refactor(hooks): remove theme config and simplify theme hook

- Delete src/config/monaco-theme.ts and src/types/monaco-theme.ts
- Simplify useMonacoTheme hook to directly return theme strings
- Format use-mobile.ts with consistent semicolons and quotes

* refactor(i18n): replace language-settings with locale-switcher

- Replace react-world-flags with next/image for better optimization
- Simplify locale handling logic and remove unused getUserLocale
- Rename component to be more descriptive (language-settings -> locale-switcher)
- Update all references to use the new component
- Add proper SVG flag assets for supported locales
- Remove react-world-flags dependency from package.json

* refactor(shiki): migrate to shiki/core with lazy initialization

- Replace shiki with shiki/core for better tree-shaking
- Change highlighter initialization to explicit theme/lang imports
- Export getHighlighter function instead of direct highlighter instance
- Add error handling for uninitialized highlighter access

* refactor(language-selector): migrate to new location and implementation

- Remove old language selector from `src/components/features/playground/workspace/editor/components`
- Add new implementation in `src/features/problems/code/components/toolbar/controls`
- Update toolbar exports to include the new selector

* feat(problems): add localization support for problem descriptions and solutions

- Replace cached problem data with direct Prisma queries for localized content
- Implement locale-based content selection for both descriptions and solutions
- Refactor skeleton loading components structure
- Change all exports from named to default exports

* refactor(code-toolbar): standardize component exports and simplify reset logic

- Changed all toolbar action components from named exports with curly braces to default exports
- Simplified ResetButton by moving template logic to useProblemEditorActions hook
- Updated useProblemEditorActions to handle template selection internally using store data
- Renamed problem-editor-store import to problem-editor for consistency

* refactor(prisma): simplify prisma client initialization and remove caching

Removed all caching and logging functionality from prisma.ts, keeping only
the basic Prisma client initialization logic. This includes:
- Removal of getProblems, getCachedProblems, getProblem, getCachedProblem functions
- Removal of related logger and cache imports
- Simplified the global prisma client instantiation

* feat(config): add LANGUAGES constant for language enum values

* refactor(problemset): move components to separate files and improve structure

- Move ProblemsetHeader component from 'problemset-header' to 'header'
- Extract problemset table logic into dedicated ProblemsetTable component
- Add Suspense and skeleton loading for better UX
- Update layout and page structure

* feat(dockview): export Dockview component and create ProblemDockview wrapper

- Export Dockview component from src/components/dockview.tsx to make it reusable
- Create new ProblemDockview component in src/features/problems/components/dockview.tsx that:
  - Integrates with next-intl for locale handling
  - Connects to problem-dockview store
  - Wraps Dockview with problem-specific configuration
  - Adds locale-based key for proper re-rendering
- Maintain existing Dockview functionality including:
  - Layout persistence
  - Panel management
  - API handling

* refactor(problems): update ProblemHeader import path to new location

* refactor(mdx-render): simplify theme configuration and change export style

- Remove custom Monaco theme imports
- Use github default themes for rehypePrettyCode
- Change component export from default to named export

* feat(store): add problem editor state management

- Create problem-editor store with Zustand
- Manage editor state including problem, language, value and path
- Implement localStorage persistence for editor content
- Provide utility functions for language and value retrieval

* chore(utils): remove unused utility functions

- Remove getPath function (moved to problem-editor store)
- Remove getDifficultyColorClass function (unused)
- Keep only core cn utility function

* feat(code-panel): add code editor panel components

- Add CodePanel component as container for editor interface
- Add CodeContent component with Prisma data fetching
- Include CodeContentSkeleton for loading state
- Implement ProblemEditor integration with templates

* refactor(back-button): relocate and rename back button component

- Move from features/problems/components to shared components directory
- Rename NavigateBackButton to simpler BackButton
- Update component interface naming to BackButtonProps
- Keep all existing functionality intact

* feat(problemset): enhance header component with back button and className prop

- Replace problem-header.tsx with new header.tsx implementation
- Add BackButton functionality to navigate to home page
- Make className prop configurable using cn utility
- Maintain existing user avatar functionality

* refactor(config): migrate editor options to standalone editor config

- Rename `editor-language.ts` to `editor.ts`
- Update interface from `IEditorConstructionOptions` to `IStandaloneEditorConstructionOptions`
- Keep all existing editor options unchanged

* refactor(components): simplify BackButton by using TooltipButton

* refactor(problems): consolidate judge status toast

- Migrate status toast from shared hooks to problems feature
- Remove deprecated show-status-toast.tsx and status.ts
- Implement self-contained JudgeToast component with built-in status mapping

* refactor(judge-button): migrate run code button to standalone component

- Replace RunCodeButton with new JudgeButton component
- Use problem-specific stores instead of playground stores
- Implement new judge toast notification system
- Simplify authentication check logic
- Utilize new TooltipButton component

* refactor(api): extract OpenAI client to shared module

* fix(prisma): make TestcaseResult.output field optional

* chore(prisma): make TestcaseResult.output nullable in migration

* feat: replace dockview with flexlayout-react
2025-06-21 06:09:57 +00:00
7785ac8c1e chore(deps): add server-only package 2025-04-19 15:51:31 +08:00
93da6eb2cb chore(deps): add framer-motion package 2025-04-17 16:35:50 +08:00
a2bf1fc7a1 chore(deps): add react-world-flags package 2025-04-15 01:03:35 +08:00
e7e8b5da8b chore(deps): add next-intl package 2025-04-14 21:46:03 +08:00
bb644113f4 chore(deps): add date-fns package 2025-04-11 17:43:17 +08:00
46f2a3512f chore(deps): bump prisma and @prisma/client to v6.6.0 2025-04-09 11:44:37 +08:00
a8e243204b feat(layout): refactor problem layout to use DockView for organizing content sections 2025-04-04 18:13:14 +08:00
548f0b7184 feat(components/ui): add Switch component from shadcn/ui 2025-04-01 17:33:09 +08:00
f24e2264e0 chore(deps): add zod-prisma-types package 2025-04-01 01:56:05 +08:00
139c0ba76d feat(components/ui): add Table component from shadcn/ui 2025-03-30 21:08:03 +08:00
60d5c98aca perf(scripts): enable turbopack for dev server 2025-03-30 20:37:49 +08:00
8de69204f1 feat(deps): add ai, @ai-sdk/openai and @ai-sdk/react packages 2025-03-24 11:43:00 +08:00
047cd04ea3 feat(components/ui): add Accordion component from shadcn/ui 2025-03-17 20:21:20 +08:00
a5faab67c5 feat(components/ui): add Sidebar-07 component from shadcn/ui 2025-03-16 20:31:21 +08:00
5da1629524 chore(deps): update rehype-pretty-code, shiki, and @shikijs/monaco packages 2025-03-16 18:15:43 +08:00
86c58f87d3 chore(scripts): update postinstall script and remove prisma migrate deploy 2025-03-15 20:14:57 +08:00
abae72118a feat(components/ui): add Form component from shadcn/ui 2025-03-14 15:55:37 +08:00
18d9b28e1e feat(components/ui): add Sonner component from shadcn/ui 2025-03-14 15:33:07 +08:00
3cff6624c8 chore(deps): add uuid package 2025-03-14 14:18:09 +08:00
f9ed3b4e39 chore(deps): add @types/bcrypt package 2025-03-14 11:03:06 +08:00
e2dce21261 feat(components/ui): add Label component from shadcn/ui 2025-03-14 10:11:22 +08:00
015f46f873 chore(deps): add bcrypt and zod packages 2025-03-14 09:56:51 +08:00
bc7b7e3b8a feat(components/ui): add Avatar component from shadcn/ui 2025-03-12 15:19:41 +08:00
22b2824dc0 chore(deps): add @auth/prisma-adapter and update @prisma/client, prisma versions 2025-03-12 15:04:29 +08:00
75c884e8cc chore(deps): add next-auth@beta package 2025-03-12 14:59:11 +08:00
90e9829b79 chore(package): add prisma migrate deploy to postinstall script 2025-03-11 15:29:35 +08:00
af59e0f432 feat(components/ui): add Radio Group component from shadcn/ui 2025-03-06 21:25:18 +08:00
57eb27ce5e chore(deps): add postcss-github-markdown-css package 2025-03-06 21:18:51 +08:00
5ac5c92798 chore(deps): add postinstall script to run prisma generate 2025-03-06 14:38:54 +08:00
aacd5dccde chore(package): add prisma seed script to package.json 2025-03-06 11:27:33 +08:00
e3b45a05af chore(deps): add @prisma/client package 2025-03-06 11:17:54 +08:00
e63fc13a8e chore(deps): add prisma and tsx packages 2025-03-06 10:45:39 +08:00
09ef2bf22a feat(components/ui): add Sidebar-13 component from shadcn/ui 2025-03-03 14:51:13 +08:00
4be37fdf1e feat(components/ui): add Tooltip component from shadcn/ui 2025-03-03 10:33:43 +08:00
8fc113b348 chore(deps): update version constraints for monaco-editor and monaco-languageclient 2025-03-02 12:21:32 +08:00
eac2d633ca fix(deps): restrict shiki and @shikijs/monaco versions to <=2.5.0 due to API deprecation 2025-03-02 11:41:19 +08:00
09f47bcfc5 chore(deps): add tar-stream package 2025-02-28 21:15:16 +08:00
e2d1ded341 chore(deps): add @types/dockerode package 2025-02-26 21:30:06 +08:00
ae9be5d325 chore(deps): add dockerode package 2025-02-26 21:17:17 +08:00
780908e4d3 feat(component/ui): add Select component from shadcn/ui 2025-02-25 21:33:17 +08:00
0c2b3c897f chore(deps): add rehype-math and rehype-katex packages 2025-02-25 15:09:20 +08:00
d5cda08a3e feat(components/ui): add Badge and Tabs components from shadcn/ui 2025-02-23 16:37:12 +08:00
3277156673 chore(deps): update rehype dependencies, add rehype-autolink-headings and rehype-slug packages 2025-02-23 14:57:15 +08:00
e74e2e3102 feat(components/ui): add Resizable component from shadcn/ui 2025-02-21 20:02:31 +08:00
8cf98674ef chore(deps): add rehype-pretty-code package 2025-02-20 22:31:04 +08:00
b495cc4ea6 fix(shiki): downgrade @shikijs/monaco and shiki to version 2.5.0 to resolve 'getHighlighter' import error 2025-02-20 22:30:17 +08:00
8498f57fbc chore(deps): add remark-gfm package for GitHub Flavored Markdown support 2025-02-20 18:42:42 +08:00
a4a037f5a4 feat(components/ui): add Scroll Area component from shadcn/ui 2025-02-20 15:56:55 +08:00
1f2394576b chore(deps): add github-markdown-css package 2025-02-20 15:49:30 +08:00