Skip to content

Conversation

@prateekshourya29
Copy link
Member

@prateekshourya29 prateekshourya29 commented Nov 13, 2025

Description

Type of Change

  • Code refactoring

Summary by CodeRabbit

  • Bug Fixes

    • Improved drag-and-drop visuals and state handling
    • Standardized navigation progress behavior
    • Removed legacy OAuth post-installation flow
  • Refactor

    • Unified router imports and navigation-related typings
    • Tightened component and store typings to accept optional identifiers
  • Chores

    • Added CI type-check step
    • Updated formatter/linter ignore patterns and Storybook story args
    • Adjusted attachment icon rendering to rely on intrinsic sizing (visual tweak)

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 13, 2025

Walkthrough

Adds a CI type-check step, updates ESLint/Prettier ignore lists, deletes installation OAuth layout/page, migrates some router/type imports, relaxes projectId parameter types, removes explicit navigation progress flags, enhances drag-and-drop behavior and imports, and updates Storybook stories and a spinner interface export.

Changes

Cohort / File(s) Change Summary
Workflow CI/CD
​.github/workflows/pull-request-build-lint-web-apps.yml
Adds a "Check Affected types" step running pnpm turbo run check:types --affected after the format check.
ESLint / Prettier ignores
apps/admin/.eslintignore, apps/space/.eslintignore, apps/admin/.prettierignore, apps/space/.prettierignore
Added .react-router/* and .vite/* ignore entries (and .react-router / .vite for Prettier).
Installation pages removed
apps/web/app/(all)/installations/[provider]/layout.tsx, apps/web/app/(all)/installations/[provider]/page.tsx
Deleted InstallationProviderLayout and AppPostInstallation page (removed OAuth callback handling and related UI).
Router / type import migrations
apps/web/ce/components/command-palette/power-k/context-detector.ts, apps/web/core/components/power-k/core/context-detector.ts, apps/web/core/components/power-k/core/types.ts
Switched Params import to react-router; replaced AppRouterProgressInstance import with useRouter and updated TPowerKContext.router to ReturnType<typeof useRouter>.
Permission store optional params
apps/web/ce/store/user/permission.store.ts, apps/web/core/store/user/base-permissions.store.ts
Made projectId optional in getProjectRoleByWorkspaceSlugAndProjectId and getProjectRole signatures and propagated optionality.
Removed explicit navigation progress flags
apps/web/core/components/cycles/cycle-peek-overview.tsx, apps/web/core/components/cycles/list/cycle-list-item-action.tsx, apps/web/core/components/cycles/list/cycles-list-item.tsx, apps/web/core/components/project/card.tsx
Removed showProgress: false option from router.push calls so navigation uses default progress behavior.
Drag-and-drop enhancements
packages/ui/src/sortable/draggable.tsx, packages/ui/src/sortable/sortable.tsx
Updated pragmatic-drag-and-drop imports; added dragging and isDraggedOver state, lifecycle handlers (onDragStart/onDragEnter/onDragLeave/onDrop), closest-edge attach logic, UUID-based canDrop checks, and DropIndicator visuals; simplified monitor import path.
Storybook / stories changes
packages/propel/src/calendar/calendar.stories.tsx, packages/propel/src/emoji-icon-picker/emoji-picker.stories.tsx
Calendar: changed Uncontrolled story render signature and removed spreading args. Emoji picker: added args objects (isOpen, handleToggle, onChange, label) to multiple exported stories.
Spinner interface export
packages/propel/src/spinners/circular-bar-spinner.tsx
Made ICircularBarSpinner exported (export interface ...).
Typed component signature change
apps/web/ce/components/cycles/analytics-sidebar/base.tsx
Replaced FC<...> export annotation with a typed function props: ProgressChartProps wrapped by observer.
Project wrapper id handling
apps/web/core/layouts/auth-layout/project-wrapper.tsx
Removed .toString() coercions; now passes workspaceSlug and projectId directly in lookups, SWR keys, and permission checks.
Attachment icon presentational change
apps/web/core/components/icons/attachment/*.tsx
Removed className="h-full w-full object-contain" from many attachment icon <img> elements; images now rely on width/height attrs only (multiple files under that directory).

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Draggable as Draggable Component
    participant Monitor as ClosestEdge Monitor
    participant Indicator as DropIndicator

    User->>Draggable: dragStart()
    Draggable->>Draggable: set dragging = true
    User->>Draggable: dragEnter(data)
    Draggable->>Monitor: attachClosestEdge(data, allowedEdges:[top,bottom])
    Monitor-->>Draggable: closestEdge
    Draggable->>Draggable: set isDraggedOver = true, record closestEdge
    Draggable->>Indicator: show at closestEdge
    User->>Draggable: dragLeave()
    Draggable->>Draggable: set isDraggedOver = false
    Draggable->>Indicator: hide
    User->>Draggable: drop(payload)
    alt payload.__uuid__ matches and source ≠ target
        Draggable->>Draggable: accept drop -> process reorder
    else
        Draggable->>Draggable: reject drop
    end
    Draggable->>Draggable: set dragging = false, isDraggedOver = false
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Areas needing extra attention:
    • Confirm removal of installation layout/page does not leave unused routes or OAuth handlers.
    • Verify router/type import swaps (react-router vs Next types) don't break runtime or typing expectations.
    • Ensure callers handle optional projectId safely (guards and SWR keys).
    • Review draggable canDrop/getData logic (UUID checks, closestEdge behavior) and visual indicator correctness.
    • Validate Storybook args changes match story render signatures.

Possibly related PRs

Poem

🐰 I hopped through types and linting lines,
Removed a page where OAuth signs,
Edges now point where drops should land,
Stories gained args at my gentle hand,
CI checks hum — carrot in my paw. 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description is incomplete, containing only the template header and a single checked box for 'Code refactoring' without any detailed information about the changes, rationale, or implementation details. Provide a comprehensive description including what TypeScript errors were fixed, why the types check step was added, and any relevant implementation details or testing performed.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly describes the main changes: fixing TypeScript errors and adding a types check step to the workflow, which aligns with the changeset.
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-type-error

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 Nov 13, 2025

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

@prateekshourya29 prateekshourya29 changed the title [WEB-5423] fix: typescript errors [WEB-5423] fix: typescript errors and add types check step to pull request workflow Nov 13, 2025
@prateekshourya29 prateekshourya29 marked this pull request as ready for review November 13, 2025 14:11
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: 1

Caution

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

⚠️ Outside diff range comments (3)
packages/propel/src/emoji-icon-picker/emoji-picker.stories.tsx (1)

20-384: Remove unused args from all stories.

Every story defines an args object with isOpen, handleToggle, onChange, and label, but none of these are referenced in the render() functions. Each render function creates its own local state via useState and passes those local values to the EmojiPicker component instead.

In Storybook, args are meant to control story behavior, but here they serve no purpose and are dead code that could mislead developers.

Apply this diff to remove the unused args from all stories:

 export const Default: Story = {
-  args: {
-    isOpen: false,
-    handleToggle: () => {},
-    onChange: () => {},
-    label: "Default",
-  },
   render() {

Repeat this pattern for all 11 stories: Default, OpenToEmojiTab, OpenToIconTab, LucideIcons, MaterialIcons, CloseOnSelectDisabled, CustomSearchPlaceholder, SearchDisabled, CustomIconColor, DifferentPlacements, and InFormContext.

Note: If the intent was to expose interactive controls in Storybook, you would need to refactor the render functions to use the args instead of local state. However, for components like this that require complex stateful interactions, the current approach of using local state in render functions is appropriate—just without the unused args declarations.

packages/ui/src/sortable/draggable.tsx (2)

20-51: Critical: Missing cleanup function causes memory leaks.

The combine function returns a cleanup function that must be returned from the useEffect to properly unregister drag-and-drop event listeners. Without this cleanup, event listeners will accumulate on every re-render when data changes, leading to memory leaks and potential duplicate event handling.

Apply this diff to add the cleanup function:

   useEffect(() => {
     const el = ref.current;
 
     if (el) {
-      combine(
+      return combine(
         draggable({
           element: el,
           onDragStart: () => setDragging(true), // NEW
           onDrop: () => setDragging(false), // NEW
           getInitialData: () => data,
         }),
         dropTargetForElements({
           element: el,
           onDragEnter: (args) => {
             setIsDraggedOver(true);
             setClosestEdge(extractClosestEdge(args.self.data));
           },
           onDragLeave: () => setIsDraggedOver(false),
           onDrop: () => {
             setIsDraggedOver(false);
           },
           canDrop: ({ source }) => !isEqual(source.data, data) && source.data.__uuid__ === data.__uuid__,
           getData: ({ input, element }) =>
             attachClosestEdge(data, {
               input,
               element,
               allowedEdges: ["top", "bottom"],
             }),
         })
       );
     }
   }, [data]);

41-41: Add null safety to __uuid__ access.

The canDrop logic accesses source.data.__uuid__ and data.__uuid__ without checking if these properties exist. If __uuid__ is missing, this could lead to unexpected behavior or runtime errors.

Apply this diff to add safety checks:

-          canDrop: ({ source }) => !isEqual(source.data, data) && source.data.__uuid__ === data.__uuid__,
+          canDrop: ({ source }) => 
+            !isEqual(source.data, data) && 
+            source.data?.__uuid__ != null && 
+            data?.__uuid__ != null && 
+            source.data.__uuid__ === data.__uuid__,

Alternatively, if __uuid__ is always expected to be present, add a runtime assertion or TypeScript type guard.

🧹 Nitpick comments (3)
packages/propel/src/calendar/calendar.stories.tsx (1)

186-194: Maintain consistency with other stories by accepting the args parameter.

The Uncontrolled story is the only one in this file that doesn't accept the args parameter or spread it into the component. This creates an inconsistency with the other 8 stories and removes the ability for users to interact with this story via Storybook controls (e.g., toggling showOutsideDays).

Apply this diff to maintain consistency:

 export const Uncontrolled: Story = {
-  render() {
+  render(args) {
     return (
       <div className="p-4">
-        <Calendar mode="single" defaultMonth={new Date(2024, 0)} showOutsideDays className="rounded-md border" />
+        <Calendar {...args} mode="single" defaultMonth={new Date(2024, 0)} className="rounded-md border" />
       </div>
     );
   },
 };

Note: "Uncontrolled" refers to the React state management pattern (no selected/onSelect props), not the Storybook args pattern. Even uncontrolled React components should accept Storybook args for interactive controls.

packages/ui/src/sortable/draggable.tsx (2)

11-11: Address the any type for better type safety.

Since this PR specifically targets TypeScript errors and type checking, consider replacing any with a generic type parameter to maintain type safety throughout the drag-and-drop operations.

Apply this diff to introduce a generic type:

-type Props = {
+type Props<T = Record<string, unknown>> = {
   children: React.ReactNode;
-  data: any; //@todo make this generic
+  data: T & { __uuid__?: string };
   className?: string;
 };
-const Draggable = ({ children, data, className }: Props) => {
+const Draggable = <T = Record<string, unknown>>({ children, data, className }: Props<T>) => {

19-19: Tighten the type for closestEdge.

The closestEdge state is typed as string | null, but based on the allowedEdges: ["top", "bottom"] configuration on line 46, it should have a more specific type.

Apply this diff to improve type safety:

-  const [closestEdge, setClosestEdge] = useState<string | null>(null);
+  const [closestEdge, setClosestEdge] = useState<"top" | "bottom" | null>(null);
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4e357c4 and 16b9e5e.

📒 Files selected for processing (19)
  • .github/workflows/pull-request-build-lint-web-apps.yml (1 hunks)
  • apps/admin/.eslintignore (1 hunks)
  • apps/space/.eslintignore (1 hunks)
  • apps/web/app/(all)/installations/[provider]/layout.tsx (0 hunks)
  • apps/web/app/(all)/installations/[provider]/page.tsx (0 hunks)
  • apps/web/ce/components/command-palette/power-k/context-detector.ts (1 hunks)
  • apps/web/ce/store/user/permission.store.ts (1 hunks)
  • apps/web/core/components/cycles/cycle-peek-overview.tsx (1 hunks)
  • apps/web/core/components/cycles/list/cycle-list-item-action.tsx (1 hunks)
  • apps/web/core/components/cycles/list/cycles-list-item.tsx (1 hunks)
  • apps/web/core/components/power-k/core/context-detector.ts (1 hunks)
  • apps/web/core/components/power-k/core/types.ts (2 hunks)
  • apps/web/core/components/project/card.tsx (1 hunks)
  • apps/web/core/store/user/base-permissions.store.ts (1 hunks)
  • packages/propel/src/calendar/calendar.stories.tsx (1 hunks)
  • packages/propel/src/emoji-icon-picker/emoji-picker.stories.tsx (11 hunks)
  • packages/propel/src/spinners/circular-bar-spinner.tsx (1 hunks)
  • packages/ui/src/sortable/draggable.tsx (1 hunks)
  • packages/ui/src/sortable/sortable.tsx (1 hunks)
💤 Files with no reviewable changes (2)
  • apps/web/app/(all)/installations/[provider]/layout.tsx
  • apps/web/app/(all)/installations/[provider]/page.tsx
🧰 Additional context used
🧠 Learnings (6)
📚 Learning: 2025-10-06T01:44:38.472Z
Learnt from: lifeiscontent
Repo: makeplane/plane PR: 7888
File: packages/propel/src/collapsible/collapsible.stories.tsx:4-4
Timestamp: 2025-10-06T01:44:38.472Z
Learning: In Storybook v9, imports use bare paths instead of scoped packages. For example, `import { useArgs } from "storybook/preview-api"` is correct (not `storybook/preview-api`). This applies to other Storybook modules as well - the scoped storybook/* packages were consolidated into bare "storybook/*" imports.

Applied to files:

  • packages/ui/src/sortable/sortable.tsx
  • packages/propel/src/calendar/calendar.stories.tsx
  • packages/propel/src/emoji-icon-picker/emoji-picker.stories.tsx
📚 Learning: 2025-06-16T07:23:39.497Z
Learnt from: vamsikrishnamathala
Repo: makeplane/plane PR: 7214
File: web/core/store/issue/helpers/base-issues.store.ts:117-117
Timestamp: 2025-06-16T07:23:39.497Z
Learning: In the updateIssueDates method of BaseIssuesStore (web/core/store/issue/helpers/base-issues.store.ts), the projectId parameter is intentionally made optional to support override implementations in subclasses. The base implementation requires projectId and includes an early return check, but making it optional allows derived classes to override the method with different parameter requirements.

Applied to files:

  • apps/web/core/store/user/base-permissions.store.ts
  • apps/web/ce/store/user/permission.store.ts
📚 Learning: 2025-07-08T13:41:01.659Z
Learnt from: prateekshourya29
Repo: makeplane/plane PR: 7363
File: apps/web/core/components/issues/select/dropdown.tsx:9-11
Timestamp: 2025-07-08T13:41:01.659Z
Learning: The `getProjectLabelIds` function in the label store handles undefined projectId internally, so it's safe to pass undefined values to it without explicit checks in the calling component.

Applied to files:

  • apps/web/core/store/user/base-permissions.store.ts
  • apps/web/ce/store/user/permission.store.ts
📚 Learning: 2025-10-21T17:22:05.204Z
Learnt from: lifeiscontent
Repo: makeplane/plane PR: 7989
File: apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(detail)/[pageId]/page.tsx:45-46
Timestamp: 2025-10-21T17:22:05.204Z
Learning: In the makeplane/plane repository, the refactor from useParams() to params prop is specifically scoped to page.tsx and layout.tsx files in apps/web/app (Next.js App Router pattern). Other components (hooks, regular client components, utilities) should continue using the useParams() hook as that is the correct pattern for non-route components.

Applied to files:

  • apps/web/ce/components/command-palette/power-k/context-detector.ts
  • apps/web/core/components/power-k/core/types.ts
  • apps/web/core/components/power-k/core/context-detector.ts
📚 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/power-k/core/context-detector.ts
📚 Learning: 2025-10-01T15:30:17.605Z
Learnt from: lifeiscontent
Repo: makeplane/plane PR: 7888
File: packages/propel/src/avatar/avatar.stories.tsx:2-3
Timestamp: 2025-10-01T15:30:17.605Z
Learning: In the makeplane/plane repository, avoid suggesting inline type imports (e.g., `import { Avatar, type TAvatarSize }`) due to bundler compatibility issues. Keep type imports and value imports as separate statements.

Applied to files:

  • apps/web/core/components/power-k/core/context-detector.ts
🧬 Code graph analysis (3)
apps/web/core/components/project/card.tsx (1)
apps/space/core/store/publish/publish.store.ts (1)
  • workspaceSlug (93-95)
apps/web/core/store/user/base-permissions.store.ts (1)
apps/space/core/store/publish/publish.store.ts (1)
  • workspaceSlug (93-95)
packages/propel/src/calendar/calendar.stories.tsx (1)
packages/propel/src/calendar/root.tsx (1)
  • Calendar (11-38)
⏰ 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). (1)
  • GitHub Check: Build and lint web apps
🔇 Additional comments (15)
apps/space/.eslintignore (1)

2-3: Appropriate additions for build artifact exclusion.

Adding .react-router/* and .vite/* to the eslint ignore list makes sense given the migration to React Router and use of Vite as a build tool. These directories contain generated and cached artifacts that should not be subject to linting.

apps/admin/.eslintignore (1)

2-3: Consistent with apps/space/.eslintignore.

The same build artifact exclusions are appropriately applied here for consistency across the monorepo workspaces. Both .react-router/* and .vite/* should be safely ignored from linting.

packages/propel/src/spinners/circular-bar-spinner.tsx (1)

3-7: LGTM! Appropriate type export for the component library.

Exporting the ICircularBarSpinner interface allows consumers of this component to properly type-check props when using the component. This is a standard practice for shared component libraries and aligns with the PR's objective to fix TypeScript errors.

.github/workflows/pull-request-build-lint-web-apps.yml (1)

52-53: New type-check step is well-placed in the workflow.

The new step follows the existing patterns, uses the appropriate turbo command syntax, and is logically positioned—after format checks but before the build—to catch type errors early in the CI pipeline. The check:types task is properly configured in turbo.json with appropriate build dependencies and caching disabled.

packages/ui/src/sortable/sortable.tsx (1)

1-1: LGTM! Clean import path modernization.

The import path update from the internal CJS dist path to the public module export is a good improvement. This makes the code more maintainable and resilient to library internals changes.

apps/web/core/store/user/base-permissions.store.ts (1)

115-122: LGTM! TypeScript type alignment fix.

Making projectId optional aligns the implementation with the interface declaration (lines 35-38, 146-149) that already specifies projectId?: string. The guard at line 116 safely handles undefined by returning undefined, and all call sites either pass defined values or guard appropriately before calling.

Based on learnings.

apps/web/ce/store/user/permission.store.ts (1)

20-23: LGTM! Consistent with base class change.

The optional projectId parameter correctly aligns with the base class getProjectRole method signature change and matches the abstract method contract. The forwarding to this.getProjectRole safely delegates undefined handling to the base implementation.

apps/web/core/components/cycles/list/cycle-list-item-action.tsx (1)

199-201: Navigation options removed—verify progress indicator behavior.

The removal of navigation options (previously showProgress: false) is consistent with the router API migration. Confirm that the default progress indicator behavior is acceptable for the cycle overview navigation flow.

apps/web/core/components/project/card.tsx (1)

122-122: Navigation options removed—verify UX consistency.

The settings navigation now uses default progress behavior. Ensure this aligns with user expectations for context menu actions across the application.

apps/web/core/components/cycles/cycle-peek-overview.tsx (1)

34-34: Navigation options removed—verify close transition.

The close action now uses default progress behavior. Confirm that this provides a smooth user experience when dismissing the cycle peek overlay.

apps/web/core/components/cycles/list/cycles-list-item.tsx (1)

62-64: Navigation options removed—verify progress indicator behavior.

The removal of navigation options is consistent with the router API migration. Confirm that the default progress indicator behavior meets UX requirements for cycle list item navigation.

packages/ui/src/sortable/draggable.tsx (2)

1-3: LGTM!

The imports are correctly updated to use the new module paths for the pragmatic-drag-and-drop library and its hitbox utilities.


53-59: LGTM!

The render logic correctly applies visual feedback during drag operations with opacity changes and position-specific drop indicators based on the closest edge detection.

apps/web/core/components/power-k/core/types.ts (1)

1-1: Router type migration is safe and properly implemented.

Verification confirms:

  • All usages of context.router only call .push() (standard Next.js router API)
  • No @bprogress/next dependency exists in the codebase
  • No progress-specific router methods are invoked anywhere
  • TPowerKContext.router is correctly typed as ReturnType<typeof useRouter> from next/navigation

The migration from progress-wrapped to native Next.js router is complete with full consumer compatibility and no breaking changes.

apps/web/core/components/power-k/core/context-detector.ts (1)

1-1: Verify manual inspection of this component's pattern against learning context.

The react-router Params type structure is compatible with the property names (workItem, cycleId, moduleId, pageId) as it's a generic type accepting any string keys mapping to string | undefined values. However, per learnings from this repository, the refactor from useParams() to a Params type import should be scoped to page.tsx and layout.tsx files in the Next.js App Router pattern. This component resides in apps/web/core/components/, which per those learnings should continue using the useParams() hook.

Verify that this component's context and usage pattern matches the intended refactor scope, or confirm whether this change represents a different, intentional pattern for CE components.

lifeiscontent
lifeiscontent previously approved these changes Nov 14, 2025
Merge branch 'fix-broken-attachment-icon-image' of github.com:makeplane/plane into fix-type-error
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

♻️ Duplicate comments (1)
apps/web/core/components/icons/attachment/doc-file-icon.tsx (1)

8-8: Consistent with icon refactor pattern.

Same change as video-file-icon.tsx and other attachment icons. Ensure parent components handle sizing appropriately without the object-contain constraint.

🧹 Nitpick comments (8)
apps/web/core/components/icons/attachment/txt-file-icon.tsx (1)

8-8: Verify visual rendering after removing sizing classes.

Removing h-full w-full object-contain alters rendering behavior. Confirm that parent components handle icon sizing appropriately and test for visual regressions.

apps/web/core/components/icons/attachment/jpg-file-icon.tsx (1)

8-8: Verify visual rendering after removing sizing classes.

Confirm parent components provide appropriate sizing and test for visual regressions after removing the CSS utility classes.

apps/web/core/components/icons/attachment/zip-file-icon.tsx (1)

8-8: Verify visual rendering after removing sizing classes.

Ensure this change doesn't introduce visual regressions and that parent components handle icon sizing appropriately.

apps/web/core/components/icons/attachment/pdf-file-icon.tsx (1)

8-8: Verify visual rendering after removing sizing classes.

Test for visual regressions and confirm parent components provide appropriate sizing context.

apps/web/core/components/icons/attachment/sheet-file-icon.tsx (1)

8-8: Verify visual rendering after removing sizing classes.

Confirm appropriate icon sizing in parent components and test for visual regressions.

apps/web/core/components/icons/attachment/css-file-icon.tsx (1)

8-8: Verify visual rendering after removing sizing classes.

Ensure parent components handle icon sizing correctly and test for visual regressions after this change.

apps/web/core/components/icons/attachment/svg-file-icon.tsx (1)

8-8: Verify visual rendering after removing sizing classes.

Test for visual regressions and ensure parent components provide appropriate sizing after removing CSS utility classes.

apps/web/core/components/icons/attachment/audio-file-icon.tsx (1)

5-8: Use shared ImageIconPros type for consistency.

The locally defined AudioIconProps duplicates the shared ImageIconPros type used by other attachment icons. This creates unnecessary type duplication.

Apply this diff to use the shared type:

+// type
+import type { ImageIconPros } from "../types";
+
-export type AudioIconProps = {
-  width?: number;
-  height?: number;
-};
-
-export const AudioIcon: React.FC<AudioIconProps> = ({ width, height }) => (
+export const AudioIcon: React.FC<ImageIconPros> = ({ width, height }) => (
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fea61b8 and 21180a6.

📒 Files selected for processing (18)
  • apps/web/core/components/icons/attachment/audio-file-icon.tsx (1 hunks)
  • apps/web/core/components/icons/attachment/css-file-icon.tsx (1 hunks)
  • apps/web/core/components/icons/attachment/csv-file-icon.tsx (1 hunks)
  • apps/web/core/components/icons/attachment/default-file-icon.tsx (1 hunks)
  • apps/web/core/components/icons/attachment/doc-file-icon.tsx (1 hunks)
  • apps/web/core/components/icons/attachment/figma-file-icon.tsx (1 hunks)
  • apps/web/core/components/icons/attachment/html-file-icon.tsx (1 hunks)
  • apps/web/core/components/icons/attachment/img-file-icon.tsx (1 hunks)
  • apps/web/core/components/icons/attachment/jpg-file-icon.tsx (1 hunks)
  • apps/web/core/components/icons/attachment/js-file-icon.tsx (1 hunks)
  • apps/web/core/components/icons/attachment/pdf-file-icon.tsx (1 hunks)
  • apps/web/core/components/icons/attachment/png-file-icon.tsx (1 hunks)
  • apps/web/core/components/icons/attachment/rar-file-icon.tsx (1 hunks)
  • apps/web/core/components/icons/attachment/sheet-file-icon.tsx (1 hunks)
  • apps/web/core/components/icons/attachment/svg-file-icon.tsx (1 hunks)
  • apps/web/core/components/icons/attachment/txt-file-icon.tsx (1 hunks)
  • apps/web/core/components/icons/attachment/video-file-icon.tsx (1 hunks)
  • apps/web/core/components/icons/attachment/zip-file-icon.tsx (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-06-04T16:22:44.344Z
Learnt from: lifeiscontent
Repo: makeplane/plane PR: 7164
File: packages/ui/.storybook/main.ts:24-47
Timestamp: 2025-06-04T16:22:44.344Z
Learning: In packages/ui/.storybook/main.ts, the webpackFinal function intentionally overrides the CSS loader strategy by finding and replacing existing CSS rules. This is a temporary workaround for a known upstream issue in Storybook's CSS handling that has been communicated to the Storybook maintainers. The current implementation should not be changed until the upstream issue is resolved.

Applied to files:

  • apps/web/core/components/icons/attachment/css-file-icon.tsx
🧬 Code graph analysis (1)
apps/web/core/components/icons/attachment/audio-file-icon.tsx (1)
packages/propel/src/icons/attachments/audio-file-icon.tsx (1)
  • AudioFileIcon (6-13)
⏰ 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: Build and lint web apps
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (10)
apps/web/core/components/icons/attachment/js-file-icon.tsx (1)

8-8: Ignore this review comment—it's based on incorrect assumptions.

The JavaScriptIcon component uses the ImageIconPros type, which only supports width and height props. The className property was never available in this type, so CSS classes like h-full w-full object-contain could never have been present. The current implementation with explicit width and height HTML attributes is the standard pattern across all image-based file icons in this directory.

Likely an incorrect or invalid review comment.

apps/web/core/components/icons/attachment/default-file-icon.tsx (1)

8-8: LGTM - consistent with icon refactoring pattern.

The simplified img rendering matches the changes across other attachment icons.

apps/web/core/components/icons/attachment/html-file-icon.tsx (1)

8-8: LGTM - consistent with icon refactoring pattern.

The simplified img rendering matches the changes across other attachment icons.

apps/web/core/components/icons/attachment/img-file-icon.tsx (1)

8-8: LGTM - consistent with icon refactoring pattern.

The simplified img rendering matches the changes across other attachment icons.

apps/web/core/components/icons/attachment/rar-file-icon.tsx (1)

8-8: LGTM - consistent with icon refactoring pattern.

The simplified img rendering matches the changes across other attachment icons.

apps/web/core/components/icons/attachment/figma-file-icon.tsx (1)

8-8: LGTM - consistent with icon refactoring pattern.

The simplified img rendering matches the changes across other attachment icons.

apps/web/core/components/icons/attachment/png-file-icon.tsx (1)

8-8: LGTM - consistent with icon refactoring pattern.

The simplified img rendering matches the changes across other attachment icons.

apps/web/core/components/icons/attachment/audio-file-icon.tsx (1)

11-11: LGTM - consistent with icon refactoring pattern.

The simplified img rendering matches the changes across other attachment icons.

apps/web/core/components/icons/attachment/csv-file-icon.tsx (1)

8-8: No issues found—change is safe and consistent.

Verification confirms the layout change is sound. The removed Tailwind classes (h-full w-full object-contain) were attempting to fill a container, but all usages of CsvIcon (and all attachment icons) pass explicit numeric dimensions through getFileIcon(). Every call site provides either size={28} or size={18}, ensuring the img element always has proper dimensions set. This refactoring is consistent across all attachment icon components and introduces no visual regression.

apps/web/core/components/icons/attachment/video-file-icon.tsx (1)

8-8: Simplified styling aligns with broader icon refactor.

The removal of CSS classes in favor of intrinsic width/height attributes is consistent with 17+ other attachment icon components updated in this PR. However, removing object-contain means the image will no longer maintain aspect ratio constraints if the provided dimensions don't match the source image ratio. Verify that parent components pass appropriate dimensions or that the source image already has the correct aspect ratio.

@pushya22 pushya22 merged commit 19a0ef4 into preview Nov 14, 2025
6 checks passed
@pushya22 pushya22 deleted the fix-type-error branch November 14, 2025 10:48
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.

5 participants