AOSSIE-Org / AOSSIE-Org/PictoPy

Feat: Implement Pagination for Image Loading

未關閉
#619 4 則留言 0 個 reaction 已指派 1 人 已被 @mohi-devhub 認領 在 GitHub 檢視
backend enhancement frontend
主要語言
Python
星號
283
分支
679
平均合併
7 天 2 小時
30 天內合併 PR
3

描述

### Describe the feature

Currently, the `get_all_images` endpoint fetches all images at once. This can lead to performance issues and high memory usage for users with large image collections. Implementing pagination would make the app more efficient and scalable.

### Proposed Solution
- **Backend:**
- Update `backend/app/routes/images.py` to accept `limit` and `offset` query parameters.
- Modify the database query in `backend/app/database/images.py` to support pagination.
- **Frontend:**
- Update the API function in `frontend/src/api/api-functions.ts` to include pagination parameters.
- Modify `frontend/src/pages/Home/Home.tsx` to load images in chunks or via infinite scroll.

### Benefits
- Faster page loads.
- Reduced bandwidth and memory usage.
- Better scalability for large datasets.
- Improved user experience with smoother loading.

### Relevant Files
- `backend/app/routes/images.py`
- `backend/app/database/images.py`
- `frontend/src/api/api-functions.ts`
- `frontend/src/pages/Home/Home.tsx`

### Add ScreenShots

Not applicable - this is a performance enhancement and not a UI bug.

### Record

- [x] I agree to follow this project's Code of Conduct
- [x] I want to work on this issue

### Checklist before Submitting.

- [x] Have you updated docs for it?.
- [ ] Have you added unit tests?.
- [ ] Have you made sure unit tests pass?
- [x] Have you made sure code formatting is correct?
- [ ] Does it contain any style related issues?

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。