Skip to content

Conversation

@elhalj
Copy link
Owner

@elhalj elhalj commented Sep 5, 2025

Summary

Refactor front-end context consumption into custom hooks, centralize API error typing, and enhance task and room UIs with new priority indicators, styling updates, and unified error handling.

Enhancements:

  • Introduce useAuth, useRoom, and useTask hooks to replace direct context usage in UI components
  • Centralize ApiError type in shared types directory and streamline error handling across login, registration, room, and task modules
  • Revamp task card UI in RoomId with new styling, priority badges with icons, description truncation, and updated control buttons
  • Add barrel exports for types and hooks to simplify import paths
  • Fix TaskProvider to use currentUser for real-time task additions

Chores:

  • Add"Mes ROOM" header in Room component for clarity
  • Comment out experimental tanstack-query–based room hook implementation in useRoom.ts

@elhalj elhalj added the enhancement New feature or request label Sep 5, 2025
@netlify
Copy link

netlify bot commented Sep 5, 2025

Deploy Preview for colab-flow ready!

Name Link
🔨 Latest commit 3a2fb28
🔍 Latest deploy log https://app.netlify.com/projects/colab-flow/deploys/68ba3980744ece00087207f0
😎 Deploy Preview https://deploy-preview-31--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.

@sourcery-ai
Copy link

sourcery-ai bot commented Sep 5, 2025

🧙 Sourcery has finished reviewing your pull request!


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

@elhalj
Copy link
Owner Author

elhalj commented Sep 5, 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 - here's some feedback:

  • Remove commented-out legacy code from the useRoom hook to keep the codebase clean.
  • The RoomId component is quite large—consider breaking out the task card rendering (icons, badges, layout) into smaller reusable components for better readability.
  • Extract the priority/status icon and color logic into standalone helper modules or components to reduce duplication and improve cohesion.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Remove commented-out legacy code from the useRoom hook to keep the codebase clean.
- The RoomId component is quite large—consider breaking out the task card rendering (icons, badges, layout) into smaller reusable components for better readability.
- Extract the priority/status icon and color logic into standalone helper modules or components to reduce duplication and improve cohesion.

## Individual Comments

### Comment 1
<location> `frontend/src/hook/useTask.ts:31` </location>
<code_context>
+    updateTask: (id: string, task: Task) => Promise<void>;
+    deleteTask: (id: string) => Promise<void>;
+    viewTaskDetails: (taskId: string) => void;
+    leaveTaskDetails: (taskId: string) => void;
+  };
+};
</code_context>

<issue_to_address>
Parameter for 'leaveTaskDetails' may be unnecessary.

If 'leaveTaskDetails' doesn't use 'taskId', remove the parameter to align with its intended usage.
</issue_to_address>

<suggested_fix>
<<<<<<< SEARCH
    leaveTaskDetails: (taskId: string) => void;
=======
    leaveTaskDetails: () => void;
>>>>>>> REPLACE

</suggested_fix>

### Comment 2
<location> `frontend/src/pages/RoomId.tsx:336` </location>
<code_context>
                         </div>
-                        <p className="text-slate-700 leading-relaxed uppercase">
+                        <p
+                          className="text-gray-700 text-sm mb-4 line-clamp-2 break-all"
+                          title={task.description}
+                        >
</code_context>

<issue_to_address>
Use of 'break-all' may impact readability for long words.

Consider using 'break-words' instead, as it maintains word integrity and improves readability unless handling exceptionally long unbroken strings.
</issue_to_address>

<suggested_fix>
<<<<<<< SEARCH
                          className="text-gray-700 text-sm mb-4 line-clamp-2 break-all"
=======
                          className="text-gray-700 text-sm mb-4 line-clamp-2 break-words"
>>>>>>> REPLACE

</suggested_fix>

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.

updateTask: (id: string, task: Task) => Promise<void>;
deleteTask: (id: string) => Promise<void>;
viewTaskDetails: (taskId: string) => void;
leaveTaskDetails: (taskId: string) => void;
Copy link

Choose a reason for hiding this comment

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

suggestion: Parameter for 'leaveTaskDetails' may be unnecessary.

If 'leaveTaskDetails' doesn't use 'taskId', remove the parameter to align with its intended usage.

Suggested change
leaveTaskDetails: (taskId: string) => void;
leaveTaskDetails: () => void;

</div>
<p className="text-slate-700 leading-relaxed uppercase">
<p
className="text-gray-700 text-sm mb-4 line-clamp-2 break-all"
Copy link

Choose a reason for hiding this comment

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

suggestion: Use of 'break-all' may impact readability for long words.

Consider using 'break-words' instead, as it maintains word integrity and improves readability unless handling exceptionally long unbroken strings.

Suggested change
className="text-gray-700 text-sm mb-4 line-clamp-2 break-all"
className="text-gray-700 text-sm mb-4 line-clamp-2 break-words"

@elhalj
Copy link
Owner Author

elhalj commented Sep 5, 2025

@sourcery-ai title

@elhalj elhalj merged commit 83167cc into main Sep 5, 2025
8 of 10 checks passed
@sourcery-ai sourcery-ai bot changed the title Feature/front Revamp task UI, refactor context to hooks, and unify error handling Sep 5, 2025
@sourcery-ai sourcery-ai bot changed the title Revamp task UI, refactor context to hooks, and unify error handling Refactor context to hooks, revamp task UI, and streamline error handling Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant