Skip to content

[Improvement] Add bot suggestion from #3938 #3947

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

CREDO23
Copy link
Contributor

@CREDO23 CREDO23 commented Jul 17, 2025

Description

  • Review & Apply Relevant AI Suggestions from PR Stage #3938

✅ Checklist

  • My code follows the project coding style
  • I reviewed my own code and added comments where needed
  • I tested my changes locally
  • I updated or created related documentation if needed
  • No new warnings or errors are introduced

Summary by CodeRabbit

  • Bug Fixes

    • Improved accuracy of empty state display in the timesheet view by refining the loading condition.
  • Documentation

    • Updated documentation for the task sizes dropdown to clarify prop types.
  • Refactor

    • Enhanced type safety in the multiple status dropdown by refining function parameter types.
    • Replaced a hardcoded scroll threshold with a named constant for improved clarity in pagination.
    • Simplified type handling in task priorities and sizes value hooks by removing unnecessary type assertions.

@CREDO23 CREDO23 self-assigned this Jul 17, 2025
@CREDO23 CREDO23 added WEB Web app Improvement Improvement Ever Teams labels Jul 17, 2025
Copy link
Contributor

coderabbitai bot commented Jul 17, 2025

Walkthrough

The changes focus on refining type annotations, improving code clarity, and enforcing stricter equality checks across several components and hooks. Updates include stricter type handling in dropdown components, improved JSDoc comments, extraction of magic numbers into named constants, and removal of unnecessary type assertions in hooks. No functional behavior is altered.

Changes

File(s) Change Summary
apps/web/core/components/pages/timesheet/timesheet-view.tsx Changed loose equality (==) to strict equality (===) in a conditional check for rendering an empty state.
apps/web/core/components/tasks/multiple-status-dropdown.tsx Refined type annotations in event handlers and function parameters for better type safety.
apps/web/core/components/tasks/task-sizes-dropdown.tsx Updated JSDoc comment to specify a more precise type for the props parameter.
apps/web/core/hooks/common/use-pagination.ts Introduced a named constant (SCROLL_THRESHOLD) to replace a magic number in scroll logic.
apps/web/core/hooks/tasks/use-task-priorities-value.ts, apps/web/core/hooks/tasks/use-task-sizes-value.ts Removed unnecessary type assertions when passing arrays to mapping functions.

Poem

A hop and a skip, our types are refined,
With stricter checks, no bugs to find!
Magic numbers named, assertions trimmed away,
JSDoc shines bright, leading the way.
Through dropdowns and hooks, our code’s more robust—
In the warren of logic, in clarity we trust!
🐇✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

yarn install v1.22.22
[1/4] Resolving packages...
(node:27465) [DEP0169] DeprecationWarning: url.parse() behavior is not standardized and prone to errors that have security implications. Use the WHATWG URL API instead. CVEs are not issued for url.parse() vulnerabilities.
(Use node --trace-deprecation ... to show where the warning was created)
error Couldn't find package "@ever-teams/eslint-config@" required by "@ever-teams/types@" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ETP-42-review-apply-relevant-ai-suggestions-from-pr-3938

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Summary

This PR implements several code quality improvements across multiple files based on AI suggestions from PR #3938. The changes focus on:

  1. Improved type safety by removing unnecessary type assertions and 'any' types
  2. Better code maintainability through constant extraction
  3. Enhanced comparison operators for stricter type checking
  4. Better documentation and prop types

Specific changes include:

  • Timesheet view: Changed loose equality (==) to strict equality (===)
  • useTaskSizesValue: Removed unnecessary type assertion
  • useScrollPagination: Extracted magic number to named constant SCROLL_THRESHOLD
  • MultipleStatusDropdown: Replaced 'any' types with specific TypeScript types
  • TaskSizesDropdown: Improved documentation and added isMultiple prop support
  • useTaskPrioritiesValue: Removed unnecessary type assertion

PR Description Notes:

  • The description could be more detailed about which specific AI suggestions were implemented
  • Documentation update checkbox is unchecked despite making documentation improvements

Confidence score: 4.5/5

  1. This PR is very safe to merge as it consists of TypeScript improvements and code quality enhancements
  2. High confidence due to the nature of changes being primarily type-related and following established best practices
  3. Files needing attention: apps/web/core/components/tasks/multiple-status-dropdown.tsx - verify the type changes don't impact existing functionality

6 files reviewed, no comments
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
apps/web/core/hooks/common/use-pagination.ts (1)

65-66: Prefer moving SCROLL_THRESHOLD outside the hook or exposing it as a prop

Declaring the constant inside the hook causes it to be (re)allocated on every render. It’s a trivial cost here, but hoisting it to module scope (or allowing callers to override it via a hook parameter) avoids the extra work and makes unit testing / tweaking easier.

-	const SCROLL_THRESHOLD = 100;
+export const SCROLL_THRESHOLD = 100; // or accept as an argument with a sensible default
apps/web/core/components/pages/timesheet/timesheet-view.tsx (1)

29-36: Condition can be simplified

loading !== undefined && loading === false can be reduced to loading === false – the strict equality already guarantees the value is defined.

-	if (loading !== undefined && loading === false && data.length === 0) {
+	if (loading === false && data.length === 0) {
apps/web/core/components/tasks/task-sizes-dropdown.tsx (1)

23-25: Redundant cast – can likely be removed

You removed similar casts in the hooks, but this component still forces taskSizes as TTaskStatus[]. Unless taskSizes is typed differently here, the cast may hide real type mismatches.

-	const taskSizesValue = useMapToTaskStatusValues(taskSizes as TTaskStatus[], false);
+	const taskSizesValue = useMapToTaskStatusValues(taskSizes, false);

If useTaskSizes() already returns the correct shape, this keeps typing strict and consistent.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 75054a5 and 68f07f0.

📒 Files selected for processing (6)
  • apps/web/core/components/pages/timesheet/timesheet-view.tsx (1 hunks)
  • apps/web/core/components/tasks/multiple-status-dropdown.tsx (2 hunks)
  • apps/web/core/components/tasks/task-sizes-dropdown.tsx (1 hunks)
  • apps/web/core/hooks/common/use-pagination.ts (2 hunks)
  • apps/web/core/hooks/tasks/use-task-priorities-value.ts (1 hunks)
  • apps/web/core/hooks/tasks/use-task-sizes-value.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (7)
📓 Common learnings
Learnt from: NdekoCode
PR: ever-co/ever-teams#3189
File: apps/web/components/ui/sidebar.tsx:77-87
Timestamp: 2024-10-25T15:15:45.111Z
Learning: In `apps/web/components/ui/sidebar.tsx`, modifications to the keyboard shortcut implementation within `React.useEffect` can cause build errors. The current implementation has been validated by shadcn-ui and should remain unchanged.
Learnt from: CREDO23
PR: ever-co/ever-teams#3360
File: apps/web/components/pages/task/details-section/blocks/task-secondary-info.tsx:346-354
Timestamp: 2024-11-25T18:49:15.126Z
Learning: In `apps/web/components/pages/task/details-section/blocks/task-secondary-info.tsx`, within the `ProjectDropDown` component, both parent and child state should be synchronized for better UI updates, even in controlled mode. The `onChange` function carries the parent state, and `setSelected` maintains the selected state in the child component.
Learnt from: CREDO23
PR: ever-co/ever-teams#3353
File: apps/web/lib/features/task/task-input.tsx:812-815
Timestamp: 2024-11-20T19:56:12.313Z
Learning: In `apps/web/lib/features/task/task-input.tsx`, prefer using `useRef` over `useState` for `assignees` in the `AssigneesSelect` component to prevent re-renders on change.
Learnt from: NdekoCode
PR: ever-co/ever-teams#3189
File: apps/web/components/ui/sidebar.tsx:14-19
Timestamp: 2024-10-25T15:16:53.869Z
Learning: In `apps/web/components/ui/sidebar.tsx`, cookie configuration enhancements including `secure` and `httpOnly` flags, and making cookie name and max age configurable via environment variables, have already been implemented in previous commits.
Learnt from: NdekoCode
PR: ever-co/ever-teams#3887
File: apps/web/core/query/keys/index.ts:41-58
Timestamp: 2025-06-07T04:31:16.865Z
Learning: The team uses a progressive migration approach for React Query implementation, where query key infrastructure is added first before implementing the hooks/services that use them. This results in intentionally unused code during intermediate migration states.
Learnt from: NdekoCode
PR: ever-co/ever-teams#3189
File: apps/web/components/ui/sidebar.tsx:77-87
Timestamp: 2024-10-25T15:15:35.107Z
Learning: In `apps/web/components/ui/sidebar.tsx`, keyboard shortcut accessibility has already been reviewed and approved by shadcn-ui; further suggestions in this area are unnecessary.
Learnt from: CREDO23
PR: ever-co/ever-teams#3626
File: apps/web/app/[locale]/projects/components/page-component.tsx:119-119
Timestamp: 2025-02-28T09:17:46.802Z
Learning: In the projects page component, filtering of projects based on the active team has been moved out of the useEffect hook that fetches organization projects, and is now handled in the pagination logic instead.
apps/web/core/hooks/tasks/use-task-sizes-value.ts (5)
Learnt from: CREDO23
PR: ever-co/ever-teams#3353
File: apps/web/lib/features/task/task-input.tsx:812-815
Timestamp: 2024-11-20T19:56:12.313Z
Learning: In `apps/web/lib/features/task/task-input.tsx`, prefer using `useRef` over `useState` for `assignees` in the `AssigneesSelect` component to prevent re-renders on change.
Learnt from: NdekoCode
PR: ever-co/ever-teams#3234
File: apps/web/components/pages/team/tasks/TaskTable.tsx:9-13
Timestamp: 2024-11-06T17:10:06.239Z
Learning: In the `TaskTable` component (`apps/web/components/pages/team/tasks/TaskTable.tsx`), we do not need to add error handling for task fetching when using `useTeamTasks()`.
Learnt from: NdekoCode
PR: ever-co/ever-teams#3199
File: apps/web/app/stores/team-tasks.ts:39-40
Timestamp: 2024-10-28T17:23:01.110Z
Learning: The `favoriteTasksAtom` in `apps/web/app/stores/team-tasks.ts` is important for future implementations and should not be removed, even if it appears unused currently.
Learnt from: CREDO23
PR: ever-co/ever-teams#3353
File: apps/web/components/pages/kanban/menu-kanban-card.tsx:85-85
Timestamp: 2024-11-20T19:57:48.324Z
Learning: We are gradually migrating from 'taskName' to 'title' as we make changes to the remaining files.
Learnt from: syns2191
PR: ever-co/ever-teams#3409
File: .scripts/electron-desktop-environment/concrete-environment-content/desktop-server-web-environment-content.ts:21-22
Timestamp: 2024-12-11T01:37:45.660Z
Learning: When adding `TERM_OF_SERVICE` and `PRIVACY_POLICY` in `DesktopServerWebEnvironmentContent` in `.scripts/electron-desktop-environment/concrete-environment-content/desktop-server-web-environment-content.ts`, fallback values using the `||` operator are not necessary.
apps/web/core/components/pages/timesheet/timesheet-view.tsx (8)
Learnt from: CREDO23
PR: ever-co/ever-teams#3360
File: apps/web/components/pages/task/details-section/blocks/task-secondary-info.tsx:346-354
Timestamp: 2024-11-25T18:49:15.126Z
Learning: In `apps/web/components/pages/task/details-section/blocks/task-secondary-info.tsx`, within the `ProjectDropDown` component, both parent and child state should be synchronized for better UI updates, even in controlled mode. The `onChange` function carries the parent state, and `setSelected` maintains the selected state in the child component.
Learnt from: NdekoCode
PR: ever-co/ever-teams#3189
File: apps/web/components/ui/sidebar.tsx:77-87
Timestamp: 2024-10-25T15:15:45.111Z
Learning: In `apps/web/components/ui/sidebar.tsx`, modifications to the keyboard shortcut implementation within `React.useEffect` can cause build errors. The current implementation has been validated by shadcn-ui and should remain unchanged.
Learnt from: CREDO23
PR: ever-co/ever-teams#3353
File: apps/web/lib/features/task/task-input.tsx:812-815
Timestamp: 2024-11-20T19:56:12.313Z
Learning: In `apps/web/lib/features/task/task-input.tsx`, prefer using `useRef` over `useState` for `assignees` in the `AssigneesSelect` component to prevent re-renders on change.
Learnt from: Innocent-Akim
PR: ever-co/ever-teams#3208
File: apps/web/app/[locale]/timesheet/components/TimesheetFilter.tsx:30-35
Timestamp: 2024-10-30T16:31:01.294Z
Learning: In the `TimesheetFilter` component, the `Add Time` button does not need to use the `AddManualTimeModal` component, as per the user's decision.
Learnt from: NdekoCode
PR: ever-co/ever-teams#3234
File: apps/web/components/pages/team/tasks/TaskTable.tsx:9-13
Timestamp: 2024-11-06T17:10:06.239Z
Learning: In the `TaskTable` component (`apps/web/components/pages/team/tasks/TaskTable.tsx`), we do not need to add error handling for task fetching when using `useTeamTasks()`.
Learnt from: CREDO23
PR: ever-co/ever-teams#3626
File: apps/web/app/[locale]/projects/components/page-component.tsx:119-119
Timestamp: 2025-02-28T09:17:46.802Z
Learning: In the projects page component, filtering of projects based on the active team has been moved out of the useEffect hook that fetches organization projects, and is now handled in the pagination logic instead.
Learnt from: NdekoCode
PR: ever-co/ever-teams#3199
File: apps/web/components/app-sidebar.tsx:49-55
Timestamp: 2024-10-28T17:16:03.609Z
Learning: In `apps/web/components/app-sidebar.tsx`, hardcoded sample user data is intentionally included and should not be removed.
Learnt from: NdekoCode
PR: ever-co/ever-teams#3189
File: apps/web/components/ui/sidebar.tsx:77-87
Timestamp: 2024-10-25T15:15:35.107Z
Learning: In `apps/web/components/ui/sidebar.tsx`, keyboard shortcut accessibility has already been reviewed and approved by shadcn-ui; further suggestions in this area are unnecessary.
apps/web/core/hooks/tasks/use-task-priorities-value.ts (6)
Learnt from: CREDO23
PR: ever-co/ever-teams#3353
File: apps/web/lib/features/task/task-input.tsx:812-815
Timestamp: 2024-11-20T19:56:12.313Z
Learning: In `apps/web/lib/features/task/task-input.tsx`, prefer using `useRef` over `useState` for `assignees` in the `AssigneesSelect` component to prevent re-renders on change.
Learnt from: NdekoCode
PR: ever-co/ever-teams#3199
File: apps/web/app/stores/team-tasks.ts:39-40
Timestamp: 2024-10-28T17:23:01.110Z
Learning: The `favoriteTasksAtom` in `apps/web/app/stores/team-tasks.ts` is important for future implementations and should not be removed, even if it appears unused currently.
Learnt from: NdekoCode
PR: ever-co/ever-teams#3234
File: apps/web/components/pages/team/tasks/TaskTable.tsx:9-13
Timestamp: 2024-11-06T17:10:06.239Z
Learning: In the `TaskTable` component (`apps/web/components/pages/team/tasks/TaskTable.tsx`), we do not need to add error handling for task fetching when using `useTeamTasks()`.
Learnt from: NdekoCode
PR: ever-co/ever-teams#3199
File: apps/web/app/stores/team-tasks.ts:29-29
Timestamp: 2024-10-28T17:22:19.947Z
Learning: In `apps/web/app/stores/team-tasks.ts`, tasks should be sorted alphabetically, not by `createdAt` date.
Learnt from: CREDO23
PR: ever-co/ever-teams#3353
File: apps/web/components/pages/kanban/menu-kanban-card.tsx:85-85
Timestamp: 2024-11-20T19:57:48.324Z
Learning: We are gradually migrating from 'taskName' to 'title' as we make changes to the remaining files.
Learnt from: syns2191
PR: ever-co/ever-teams#3409
File: .scripts/electron-desktop-environment/concrete-environment-content/desktop-server-web-environment-content.ts:21-22
Timestamp: 2024-12-11T01:37:45.660Z
Learning: When adding `TERM_OF_SERVICE` and `PRIVACY_POLICY` in `DesktopServerWebEnvironmentContent` in `.scripts/electron-desktop-environment/concrete-environment-content/desktop-server-web-environment-content.ts`, fallback values using the `||` operator are not necessary.
apps/web/core/hooks/common/use-pagination.ts (2)
Learnt from: CREDO23
PR: ever-co/ever-teams#3626
File: apps/web/app/[locale]/projects/components/page-component.tsx:119-119
Timestamp: 2025-02-28T09:17:46.802Z
Learning: In the projects page component, filtering of projects based on the active team has been moved out of the useEffect hook that fetches organization projects, and is now handled in the pagination logic instead.
Learnt from: NdekoCode
PR: ever-co/ever-teams#3189
File: apps/web/components/ui/sidebar.tsx:77-87
Timestamp: 2024-10-25T15:15:45.111Z
Learning: In `apps/web/components/ui/sidebar.tsx`, modifications to the keyboard shortcut implementation within `React.useEffect` can cause build errors. The current implementation has been validated by shadcn-ui and should remain unchanged.
apps/web/core/components/tasks/task-sizes-dropdown.tsx (6)
Learnt from: CREDO23
PR: ever-co/ever-teams#3360
File: apps/web/components/pages/task/details-section/blocks/task-secondary-info.tsx:346-354
Timestamp: 2024-11-25T18:49:15.126Z
Learning: In `apps/web/components/pages/task/details-section/blocks/task-secondary-info.tsx`, within the `ProjectDropDown` component, both parent and child state should be synchronized for better UI updates, even in controlled mode. The `onChange` function carries the parent state, and `setSelected` maintains the selected state in the child component.
Learnt from: CREDO23
PR: ever-co/ever-teams#3353
File: apps/web/lib/features/task/task-input.tsx:812-815
Timestamp: 2024-11-20T19:56:12.313Z
Learning: In `apps/web/lib/features/task/task-input.tsx`, prefer using `useRef` over `useState` for `assignees` in the `AssigneesSelect` component to prevent re-renders on change.
Learnt from: NdekoCode
PR: ever-co/ever-teams#3189
File: apps/web/components/ui/sidebar.tsx:77-87
Timestamp: 2024-10-25T15:15:45.111Z
Learning: In `apps/web/components/ui/sidebar.tsx`, modifications to the keyboard shortcut implementation within `React.useEffect` can cause build errors. The current implementation has been validated by shadcn-ui and should remain unchanged.
Learnt from: NdekoCode
PR: ever-co/ever-teams#3189
File: apps/web/components/ui/sidebar.tsx:77-87
Timestamp: 2024-10-25T15:15:35.107Z
Learning: In `apps/web/components/ui/sidebar.tsx`, keyboard shortcut accessibility has already been reviewed and approved by shadcn-ui; further suggestions in this area are unnecessary.
Learnt from: CREDO23
PR: ever-co/ever-teams#3353
File: apps/web/components/pages/kanban/menu-kanban-card.tsx:85-85
Timestamp: 2024-11-20T19:57:48.324Z
Learning: We are gradually migrating from 'taskName' to 'title' as we make changes to the remaining files.
Learnt from: NdekoCode
PR: ever-co/ever-teams#3234
File: apps/web/components/pages/team/tasks/TaskTable.tsx:9-13
Timestamp: 2024-11-06T17:10:06.239Z
Learning: In the `TaskTable` component (`apps/web/components/pages/team/tasks/TaskTable.tsx`), we do not need to add error handling for task fetching when using `useTeamTasks()`.
apps/web/core/components/tasks/multiple-status-dropdown.tsx (8)
Learnt from: CREDO23
PR: ever-co/ever-teams#3360
File: apps/web/components/pages/task/details-section/blocks/task-secondary-info.tsx:346-354
Timestamp: 2024-11-25T18:49:15.126Z
Learning: In `apps/web/components/pages/task/details-section/blocks/task-secondary-info.tsx`, within the `ProjectDropDown` component, both parent and child state should be synchronized for better UI updates, even in controlled mode. The `onChange` function carries the parent state, and `setSelected` maintains the selected state in the child component.
Learnt from: CREDO23
PR: ever-co/ever-teams#3353
File: apps/web/lib/features/task/task-input.tsx:812-815
Timestamp: 2024-11-20T19:56:12.313Z
Learning: In `apps/web/lib/features/task/task-input.tsx`, prefer using `useRef` over `useState` for `assignees` in the `AssigneesSelect` component to prevent re-renders on change.
Learnt from: NdekoCode
PR: ever-co/ever-teams#3189
File: apps/web/components/ui/sidebar.tsx:77-87
Timestamp: 2024-10-25T15:15:45.111Z
Learning: In `apps/web/components/ui/sidebar.tsx`, modifications to the keyboard shortcut implementation within `React.useEffect` can cause build errors. The current implementation has been validated by shadcn-ui and should remain unchanged.
Learnt from: NdekoCode
PR: ever-co/ever-teams#3189
File: apps/web/components/ui/sidebar.tsx:77-87
Timestamp: 2024-10-25T15:15:35.107Z
Learning: In `apps/web/components/ui/sidebar.tsx`, keyboard shortcut accessibility has already been reviewed and approved by shadcn-ui; further suggestions in this area are unnecessary.
Learnt from: CREDO23
PR: ever-co/ever-teams#3392
File: apps/web/app/[locale]/reports/weekly-limit/components/group-by-select.tsx:42-51
Timestamp: 2024-12-05T09:04:08.049Z
Learning: In the `GroupBySelect` component (`apps/web/app/[locale]/reports/weekly-limit/components/group-by-select.tsx`), only one option can be selected at a time; two options cannot be selected simultaneously.
Learnt from: CREDO23
PR: ever-co/ever-teams#3185
File: apps/web/lib/settings/task-statuses-form.tsx:187-199
Timestamp: 2024-11-07T14:04:24.336Z
Learning: In `apps/web/lib/settings/task-statuses-form.tsx`, when generating colors in the `getRandomColor` function, prefer to keep generating them randomly to have more than five colors, even if it might affect color accessibility.
Learnt from: NdekoCode
PR: ever-co/ever-teams#3199
File: apps/web/app/stores/team-tasks.ts:39-40
Timestamp: 2024-10-28T17:23:01.110Z
Learning: The `favoriteTasksAtom` in `apps/web/app/stores/team-tasks.ts` is important for future implementations and should not be removed, even if it appears unused currently.
Learnt from: NdekoCode
PR: ever-co/ever-teams#3189
File: apps/web/components/ui/sidebar.tsx:14-19
Timestamp: 2024-10-25T15:16:53.869Z
Learning: In `apps/web/components/ui/sidebar.tsx`, cookie configuration enhancements including `secure` and `httpOnly` flags, and making cookie name and max age configurable via environment variables, have already been implemented in previous commits.
🧬 Code Graph Analysis (1)
apps/web/core/hooks/tasks/use-task-sizes-value.ts (2)
apps/web/core/hooks/tasks/use-map-to-task-status-values.tsx (1)
  • useMapToTaskStatusValues (9-36)
apps/web/core/components/tasks/task-default-status.tsx (1)
  • taskSizes (103-129)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: deploy
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (6)
apps/web/core/hooks/common/use-pagination.ts (1)

80-82: 👍 Magic number removal looks good

Replacing the hard-coded 100 with a named constant improves readability.

apps/web/core/hooks/tasks/use-task-priorities-value.ts (1)

5-7: Cast removal is the right move

taskPriorities already satisfies the TTaskStatus constraint expected by useMapToTaskStatusValues, so the explicit cast was redundant. Good clean-up.

apps/web/core/hooks/tasks/use-task-sizes-value.ts (1)

5-7: Consistent with priorities hook – LGTM

Same rationale: the cast was unnecessary and its removal keeps the API surface cleaner.

apps/web/core/components/tasks/task-sizes-dropdown.tsx (1)

8-11: Updated JSDoc matches the actual prop type

The new annotation is accurate and helpful. 👍

apps/web/core/components/tasks/multiple-status-dropdown.tsx (2)

135-135: Good type safety improvement!

Removing the explicit any type annotation allows TypeScript to infer the correct React.MouseEvent<HTMLButtonElement> type, which is more type-safe while maintaining the same functionality.


154-154: Excellent type refinement!

The union type string[] | string accurately reflects the function's actual usage patterns and is much more type-safe than the previous any type. This makes the code more self-documenting and aligns perfectly with the function's logic that handles both array and single string inputs.

@CREDO23 CREDO23 requested a review from NdekoCode July 18, 2025 15:24
@NdekoCode NdekoCode requested a review from evereq July 19, 2025 11:24
@@ -62,6 +62,8 @@ export function useScrollPagination<T>({

$scrollableElement.current = scrollableElement || $scrollableElement.current;

const SCROLL_THRESHOLD = 100;
Copy link
Collaborator

Choose a reason for hiding this comment

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

@CREDO23 Preferable moving SCROLL_THRESHOLD outside the hook or exposing it as a prop, we usually store shared constants in apps/web/core/constants, so I recommend moving SCROLL_THRESHOLD there instead of exporting it directly from the hook file.

Alternatively, exposing it as a hook parameter with a default value is fine if flexibility is needed.

@@ -26,7 +26,7 @@ export function TimesheetView({
);
}

if (loading !== undefined && loading == false && data.length === 0) {
if (loading !== undefined && loading === false && data.length === 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

@CREDO23, loading !== undefined && loading === false is redundant.
We can simplify it to loading === false, since false is already strictly defined, so we can have if (loading === false && data.length === 0)

@@ -7,8 +7,7 @@ import { StatusDropdown } from './task-status';

/**
* Task dropdown that lets you select a task size
* @param {IClassName} - IClassName - This is the interface that the component will accept.
* @returns A React component
* @param {TTaskStatusesDropdown<'size'>} props - Props for the task sizes dropdown component
*/
export function TaskSizesDropdown({
Copy link
Collaborator

Choose a reason for hiding this comment

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

@CREDO23, On line 24, const taskSizesValue = useMapToTaskStatusValues(taskSizes as TTaskStatus[], false);, the cast taskSizes as TTaskStatus[] is likely unnecessary if useTaskSizes() already returns the correct type.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also @CREDO23 , this branch ETP-42-review-apply-relevant-ai-suggestions-from-pr-3938 is currently not up to date with develop
Since we follow git-flow, let's sync with develop before merging to avoid conflicts and ensure all recent changes are considered in this branch too.

@evereq evereq merged commit 9c6dcc4 into develop Jul 19, 2025
15 of 16 checks passed
@evereq evereq deleted the ETP-42-review-apply-relevant-ai-suggestions-from-pr-3938 branch July 19, 2025 18:46
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.

3 participants