Skip to content

Conversation

@elhalj
Copy link
Owner

@elhalj elhalj commented Sep 1, 2025

Summary

Update Netlify frontend build configuration for deployment

Enhancements:

  • Change publish directory to dist and remove base path
  • Bump Node version from 18 to 22
  • Add VITE environment variables for API endpoints and application metadata

@sourcery-ai
Copy link

sourcery-ai bot commented Sep 1, 2025

Reviewer's Guide

This PR modernizes the frontend by updating Netlify build settings, standardizing code style, overhauling UI components for consistent styling and responsiveness, enhancing form validation and error feedback, and adjusting the logout redirect.

Sequence diagram for improved logout redirect

sequenceDiagram
    actor User
    participant Frontend
    participant AuthProvider
    User->>Frontend: Clicks Logout
    Frontend->>AuthProvider: logout()
    AuthProvider->>Frontend: Clears user and token
    AuthProvider->>Frontend: Redirects to /login
    Frontend->>User: Shows login page
Loading

Class diagram for updated AuthProvider context (logout redirect and user management)

classDiagram
    class AuthProvider {
      - token: string | null
      - currentUser: User | null
      - user: User[]
      + login(email, password)
      + logout()
      + register(userName, email, password)
      + getAllUser()
    }
    class User {
      + _id: string
      + userName: string
      + email: string
    }
    AuthProvider "1" *-- "many" User: manages
Loading

Class diagram for improved form validation in Login and Register components

classDiagram
    class LoginForm {
      + email: string
      + password: string
    }
    class RegisterForm {
      + userName: string
      + email: string
      + password: string
    }
    class Login {
      - formData: LoginForm
      - error: string
      + validateForm(email, password)
      + handleSubmit()
    }
    class Register {
      - formData: RegisterForm
      - error: string
      + validateForm(userName, email, password)
      + handleSubmit()
    }
    Login "1" *-- "1" LoginForm
    Register "1" *-- "1" RegisterForm
Loading

Class diagram for improved Task creation and update forms (validation and UI)

classDiagram
    class TaskProps {
      + title: string
      + description: string
      + dueDate: string
      + estimatedHours: number
      + completed: boolean
      + status: string
      + priority: string
      + progress: number
    }
    class CreateTask {
      - myTask: TaskProps
      - errors: string
      + handleInputChange()
      + handleSelectChange()
      + handleRoomChange(roomId)
      + handleSubmit()
    }
    class UpdateTask {
      - task: TaskProps
      - loading: boolean
      + handleInputChange()
      + handleSelectChange()
      + handleSubmit()
    }
    CreateTask "1" *-- "1" TaskProps
    UpdateTask "1" *-- "1" TaskProps
Loading

File-Level Changes

Change Details Files
Update Netlify build configuration
  • remove base directory and set publish to dist
  • bump Node version from 18 to 22
  • add VITE_ environment variables for API, socket and app metadata
frontend/netlify.toml
Overhaul UI components and standardize code style
  • unify string quotes, semicolons and spacing
  • remove commented‐out code and trim extra lines
  • revamp Tailwind classes for layout, spacing, shadows and responsive behavior
frontend/src/pages/RoomId.tsx
frontend/src/pages/AddPage.tsx
frontend/src/pages/AddRoomPage.tsx
frontend/src/pages/UpdatePage.tsx
frontend/src/pages/RegisterPage.tsx
frontend/src/pages/LoginPage.tsx
frontend/src/ui/UpdateTask.tsx
frontend/src/ui/CreateTask.tsx
frontend/src/ui/room/CreateRoom.tsx
frontend/src/ui/login.tsx
frontend/src/ui/register.tsx
frontend/src/ui/Tasks.tsx
frontend/src/ui/Stats.tsx
frontend/src/ui/UtilsBar.tsx
frontend/src/ui/room/Room.tsx
frontend/src/components/Header.tsx
frontend/src/components/Main.tsx
Enhance form validation and error feedback
  • add validateForm helpers and error state management
  • disable submit buttons on invalid input or loading
  • display inline error messages under form fields
frontend/src/ui/login.tsx
frontend/src/ui/register.tsx
frontend/src/ui/room/CreateRoom.tsx
frontend/src/ui/UpdateTask.tsx
frontend/src/ui/CreateTask.tsx
Adjust auth redirect on logout
  • change logout redirect target from “/” to “/login”
frontend/src/context/AuthProvider.tsx

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@netlify
Copy link

netlify bot commented Sep 1, 2025

Deploy Preview for colab-flow ready!

Name Link
🔨 Latest commit e1f3b8b
🔍 Latest deploy log https://app.netlify.com/projects/colab-flow/deploys/68b79953b5c2f4000845e645
😎 Deploy Preview https://deploy-preview-28--colab-flow.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@elhalj
Copy link
Owner Author

elhalj commented Sep 1, 2025

@sourcery-ai title

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@sourcery-ai sourcery-ai bot changed the title Feature/front Update Netlify frontend build config Sep 1, 2025
@elhalj
Copy link
Owner Author

elhalj commented Sep 3, 2025

@sourcery-ai review

@elhalj
Copy link
Owner Author

elhalj commented Sep 3, 2025

@sourcery-ai title

@sourcery-ai sourcery-ai bot changed the title Update Netlify frontend build config Enhance Netlify deployment and refactor frontend UI Sep 3, 2025
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments

### Comment 1
<location> `frontend/src/ui/Stats.tsx:63` </location>
<code_context>
+            <div className="mt-3 h-1 w-full bg-white/20 rounded-full overflow-hidden">
+              <div
+                className={`h-full bg-gradient-to-r ${stat.color} rounded-full`}
+                style={{
+                  width: `${Math.min(
+                    (stat.value / (tasks.length || 1)) * 100,
+                    100
+                  )}%`,
+                }}
+              ></div>
</code_context>

<issue_to_address>
Division by zero risk in stats bar width calculation.

Displaying a progress bar when there are no tasks may be misleading. Recommend hiding the bar or setting its width to 0% in this case.
</issue_to_address>

### Comment 2
<location> `frontend/src/ui/room/CreateRoom.tsx:251` </location>
<code_context>
-              : 'bg-blue-600 hover:bg-blue-700'}`}
+          <button
+            type="submit"
+            disabled={
+              loading ||
+              !formData.room_name.trim() ||
+              !formData.description.trim()
+            }
+            className={`px-6 py-3 rounded-xl text-white font-semibold shadow-md transition-colors duration-200 ${
</code_context>

<issue_to_address>
CreateRoom disables submit if description is empty, but does not check for selected members.

Consider updating the submit button logic to also disable when no members are selected, if at least one member is required.
</issue_to_address>

<suggested_fix>
<<<<<<< SEARCH
            disabled={
              loading ||
              !formData.room_name.trim() ||
              !formData.description.trim()
            }
            className={`px-6 py-3 rounded-xl text-white font-semibold shadow-md transition-colors duration-200 ${
              loading ||
              !formData.room_name.trim() ||
              !formData.description.trim()
                ? "bg-blue-300 cursor-not-allowed"
                : "bg-blue-600 hover:bg-blue-700"
            }`}
=======
            disabled={
              loading ||
              !formData.room_name.trim() ||
              !formData.description.trim() ||
              !formData.members ||
              formData.members.length === 0
            }
            className={`px-6 py-3 rounded-xl text-white font-semibold shadow-md transition-colors duration-200 ${
              loading ||
              !formData.room_name.trim() ||
              !formData.description.trim() ||
              !formData.members ||
              formData.members.length === 0
                ? "bg-blue-300 cursor-not-allowed"
                : "bg-blue-600 hover:bg-blue-700"
            }`}
>>>>>>> REPLACE

</suggested_fix>

### Comment 3
<location> `frontend/src/ui/Tasks.tsx:65` </location>
<code_context>
               <button
                 type="button"
                 onClick={() => setShowMenu(true)}
</code_context>

<issue_to_address>
No confirmation before deleting a task.

Adding a confirmation dialog will help prevent users from accidentally deleting tasks.
</issue_to_address>

### Comment 4
<location> `frontend/src/ui/room/AddMember.tsx:106` </location>
<code_context>
                 type="button"
-                className="px-3 py-1.5 bg-gradient-to-r from-blue-600 to-purple-600 text-white text-sm rounded-lg hover:from-blue-700 hover:to-purple-700 transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2"
+                className="px-3 py-1.5 bg-gradient-to-r from-blue-600 to-purple-600 text-white text-xs font-medium rounded-lg hover:from-blue-700 hover:to-purple-700 shadow-sm transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2"
                 disabled={addingMemberId === u._id}
                 onClick={() => u._id && handleAddMember(u._id)}
               >
</code_context>

<issue_to_address>
AddMember disables button while adding, but does not prevent adding the same user multiple times.

Consider disabling the button for users already in the room or showing feedback when attempting to add an existing member.

Suggested implementation:

```typescript
              <button
                type="button"
                className="px-3 py-1.5 bg-gradient-to-r from-blue-600 to-purple-600 text-white text-xs font-medium rounded-lg hover:from-blue-700 hover:to-purple-700 shadow-sm transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2"
                disabled={addingMemberId === u._id || memberIds.includes(u._id)}
                onClick={() => {
                  if (u._id && !memberIds.includes(u._id)) {
                    handleAddMember(u._id);
                  }
                }}
                title={memberIds.includes(u._id) ? "User is already a member" : ""}
              >

```

- Make sure `memberIds` is available in the component and contains the IDs of users already in the room.
- If you want to show a more visible feedback (e.g., a message below the button), you can add a conditional render for a message when `memberIds.includes(u._id)` is true.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +63 to +67
style={{
width: `${Math.min(
(stat.value / (tasks.length || 1)) * 100,
100
)}%`,
Copy link

Choose a reason for hiding this comment

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

issue (bug_risk): Division by zero risk in stats bar width calculation.

Displaying a progress bar when there are no tasks may be misleading. Recommend hiding the bar or setting its width to 0% in this case.

Comment on lines +251 to +262
disabled={
loading ||
!formData.room_name.trim() ||
!formData.description.trim()
}
className={`px-6 py-3 rounded-xl text-white font-semibold shadow-md transition-colors duration-200 ${
loading ||
!formData.room_name.trim() ||
!formData.description.trim()
? "bg-blue-300 cursor-not-allowed"
: "bg-blue-600 hover:bg-blue-700"
}`}
Copy link

Choose a reason for hiding this comment

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

suggestion: CreateRoom disables submit if description is empty, but does not check for selected members.

Consider updating the submit button logic to also disable when no members are selected, if at least one member is required.

Suggested change
disabled={
loading ||
!formData.room_name.trim() ||
!formData.description.trim()
}
className={`px-6 py-3 rounded-xl text-white font-semibold shadow-md transition-colors duration-200 ${
loading ||
!formData.room_name.trim() ||
!formData.description.trim()
? "bg-blue-300 cursor-not-allowed"
: "bg-blue-600 hover:bg-blue-700"
}`}
disabled={
loading ||
!formData.room_name.trim() ||
!formData.description.trim() ||
!formData.members ||
formData.members.length === 0
}
className={`px-6 py-3 rounded-xl text-white font-semibold shadow-md transition-colors duration-200 ${
loading ||
!formData.room_name.trim() ||
!formData.description.trim() ||
!formData.members ||
formData.members.length === 0
? "bg-blue-300 cursor-not-allowed"
: "bg-blue-600 hover:bg-blue-700"
}`}

Comment on lines +65 to +74
<button
type="button"
className="opacity-0 group-hover:opacity-100 p-1 text-gray-400 hover:text-white transition-all"
>
<MoreHorizontal className="w-5 h-5" />
{}
</button>
</div>

{/* Progress bar */}
<div className="mb-4">
<div className="flex justify-between text-xs text-gray-400 mb-1">
<span>Progression</span>
<span>{task.progress}%</span>
</div>
<div className="w-full bg-gray-700 rounded-full h-2">
<div
className="bg-gradient-to-r from-purple-500 to-pink-500 h-2 rounded-full transition-all duration-500"
style={{ width: `${task.progress}%` }}
></div>
</div>
{/* Title & description */}
Copy link

Choose a reason for hiding this comment

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

suggestion: No confirmation before deleting a task.

Adding a confirmation dialog will help prevent users from accidentally deleting tasks.

type="button"
className="px-3 py-1.5 bg-gradient-to-r from-blue-600 to-purple-600 text-white text-sm rounded-lg hover:from-blue-700 hover:to-purple-700 transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2"
className="px-3 py-1.5 bg-gradient-to-r from-blue-600 to-purple-600 text-white text-xs font-medium rounded-lg hover:from-blue-700 hover:to-purple-700 shadow-sm transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2"
disabled={addingMemberId === u._id}
Copy link

Choose a reason for hiding this comment

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

suggestion (bug_risk): AddMember disables button while adding, but does not prevent adding the same user multiple times.

Consider disabling the button for users already in the room or showing feedback when attempting to add an existing member.

Suggested implementation:

              <button
                type="button"
                className="px-3 py-1.5 bg-gradient-to-r from-blue-600 to-purple-600 text-white text-xs font-medium rounded-lg hover:from-blue-700 hover:to-purple-700 shadow-sm transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2"
                disabled={addingMemberId === u._id || memberIds.includes(u._id)}
                onClick={() => {
                  if (u._id && !memberIds.includes(u._id)) {
                    handleAddMember(u._id);
                  }
                }}
                title={memberIds.includes(u._id) ? "User is already a member" : ""}
              >
  • Make sure memberIds is available in the component and contains the IDs of users already in the room.
  • If you want to show a more visible feedback (e.g., a message below the button), you can add a conditional render for a message when memberIds.includes(u._id) is true.

@elhalj elhalj merged commit 788582d into main Sep 3, 2025
8 of 10 checks passed
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