plane icon indicating copy to clipboard operation
plane copied to clipboard

[WEB-5779] fix: handle loading state while fetching project cover image

Open JayashTripathy opened this issue 1 week ago โ€ข 2 comments

Description

This PR fixes an issue where the default cover image was shown as a fallback while the actual cover image was still loading.

Type of Change

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

Summary by CodeRabbit

  • New Features

    • Added a reusable cover image component with built-in fallback/default handling and a loading skeleton for missing images.
  • Refactor

    • Replaced inline cover image markup across profiles, projects, cards, and forms with the centralized component for consistent display and styling.

โœ๏ธ Tip: You can customize this high-level summary in your review settings.

JayashTripathy avatar Dec 22 '25 13:12 JayashTripathy

[!NOTE]

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

๐Ÿ“ Walkthrough

Walkthrough

Adds a new reusable React component CoverImage and replaces inline cover image rendering in several profile and project components to use this component instead of manual URL helpers.

Changes

Cohort / File(s) Summary
New CoverImage component
apps/web/core/components/common/cover-image.tsx
Adds CoverImage export and TCoverImageProps (extends img props). Handles empty-src loading skeleton, computes display URL via getCoverImageDisplayURL(...) (with DEFAULT_COVER_IMAGE_URL fallback), and renders an img with merged props and object-fit styling.
Profile components
apps/web/core/components/profile/form.tsx, apps/web/core/components/profile/sidebar.tsx
Replaces inline img + getCoverImageDisplayURL usage with <CoverImage src={...} ... />; removes direct imports of getCoverImageDisplayURL and DEFAULT_COVER_IMAGE_URL.
Project components
apps/web/core/components/project/card.tsx, apps/web/core/components/project/create/header.tsx, apps/web/core/components/project/form.tsx
Replaces inline img usage and helper calls with CoverImage, passing raw cover_image_url and relying on component-level fallback/behavior; removes getCoverImageDisplayURL and DEFAULT_COVER_IMAGE_URL dependencies.

Estimated code review effort

๐ŸŽฏ 3 (Moderate) | โฑ๏ธ ~20 minutes

Poem

๐Ÿฐ I stitched a cover, neat and true,
One component hopped into view.
No scattered tags or URL chase,
A tidy image in its place.
Hooray โ€” a cleaner, happier space! ๐ŸŽ‰

Pre-merge checks and finishing touches

โŒ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage โš ๏ธ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
โœ… Passed checks (2 passed)
Check name Status Explanation
Title check โœ… Passed The title accurately describes the main change: introducing a new CoverImage component to handle loading states for project cover images across multiple components.
Description check โœ… Passed The description provides a clear problem statement and the type of change is marked. However, it lacks details about the solution implementation, test scenarios, and references to related issues.
โœจ 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/project-default-cover-image

๐Ÿ“œ Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

๐Ÿ“ฅ Commits

Reviewing files that changed from the base of the PR and between bac52b5897d11818cae94738c61c6dc1a2576c0f and b0460b58fde3294eb956ba5ad28dd2f892a51260.

๐Ÿ“’ Files selected for processing (1)
  • apps/web/core/components/profile/sidebar.tsx
๐Ÿšง Files skipped from review as they are similar to previous changes (1)
  • apps/web/core/components/profile/sidebar.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: Build packages
  • GitHub Check: Analyze (javascript)

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.

coderabbitai[bot] avatar Dec 22 '25 13:12 coderabbitai[bot]

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

makeplane[bot] avatar Dec 22 '25 13:12 makeplane[bot]