Skip to content

Fix/build - #15

Merged
JMauclair merged 7 commits into
mainfrom
fix/build
Nov 28, 2025
Merged

Fix/build#15
JMauclair merged 7 commits into
mainfrom
fix/build

Conversation

@JMauclair

Copy link
Copy Markdown
Contributor

No description provided.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/components/AuthModel/page.tsx
Comment thread src/feature/meetings/components/MeetingForm.tsx
@JMauclair
JMauclair merged commit e29cd22 into main Nov 28, 2025
1 check passed
@JMauclair
JMauclair deleted the fix/build branch November 28, 2025 09:56
@JMauclair JMauclair self-assigned this Nov 28, 2025
@JMauclair
JMauclair requested a review from Copilot November 28, 2025 09:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This pull request addresses build issues by refactoring form components and schemas. The changes primarily involve migrating from Formik to react-hook-form, improving type safety, and fixing schema definitions across various form components.

Key Changes:

  • Migrated form input components (TextInput, TextareaInput, SelectInput, CheckboxInput, InputWithDropDown) from Formik's Field-based approach to native HTML elements with forwardRef support for react-hook-form compatibility
  • Enhanced type safety in TodoForm.tsx and MeetingForm.tsx by adding explicit type assertions and definitions
  • Removed unused usersLoading prop from TodoModel component
  • Updated Zod schemas to improve validation logic

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/feature/todo/components/TodoModel.tsx Removed unused usersLoading prop from TodoForm component
src/feature/todo/components/TodoForm.tsx Added type safety with Status and Priority types, added type assertions for dropdown onChange handlers, and reformatted code
src/feature/meetings/components/MeetingForm.tsx Updated Zod schema by removing .default() and .or(z.literal("")) chains, simplified status type conversion logic
src/components/ui/TextareaInput.tsx Migrated from Formik Field component to native textarea with forwardRef for react-hook-form compatibility
src/components/ui/TextInput.tsx Migrated from Formik Field component to native input with forwardRef for react-hook-form compatibility
src/components/ui/SelectInput.tsx Migrated from Formik Field component to native select with forwardRef for react-hook-form compatibility
src/components/ui/InputWithDropDown.tsx Migrated from Formik Field components to native input/select elements with ref support
src/components/ui/CheckboxInput.tsx Migrated from Formik Field component to native checkbox input with forwardRef for react-hook-form compatibility
src/components/AuthModel/page.tsx Updated Zod schema definitions for email validation and login schema fields
Comments suppressed due to low confidence (3)

src/feature/todo/components/TodoModel.tsx:9

  • Unused import toast.
import toast from "react-hot-toast"

src/feature/todo/components/TodoModel.tsx:12

  • Unused import useCompaniesStore.
import { useCompaniesStore } from "@/feature/companies/stores/useCompaniesStore"

src/feature/todo/components/TodoModel.tsx:25

  • Unused variable usersLoading.
  const { users, loading: usersLoading, fetchUsers } = useUserStore();

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


const baseSchema = z.object({
email: z.string().email("Invalid email"),
email: z.email("Invalid email"),

Copilot AI Nov 28, 2025

Copy link

Choose a reason for hiding this comment

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

The method z.email() does not exist in Zod. It should be z.string().email("Invalid email") to validate email format.

Suggested change
email: z.email("Invalid email"),
email: z.string().email("Invalid email"),

Copilot uses AI. Check for mistakes.
Comment on lines +26 to +27
name: z.string(),
confirmPassword: z.string(),

Copilot AI Nov 28, 2025

Copy link

Choose a reason for hiding this comment

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

In the loginSchema, name and confirmPassword fields should be .optional() since they are only required for signup, not login. Without .optional(), these fields will be required for login validation, which is incorrect.

Suggested change
name: z.string(),
confirmPassword: z.string(),
name: z.string().optional(),
confirmPassword: z.string().optional(),

Copilot uses AI. Check for mistakes.
step="0.01"
min="0"
ref={inputRef}
className="flex-1 text-sm rounded-l-md px-3 py-2 outline-none [&::-webkit-inner-spin-button]:appearance-none [&:-webkit-outer-spin-button]:appearance-none [appearance:textfield] w-1/4"

Copilot AI Nov 28, 2025

Copy link

Choose a reason for hiding this comment

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

Invalid CSS pseudo-class selector. The correct syntax is [&::-webkit-outer-spin-button] (with double colons), not [&:-webkit-outer-spin-button] (single colon). This will cause the style to not be applied correctly.

Suggested change
className="flex-1 text-sm rounded-l-md px-3 py-2 outline-none [&::-webkit-inner-spin-button]:appearance-none [&:-webkit-outer-spin-button]:appearance-none [appearance:textfield] w-1/4"
className="flex-1 text-sm rounded-l-md px-3 py-2 outline-none [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none [appearance:textfield] w-1/4"

Copilot uses AI. Check for mistakes.
assignedTo: z.string().optional(),
linkedTo: z.string().optional(),
participants: z.array(z.string().trim().min(1, "Participant name cannot be empty").max(100)),
status: z.enum(["scheduled", "confirmed", "cancelled"], { error: "Status is required" }),

Copilot AI Nov 28, 2025

Copy link

Choose a reason for hiding this comment

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

The z.enum() configuration object should use required_error or errorMap, not error. The property name error is not valid for Zod's enum options and will not display the custom error message.

Suggested change
status: z.enum(["scheduled", "confirmed", "cancelled"], { error: "Status is required" }),
status: z.enum(["scheduled", "confirmed", "cancelled"], { required_error: "Status is required" }),

Copilot uses AI. Check for mistakes.
tags: z.array(z.string().trim().min(1, "Tag cannot be empty").max(30)).default([]),
assignedTo: z.string().optional(),
linkedTo: z.string().optional(),
participants: z.array(z.string().trim().min(1, "Participant name cannot be empty").max(100)),

Copilot AI Nov 28, 2025

Copy link

Choose a reason for hiding this comment

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

The participants field should have a .default([]) to handle cases where participants are not provided. Without it, the field will be undefined when not provided, which can cause runtime errors when the code expects an array (e.g., in line 242 where vals.participants.map() is called).

Suggested change
participants: z.array(z.string().trim().min(1, "Participant name cannot be empty").max(100)),
participants: z.array(z.string().trim().min(1, "Participant name cannot be empty").max(100)).default([]),

Copilot uses AI. Check for mistakes.
linkedTo: z.string().optional(),
participants: z.array(z.string().trim().min(1, "Participant name cannot be empty").max(100)),
status: z.enum(["scheduled", "confirmed", "cancelled"], { error: "Status is required" }),
tags: z.array(z.string()).optional(),

Copilot AI Nov 28, 2025

Copy link

Choose a reason for hiding this comment

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

The tags field should have a .default([]) to ensure it's always an array. Without this, when tags are not provided, the field will be undefined, which can cause issues when the code expects an array.

Suggested change
tags: z.array(z.string()).optional(),
tags: z.array(z.string()).optional().default([]),

Copilot uses AI. Check for mistakes.
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

JMauclair added a commit that referenced this pull request Dec 2, 2025
…r improved flexibility' (#15) from implement/semantic_release into main

Reviewed-on: https://git.stralya.com/Klickbee/klickbee-crm/pulls/15
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