Skip to content

fix(ui): center "Add Images" button in empty album view - #1467

Closed
anurag-sinha04 wants to merge 4 commits into
AOSSIE-Org:mainfrom
anurag-sinha04:main
Closed

anurag-sinha04 wants to merge 4 commits into
AOSSIE-Org:mainfrom
anurag-sinha04:main

Conversation

@anurag-sinha04

@anurag-sinha04 anurag-sinha04 commented Aug 6, 2026

Copy link
Copy Markdown

Addressed Issues:

Fixes #1460

Screenshots/Recordings:

Before:
The "Add Image" button/icon in the Albums view appears off-center, resulting in inconsistent alignment with the surrounding UI.

image

After:
The "Add Image" button/icon is properly centered, providing a consistent and visually balanced layout.

image

Additional Notes:

  • Adjusted the alignment of the "Add Image" element in the Albums view.

  • This is a UI-only fix and does not affect any application functionality or business logic.

AI Usage Disclosure:

We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact. AI slop is strongly discouraged and may lead to banning and blocking. Do not spam our repos with AI slop.

Check one of the checkboxes below:

  • This PR does not contain AI-generated code at all.
  • This PR contains AI-generated code. I have read the AI Usage Policy and this PR complies with this policy. I have tested the code locally and I am responsible for it.

I have used the following AI models and tools: ChatGPT

Checklist

  • My PR addresses a single issue, fixes a single bug or makes a single improvement.
  • My code follows the project's code style and conventions
  • If applicable, I have made corresponding changes or additions to the documentation
  • If applicable, I have made corresponding changes or additions to tests
  • My changes generate no new warnings or errors
  • I have joined the Discord server and I will share a link to this PR with the project maintainers there
  • I have read the Contribution Guidelines
  • Once I submit my PR, CodeRabbit AI will automatically review it and I will address CodeRabbit's comments.
  • I have filled this PR template completely and carefully, and I understand that my PR may be closed without review otherwise.

Summary by CodeRabbit

  • Style
    • Improved the empty album view by adding a muted image icon above the existing message and add-images button.
  • Chores
    • Applied minor formatting cleanup without changing functionality.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The PR adds a muted image icon above the existing empty-album message and add-images button. It also adds a blank line in App.tsx. No functional behavior changes occur in App.tsx.

Changes

Album UI updates

Layer / File(s) Summary
Album empty-state presentation
frontend/src/pages/Album/AlbumDetail.tsx, frontend/src/App.tsx
The empty-album state now displays a muted, centered ImageIcon. App.tsx includes an added blank line between the imports and component declaration.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related PRs

Suggested labels: TypeScript/JavaScript

Suggested reviewers: rohan-pandeyy

Poem

I hop through albums, neat and bright,
An image icon joins the sight.
Empty spaces now look clear,
Tidy imports breathe fresh air.
— A pleased review rabbit 🐇

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The change improves the empty album state, but the summary does not confirm that the Add Images element is centered. Add or verify the required CSS alignment so the Add Images element is centered in the empty album view.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the empty album UI change and its intended centering fix.
Out of Scope Changes check ✅ Passed The changes are limited to empty album UI presentation and a formatting-only import separation.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@frontend/src/pages/Album/AlbumDetail.tsx`:
- Around line 332-339: Update the empty-state container surrounding the “No
images in this album yet” content to center its children vertically and
horizontally by adding the appropriate cross-axis alignment alongside
justify-center. Remove reliance on the fixed pt-24 offset so the empty state
remains centered across viewport heights.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 51f49f86-8f1a-4aa7-8ffa-0af7fd27d548

📥 Commits

Reviewing files that changed from the base of the PR and between 5b4c41d and fad8bf7.

📒 Files selected for processing (2)
  • frontend/src/App.tsx
  • frontend/src/pages/Album/AlbumDetail.tsx

Comment thread frontend/src/pages/Album/AlbumDetail.tsx Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

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

⚠️ Outside diff range comments (2)
frontend/src/pages/Album/AlbumDetail.tsx (2)

81-89: 🚀 Performance & Scalability | 🟠 Major | ⚡ Quick win

Do not gate an empty album on the full image-library request.

getAlbumImages already returns image_ids. When that array is empty, the UI still waits for fetchAllImages() and the effect does not dispatch an empty image list until allImagesData exists. If the full-image request fails after navigating from a populated album, stale images can remain visible.

Clear empty image_ids immediately. Only wait for allImagesData when the album contains image IDs.

Also applies to: 150-161

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@frontend/src/pages/Album/AlbumDetail.tsx` around lines 81 - 89, The
AlbumDetail image-loading flow should not depend on allImagesData when the
album’s image_ids array is empty. Update the effect around getAlbumImages and
the isLoadingContent calculation to immediately dispatch an empty image list for
empty albums, wait for allImagesData only when image_ids exist, and ensure stale
images are cleared if fetchAllImages fails after navigation.

5-5: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Import ImageIcon before using it.

ImageIcon is referenced in the empty-album render but is not imported, so TypeScript will fail with Cannot find name 'ImageIcon'.

Proposed fix
-import { ArrowLeft, Plus, Trash2 } from 'lucide-react';
+import { ArrowLeft, ImageIcon, Plus, Trash2 } from 'lucide-react';
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@frontend/src/pages/Album/AlbumDetail.tsx` at line 5, Update the lucide-react
import in AlbumDetail to include ImageIcon, matching the existing usage in the
empty-album render and preserving the other imported icons.
🧹 Nitpick comments (1)
frontend/src/pages/Album/AlbumDetail.tsx (1)

310-324: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add regression coverage for the empty album state.

Add an automated component test that renders an empty album and verifies the icon, message, and Add Images button. Use a visual test if the project needs to verify pixel-level centering.

As per path instructions, ensure that test code is automated, comprehensive, and follows testing best practices.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@frontend/src/pages/Album/AlbumDetail.tsx` around lines 310 - 324, Add
automated component coverage for the empty-album branch in AlbumDetail,
rendering an album with no images and asserting the empty-state ImageIcon, “No
images in this album yet” message, and “Add Images” button are present. Verify
the button opens the add-images dialog, and add visual coverage only if required
by the project’s existing testing conventions to validate centering.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@frontend/src/pages/Album/AlbumDetail.tsx`:
- Around line 81-89: The AlbumDetail image-loading flow should not depend on
allImagesData when the album’s image_ids array is empty. Update the effect
around getAlbumImages and the isLoadingContent calculation to immediately
dispatch an empty image list for empty albums, wait for allImagesData only when
image_ids exist, and ensure stale images are cleared if fetchAllImages fails
after navigation.
- Line 5: Update the lucide-react import in AlbumDetail to include ImageIcon,
matching the existing usage in the empty-album render and preserving the other
imported icons.

---

Nitpick comments:
In `@frontend/src/pages/Album/AlbumDetail.tsx`:
- Around line 310-324: Add automated component coverage for the empty-album
branch in AlbumDetail, rendering an album with no images and asserting the
empty-state ImageIcon, “No images in this album yet” message, and “Add Images”
button are present. Verify the button opens the add-images dialog, and add
visual coverage only if required by the project’s existing testing conventions
to validate centering.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b1f25533-e833-41df-9ea1-c5d6190ca31d

📥 Commits

Reviewing files that changed from the base of the PR and between fad8bf7 and 58b6b39.

📒 Files selected for processing (1)
  • frontend/src/pages/Album/AlbumDetail.tsx

@anurag-sinha04

Copy link
Copy Markdown
Author

@rohan-pandeyy please review this PR

@gitcordapp

gitcordapp Bot commented Aug 6, 2026

Copy link
Copy Markdown

Link your account with Gitcord

Thanks for opening this PR, @anurag-sinha04!

To receive Discord notifications and contributor tracking for this organization:

  1. Join Discord: https://discord.gg/hjUhu33uAn
  2. In Discord, run /link anurag-sinha04
  3. Paste the verification code into your GitHub bio (or a public gist)
  4. Click Verify in Discord (or run /verify-link anurag-sinha04)

Once linked, Gitcord can notify you about reviews, merges, and more.

Posted by Gitcord

@rohan-pandeyy

Copy link
Copy Markdown
Member

Please do not open PRs without being assigned to them.

@anurag-sinha04

Copy link
Copy Markdown
Author

Okk Sure

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

Labels

good first issue Good for newcomers UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG:Add image looks off - center.(in albums)

2 participants