Skip to content

Conversation

@vamsikrishnamathala
Copy link
Member

@vamsikrishnamathala vamsikrishnamathala commented Dec 24, 2025

Description

This update fixes the inconsistent icon size for favorties header.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Improvement (change that would cause existing functionality to not work as expected)
  • Code refactoring
  • Performance improvements
  • Documentation update

Screenshots and Media (if applicable)

Test Scenarios

References

Summary by CodeRabbit

  • Bug Fixes

    • Fixed an issue where folder creation and renaming actions could execute multiple times after successful completion.
  • Style

    • Updated button styling for creating a new favorites folder.
    • Refined icon sizing for improved visual consistency.

✏️ Tip: You can customize this high-level summary in your review settings.

@vamsikrishnamathala vamsikrishnamathala self-assigned this Dec 24, 2025
@vamsikrishnamathala vamsikrishnamathala added the 🐛bug Something isn't working label Dec 24, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 24, 2025

📝 Walkthrough

Walkthrough

Two sidebar component files updated with UI refinements and control-flow improvements: replaced button with IconButton for folder creation, added early returns after success toasts in promise handlers, and adjusted icon sizing using Tailwind utility classes. Imports were cleaned up and empty comment blocks removed.

Changes

Cohort / File(s) Summary
Favorites Sidebar Components
apps/web/core/components/workspace/sidebar/favorites/favorites-menu.tsx, apps/web/core/components/workspace/sidebar/favorites/new-fav-folder.tsx
UI refinement: replaced button with IconButton (variant="ghost", size="sm"); early returns added after success toasts in handleRemoveFromFavorites, handleAddNewFolder, and handleRenameFolder to prevent further chain execution; icon size class updated from w-[16px] to size-4; import cleanup (removed default React import) and formatting adjustments.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A folder's new garb, with buttons redrawn,
Early returns now whisper: "our work here is done!"
Sized up with grace, these tiny tweaks shine—
Favorites organized, in neat rows they align! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The description is incomplete; it lacks test scenarios, screenshots, and any reference to related issues despite having placeholder sections. Add test scenarios describing how you verified the icon size fix and consider adding before/after screenshots to validate the visual change.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change—fixing an icon size issue in the favorites component.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/favorites-icon-size

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@makeplane
Copy link

makeplane bot commented Dec 24, 2025

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
apps/web/core/components/workspace/sidebar/favorites/new-fav-folder.tsx (2)

68-86: State reset executes before async operation completes.

Lines 84-85 execute synchronously immediately after setting up the promise chain, not after the API call completes. This means the form is reset (setCreateNewFolder(false), setValue("name", "")) before addFavorite finishes, which could lead to:

  • Form closing while the API request is still in flight
  • User unable to see loading state
  • Potential issues if user interacts with UI before completion

These state updates should be moved inside the .then() block to execute only after successful completion.

🔎 Proposed fix
 addFavorite(workspaceSlug.toString(), formData)
   .then(() => {
     setToast({
       type: TOAST_TYPE.SUCCESS,
       title: t("success"),
       message: t("favorite_created_successfully"),
     });
-    return;
+    setCreateNewFolder(false);
+    setValue("name", "");
   })
   .catch(() => {
     setToast({
       type: TOAST_TYPE.ERROR,
       title: t("error"),
       message: t("something_went_wrong"),
     });
   });
-setCreateNewFolder(false);
-setValue("name", "");

107-125: Same issue: state reset executes before async operation completes.

Lines 123-124 reset the form state synchronously, before updateFavorite completes. Move these inside the .then() block for proper async flow.

🔎 Proposed fix
 updateFavorite(workspaceSlug.toString(), favoriteId, payload)
   .then(() => {
     setToast({
       type: TOAST_TYPE.SUCCESS,
       title: t("success"),
       message: t("favorite_updated_successfully"),
     });
-    return;
+    setCreateNewFolder(false);
+    setValue("name", "");
   })
   .catch(() => {
     setToast({
       type: TOAST_TYPE.ERROR,
       title: t("error"),
       message: t("something_went_wrong"),
     });
   });
-setCreateNewFolder(false);
-setValue("name", "");
🧹 Nitpick comments (1)
apps/web/core/components/workspace/sidebar/favorites/favorites-menu.tsx (1)

113-113: Optional: explicit return has no behavioral effect.

The return; statement after the success toast doesn't change behavior since there's no code following it in the .then() block. While it may clarify intent to exit early, it's functionally redundant.

Consider removing if preferred
 deleteFavorite(workspaceSlug.toString(), favorite.id)
   .then(() => {
     setToast({
       type: TOAST_TYPE.SUCCESS,
       title: t("success"),
       message: t("favorite_removed_successfully"),
     });
-    return;
   })
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 777200d and 5cc9bfe.

📒 Files selected for processing (2)
  • apps/web/core/components/workspace/sidebar/favorites/favorites-menu.tsx
  • apps/web/core/components/workspace/sidebar/favorites/new-fav-folder.tsx
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx,mts,cts}

📄 CodeRabbit inference engine (.github/instructions/typescript.instructions.md)

**/*.{ts,tsx,mts,cts}: Use const type parameters for more precise literal inference in TypeScript 5.0+
Use the satisfies operator to validate types without widening them
Leverage inferred type predicates to reduce the need for explicit is return types in filter/check functions
Use NoInfer<T> utility to block inference for specific type arguments when they should be determined by other arguments
Utilize narrowing in switch(true) blocks for control flow analysis (TypeScript 5.3+)
Rely on narrowing from direct boolean comparisons for type guards
Trust preserved narrowing in closures when variables aren't modified after the check (TypeScript 5.4+)
Use constant indices to narrow object/array properties (TypeScript 5.5+)
Use standard ECMAScript decorators (Stage 3) instead of legacy experimentalDecorators
Use using declarations for explicit resource management with Disposable pattern instead of manual cleanup (TypeScript 5.2+)
Use with { type: "json" } for import attributes; avoid deprecated assert syntax (TypeScript 5.3/5.8+)
Use import type explicitly when importing types to ensure they are erased during compilation, respecting verbatimModuleSyntax flag
Use .ts, .mts, .cts extensions in import type statements (TypeScript 5.2+)
Use import type { Type } from "mod" with { "resolution-mode": "import" } for specific module resolution contexts (TypeScript 5.3+)
Use new iterator methods (map, filter, etc.) if targeting modern environments (TypeScript 5.6+)
Utilize new Set methods like union, intersection, etc., when available (TypeScript 5.5+)
Use Object.groupBy / Map.groupBy standard methods for grouping instead of external libraries (TypeScript 5.4+)
Use Promise.withResolvers() for creating promises with exposed resolve/reject functions (TypeScript 5.7+)
Use copying array methods (toSorted, toSpliced, with) for immutable array operations (TypeScript 5.2+)
Avoid accessing instance fields via super in classes (TypeScript 5....

Files:

  • apps/web/core/components/workspace/sidebar/favorites/new-fav-folder.tsx
  • apps/web/core/components/workspace/sidebar/favorites/favorites-menu.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Enable TypeScript strict mode and ensure all files are fully typed

Files:

  • apps/web/core/components/workspace/sidebar/favorites/new-fav-folder.tsx
  • apps/web/core/components/workspace/sidebar/favorites/favorites-menu.tsx
**/*.{js,jsx,ts,tsx,json,css}

📄 CodeRabbit inference engine (AGENTS.md)

Use Prettier with Tailwind plugin for code formatting, run pnpm fix:format

Files:

  • apps/web/core/components/workspace/sidebar/favorites/new-fav-folder.tsx
  • apps/web/core/components/workspace/sidebar/favorites/favorites-menu.tsx
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{js,jsx,ts,tsx}: Use ESLint with shared config across packages, adhering to max warnings limits per package
Use camelCase for variable and function names, PascalCase for components and types
Use try-catch with proper error types and log errors appropriately

Files:

  • apps/web/core/components/workspace/sidebar/favorites/new-fav-folder.tsx
  • apps/web/core/components/workspace/sidebar/favorites/favorites-menu.tsx
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
Repo: makeplane/plane PR: 0
File: packages/tailwind-config/AGENTS.md:0-0
Timestamp: 2025-12-17T10:58:59.591Z
Learning: Applies to packages/tailwind-config/**/*.{ts,tsx} : Sidebar menu items should use transparent backgrounds with hover states like `hover:bg-layer-1-hover` rather than base layer backgrounds, maintaining visual lightness while providing hover feedback
📚 Learning: 2025-12-17T10:58:59.591Z
Learnt from: CR
Repo: makeplane/plane PR: 0
File: packages/tailwind-config/AGENTS.md:0-0
Timestamp: 2025-12-17T10:58:59.591Z
Learning: Applies to packages/tailwind-config/**/*.{ts,tsx} : Sidebar menu items should use transparent backgrounds with hover states like `hover:bg-layer-1-hover` rather than base layer backgrounds, maintaining visual lightness while providing hover feedback

Applied to files:

  • apps/web/core/components/workspace/sidebar/favorites/favorites-menu.tsx
📚 Learning: 2025-10-09T20:42:31.843Z
Learnt from: lifeiscontent
Repo: makeplane/plane PR: 7922
File: apps/admin/app/(all)/(dashboard)/ai/form.tsx:19-19
Timestamp: 2025-10-09T20:42:31.843Z
Learning: In the makeplane/plane repository, React types are globally available through TypeScript configuration. Type annotations like React.FC, React.ReactNode, etc. can be used without explicitly importing the React namespace. The codebase uses the modern JSX transform, so React imports are not required for JSX or type references.

Applied to files:

  • apps/web/core/components/workspace/sidebar/favorites/favorites-menu.tsx
⏰ 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). (2)
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Build packages
🔇 Additional comments (3)
apps/web/core/components/workspace/sidebar/favorites/new-fav-folder.tsx (1)

136-136: LGTM! Icon sizing fix addresses the PR objective.

Changing from w-[16px] (width-only) to size-4 (width + height) ensures the icon renders as a proper 16×16px square, which fixes the inconsistent icon size issue mentioned in the PR.

apps/web/core/components/workspace/sidebar/favorites/favorites-menu.tsx (2)

1-1: LGTM! Correct removal of unused React import.

With the modern JSX transform and globally available React types, the default React import is unnecessary.


204-213: LGTM! IconButton provides better semantics for icon-only action.

The refactor from Button to IconButton with appropriate variant="ghost" and size="sm" props improves UI consistency and semantics for the folder creation action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants