8000 Feature: 드래그 & 스크롤 기능 추가 by guesung · Pull Request #150 · guesung/Web-Memo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Feature: 드래그 & 스크롤 기능 추가 #150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 24, 2025

Conversation

guesung
Copy link
Owner
@guesung guesung commented Jan 24, 2025

Summary by CodeRabbit

  • 기능 개선
    • 메모 그리드의 드래그 및 스크롤 기능을 최적화했습니다.
    • 그리드 레이아웃의 항목 렌더링 방식을 조정했습니다.

Copy link
coderabbitai bot commented Jan 24, 2025

Warning

Rate limit exceeded

@guesung has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 16 minutes and 53 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 0584751 and cd03104.

📒 Files selected for processing (1)
  • packages/web/src/app/[lng]/(auth)/memos/_components/MemoView/MemoGrid.tsx (5 hunks)

Walkthrough

MemoGrid 컴포넌트의 드래그 및 스크롤 기능을 개선하는 변경 사항입니다. 기존의 주석 처리된 코드를 제거하고, 그리드의 상단 및 하단 근처에서 드래그 작업 시 스크롤 로직을 더 명확하고 간결하게 재구성했습니다. MasonryInfiniteGrid 컴포넌트에 useRecycle={false} 속성을 추가하여 아이템 렌더링 방식에 영향을 미칩니다.

Changes

파일 변경 요약
packages/web/src/app/[lng]/(auth)/memos/_components/MemoView/MemoGrid.tsx - 드래그 및 스크롤 로직 리팩토링
- MasonryInfiniteGriduseRecycle={false} 속성 추가

Possibly related PRs

🐰 메모 그리드의 춤을 추는 토끼
드래그로 스크롤하니
코드는 더 깔끔해지고
기능은 더 부드러워
토끼의 코딩 마법! 🎉


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

Copy link
@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

🧹 Nitpick comments (3)
packages/web/src/app/[lng]/(auth)/memos/_components/MemoView/MemoGrid.tsx (3)

86-101: 스크롤 하단 인접 로직 개선 제안
현재 드래그 위치가 하단 근처일 때 setInterval로 스크롤을 진행하는 로직은 동작 면에서 적절해 보입니다. 다만, 사용자가 빠르게 마우스를 움직일 때 중복으로 setInterval이 여러 번 호출될 가능성이 있을 수 있으므로, 추가적인 안전 장치(예: 드래그가 종료될 때 남아있는 모든 Interval을 한 번 더 정리)나 requestAnimationFrame 활용 방식으로 좀 더 부드러운 스크롤 동작을 고려할 수 있습니다.


102-116: 스크롤 상단 인접 로직 개선 제안
하단 스크롤 로직과 마찬가지로 상단에서도 setInterval로 스크롤을 유도합니다. 동일한 로직이 반복되므로, 중복 코드를 줄이기 위해 상·하단 스크롤 처리를 별도의 함수로 추출해 재사용하는 방식을 고려해 주세요. 또한 requestAnimationFrame 등을 사용해 jank 없는 스크롤을 구현할 수도 있습니다.


215-215: useRecycle 옵션 사용에 대한 성능 고려
MasonryInfiniteGrid에서 useRecycle={false}를 설정하면 기존 재활용 로직을 비활성화하여 렌더링된 DOM을 계속 유지합니다. 데이터 개수가 많아질수록 메모리 및 렌더링 성능에 영향이 있을 수 있으니, 필요한 경우에만 비활성화하거나 조건부로 옵션을 적용하는 방안을 검토해 보시길 권장합니다.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1e4c029 and 0584751.

📒 Files selected for processing (1)
  • packages/web/src/app/[lng]/(auth)/memos/_components/MemoView/MemoGrid.tsx (2 hunks)

@guesung guesung merged commit e3a7a0b into develop Jan 24, 2025
6 checks passed
@guesung guesung deleted the feature/add-drag-and-scroll branch January 24, 2025 02:43
guesung added a commit that referenced this pull request Jan 24, 2025
* Feature: mutate 실패 시 알림 및 Sentry에 사용자 데이터 설정 (#149)

* feat: Sentry - 사용자 데이터 설정

* feat: mutate 실패 시 Sentry에 알림

* fix: import 에러 해결

* feat: global-error 구현 및 app/_components로 이동

ref : https://nextjs.org/docs/14/app/building-your-application/routing/error-handling

* feat: 클라이언트 단에서 Sentry를 설정하는 컴포넌트 추가

* Feature: 드래그 & 스크롤 기능 추가 (#150)

* feat: 드래그 & 스크롤 기능 추가

* fix: useRecycle 비활성화

ref : https://naver.github.io/egjs-infinitegrid/release/latest/doc/eg.InfiniteGrid.html

* feat: requestAnimationFrame을 활용한 최적화

* feat: MemoItem에 layoutId 추가

* fix: isSelecting이 true일 때 선택이 안되는 이슈 해결

* fix: key값 불일치 이슈 해결

* feat: placeholder 번역

* feat: item과 dialog간의 layoutId 일치

* chore: html에 lang속성 추가
guesung added a commit that referenced this pull request Jan 24, 2025
* Feature: mutate 실패 시 알림 및 Sentry에 사용자 데이터 설정 (#149)

* feat: Sentry - 사용자 데이터 설정

* feat: mutate 실패 시 Sentry에 알림

* fix: import 에러 해결

* feat: global-error 구현 및 app/_components로 이동

ref : https://nextjs.org/docs/14/app/building-your-application/routing/error-handling

* feat: 클라이언트 단에서 Sentry를 설정하는 컴포넌트 추가

* Feature: 드래그 & 스크롤 기능 추가 (#150)

* feat: 드래그 & 스크롤 기능 추가

* fix: useRecycle 비활성화

ref : https://naver.github.io/egjs-infinitegrid/release/latest/doc/eg.InfiniteGrid.html

* feat: requestAnimationFrame을 활용한 최적화

* feat: MemoItem에 layoutId 추가

* fix: isSelecting이 true일 때 선택이 안되는 이슈 해결

* fix: key값 불일치 이슈 해결

* feat: placeholder 번역

* feat: item과 dialog간의 layoutId 일치

* chore: html에 lang속성 추가
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.

1 participant
0