Skip to content

fix:자료실 업로드 및 알림 목록 오류 수정(#71) - #72

Merged
seongjinss555 merged 3 commits into
developfrom
feat/resource-upload-notification-history
Jul 20, 2026
Merged

fix:자료실 업로드 및 알림 목록 오류 수정(#71)#72
seongjinss555 merged 3 commits into
developfrom
feat/resource-upload-notification-history

Conversation

@seongjinss555

@seongjinss555 seongjinss555 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Pull Request

작업 내용

  • 자료실 파일 업로드가 Server Action 본문 크기와 Storage 객체 키 형식에 따라 실패하던 문제를 수정했습니다.
  • 링크 제공자 표시와 자료실 빈 상태, 드래그 앤 드롭, 다운로드 UI를 보완했습니다.
  • 실제 알림 개수와 무관하게 최근 알림 10개로 표시되던 문제를 수정하고 전체 알림 조회를 추가했습니다.

작업 결과

  • 한글·공백 파일명은 DB 제목으로 유지하고, Storage에는 UUID와 확장자만 사용해 PDF 등 파일 업로드 오류를 방지합니다.
  • 파일 크기는 Storage 정책과 동일하게 최대 5MB로 제한합니다.
  • 헤더 알림은 실제 최근 조회 건수 또는 빈 상태를 표시하며, 전체 알림 페이지에서 20건씩 추가 조회합니다.

변경 사항

Added

  • resources.link_provider 마이그레이션
  • 전체 알림 페이지 및 20건 단위 추가 조회
  • 자료실 드래그 앤 드롭 및 빈 상태 UI

Changed

  • 자료실 파일 업로드를 클라이언트 Storage 업로드 후 메타데이터 저장 방식으로 변경
  • 링크 유형을 GitHub, Figma, Notion, 기타로 표시
  • 헤더 알림 문구를 실제 결과 건수 기준으로 변경

Fixed

  • Server Action 본문 크기 제한과 한글·공백 Storage 키로 인한 파일 업로드 실패
  • 알림이 없어도 최근 알림 10개로 고정 표시되는 문제

실행화면

  • 자료실(업로드 파일 X)
스크린샷 2026-07-20 오후 4 50 35
  • 파일 업로드(사진, pdf 파일) / UI 개선(다운로드 icon 개선, 선택 카테고리 표시)
image
  • 첫 진입 시 알람 초기화
image

테스트

  • 로컬 실행 확인
  • 주요 시나리오 확인
  • 영향 범위 확인
  • npm run lint
  • npm run typecheck
  • npm run build (.next/lock으로 재실행 보류)

리뷰 체크리스트

  • PR base branch가 올바릅니다. (feature/* -> develop, 배포 시 develop 또는 release/* -> main)
  • 브랜치명이 Type/#issue-number/description 형식을 따릅니다.
  • 커밋 메시지가 컨벤션을 따릅니다.
  • 불필요한 console.log, 주석, 임시 코드를 제거했습니다.
  • 타입 에러와 린트 에러를 확인했습니다.
  • CodeRabbit 1차 리뷰를 확인했습니다.
  • CodeRabbit 리뷰 반영 후 Discord에 공유했습니다.
  • 최소 1명 이상의 approve 후 merge합니다.

리뷰 요청사항

  • Storage 직접 업로드 후 DB 메타데이터 저장 실패 시 보상 삭제 흐름과 link_provider 마이그레이션을 중점 검토 부탁드립니다.

관련 이슈

Closes #71

@vercel

vercel Bot commented Jul 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
syncly Ready Ready Preview, Comment Jul 20, 2026 8:05am

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

자료실은 브라우저 직접 업로드, 링크 제공자 저장·표시, 다운로드 UI를 지원하도록 변경되었습니다. 알림은 전체 목록 페이지와 20건 단위 추가 조회, 읽음 처리를 지원하며 헤더와 패널이 실제 상태를 표시합니다.

Changes

자료실 리소스 관리

Layer / File(s) Summary
링크 제공자 계약과 조회
supabase/migrations/..., src/entities/resource/..., src/shared/model/database.types.ts
link_provider 컬럼과 허용 값 제약을 추가하고, 저장된 제공자를 리소스 조회와 링크 생성에 반영합니다.
Storage 파일 업로드와 메타데이터 생성
next.config.ts, src/features/manage-resources/..., src/entities/resource/api/resource-actions.ts
5MB 파일 검증과 드래그 앤 드롭을 지원하며, 브라우저 Storage 업로드 후 리소스 메타데이터를 생성하고 실패 시 객체를 정리합니다.
리소스 표시와 다운로드
src/entities/resource/api/resource-actions.ts, src/features/manage-resources/ui/ResourceList.tsx, src/features/manage-resources/model/use-resource-library-state.ts
파일·링크 유형별 라벨과 아이콘을 표시하고, 파일 다운로드를 signed URL 이동 방식으로 변경합니다.

알림 전체 목록

Layer / File(s) Summary
알림 페이지 데이터 계약과 조회
src/entities/notification/model/*, src/entities/notification/api/*, src/entities/notification/index.ts
알림 페이지 데이터 타입과 20건 단위 서버 조회 액션을 추가하고 공개 export를 확장합니다.
전체 알림 페이지와 무한 조회
src/app/workspaces/[workspaceId]/notifications/page.tsx, src/views/notifications/*
초기 데이터를 서버에서 조회하고, 클라이언트에서 추가 페이지 조회와 개별·전체 읽음 처리를 제공합니다.
알림 진입점과 패널 연결
src/features/workspace-notifications/ui/NotificationPanel.tsx, src/widgets/workspace-shell/ui/WorkspaceHeader.tsx
패널에 실제 알림 건수와 전체 알림 링크를 추가하고 알림 페이지 제목을 표시합니다.

Supabase 함수 타입 선언

Layer / File(s) Summary
Supabase 함수 타입 추가
src/shared/model/database.types.ts
create_taskupdate_task_board 함수의 입력·반환 타입을 추가합니다.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

파일 업로드

sequenceDiagram
  participant User
  participant ResourceAddDialog
  participant SupabaseStorage
  participant createFileResource
  User->>ResourceAddDialog: 파일 선택 또는 드롭
  ResourceAddDialog->>SupabaseStorage: 검증된 파일 업로드
  ResourceAddDialog->>createFileResource: storagePath 메타데이터 저장
  createFileResource-->>ResourceAddDialog: 생성 결과 반환
Loading

전체 알림 조회

sequenceDiagram
  participant NotificationsPage
  participant NotificationsView
  participant getNotificationsPage
  participant Supabase
  NotificationsPage->>getNotificationsPage: 초기 알림 페이지 요청
  NotificationsPage->>NotificationsView: initialData와 viewerId 전달
  NotificationsView->>getNotificationsPage: 다음 offset 요청
  getNotificationsPage->>Supabase: 사용자 알림 페이지 조회
  Supabase-->>NotificationsView: notifications와 hasMore 반환
Loading

Possibly related PRs

Suggested reviewers: kwon812

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning database.types에 이슈와 무관한 create_task/update_task_board 함수 타입 추가가 포함되어 범위를 벗어납니다. 해당 함수 타입 추가를 별도 PR로 분리하거나, 이번 이슈와 연관된 스키마 변경만 남기도록 제거하세요.
Docstring Coverage ⚠️ Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed 직접 이슈 #71의 핵심 요구사항인 브라우저 업로드, 5MB 제한, 알림 조회, 마이그레이션을 모두 구현했습니다.
Title check ✅ Passed 제목이 자료실 업로드와 알림 목록 수정이라는 핵심 변경을 간결하게 요약합니다.
Description check ✅ Passed 템플릿의 주요 섹션(작업 내용, 결과, 변경 사항, 실행화면, 테스트, 리뷰 체크리스트, 관련 이슈)을 대부분 채웠습니다.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/resource-upload-notification-history

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

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 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 `@src/entities/resource/api/resource-actions.ts`:
- Around line 10-11: Define a single RESOURCE_LINK_PROVIDERS constant and derive
the ResourceLinkProvider type and Zod schema from it in
src/entities/resource/api/resource-actions.ts#L10-L11; reuse that type in
createLinkResource’s inline union. Replace the hardcoded provider array in
src/entities/resource/api/get-resource-library.ts#L19-L19, generate or type the
values in src/features/manage-resources/ui/ResourceAddDialog.tsx#L24-L26 from
the shared entity constant, and constrain LINK_PROVIDER_LABEL keys in
src/features/manage-resources/ui/ResourceList.tsx#L9-L14 with the shared type.
Preserve the FSD import direction by having features consume the entities
definition.

In `@src/features/manage-resources/model/use-resource-library-state.ts`:
- Around line 231-234: Update getFileExtension to verify that fileName contains
a dot before treating the final segment as an extension. Preserve the existing
lowercase and alphanumeric validation for dotted filenames, while returning an
empty string for names such as README, Dockerfile, or Makefile.
- Around line 82-84: Update getFileName in get-resource-library.ts to remove the
obsolete UUID-prefix parsing and return undefined, allowing the existing title
fallback from addResource to provide the original filename. Keep
resource.fileName behavior consistent so ResourceList.tsx does not display the
generated UUID.
🪄 Autofix (Beta)

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: ASSERTIVE

Plan: Pro Plus

Run ID: e53facf4-5a80-4390-83ea-3c28c77991b5

📥 Commits

Reviewing files that changed from the base of the PR and between dab6849 and ced8197.

📒 Files selected for processing (16)
  • next.config.ts
  • src/app/workspaces/[workspaceId]/notifications/page.tsx
  • src/entities/notification/api/get-notifications.ts
  • src/entities/notification/index.ts
  • src/entities/notification/model/notification.types.ts
  • src/entities/resource/api/get-resource-library.ts
  • src/entities/resource/api/resource-actions.ts
  • src/features/manage-resources/model/use-resource-library-state.ts
  • src/features/manage-resources/ui/ResourceAddDialog.tsx
  • src/features/manage-resources/ui/ResourceList.tsx
  • src/features/workspace-notifications/ui/NotificationPanel.tsx
  • src/shared/model/database.types.ts
  • src/views/notifications/index.ts
  • src/views/notifications/ui/NotificationsView.tsx
  • src/widgets/workspace-shell/ui/WorkspaceHeader.tsx
  • supabase/migrations/20260720160000_add_resource_link_provider.sql

Comment thread src/entities/resource/api/resource-actions.ts Outdated
Comment on lines +82 to +84
const storagePath = `${workspaceId}/${crypto.randomUUID()}${getFileExtension(
values.file.name,
)}`;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Storage 키에 구분자가 없어 getFileName의 UUID 제거 로직이 더 이상 동작하지 않습니다.

이전에는 오브젝트명이 <uuid>-<원본파일명> 형태였고, get-resource-library.tsgetFileName^[0-9a-f-]{36}- 패턴으로 UUID 접두어를 제거해 원본 파일명을 노출했습니다. 이번 변경으로 storagePath${uuid}${ext} (하이픈 없음) 형태가 되어, 해당 정규식이 더는 매치되지 않고 resource.fileName이 그대로 <uuid><ext>를 반환합니다. ResourceList.tsx에서 설명이 없는 파일 자료는 결국 이 값을 표시 폴백으로 사용하므로 사용자에게 무의미한 UUID 문자열이 노출됩니다.

title이 이미 원본 파일명을 폴백으로 담고 있으므로(addResourcetitle 계산), get-resource-library.tsgetFileName을 제거하거나 단순히 undefined를 반환하도록 정리하는 것을 권장합니다.

🐛 제안: getFileName 정리
-function getFileName(storagePath: string | null): string | undefined {
-  const objectName = storagePath?.split('/').at(-1);
-  return objectName?.replace(/^[0-9a-f-]{36}-/, '');
-}
+// UUID 기반 storagePath에는 원본 파일명이 더 이상 포함되지 않으므로,
+// title이 이미 담고 있는 이름을 표시용으로 사용한다.
🤖 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 `@src/features/manage-resources/model/use-resource-library-state.ts` around
lines 82 - 84, Update getFileName in get-resource-library.ts to remove the
obsolete UUID-prefix parsing and return undefined, allowing the existing title
fallback from addResource to provide the original filename. Keep
resource.fileName behavior consistent so ResourceList.tsx does not display the
generated UUID.

Comment thread src/features/manage-resources/model/use-resource-library-state.ts

@Kwon812 Kwon812 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.

고생하셨습니다~

@JiWoongE JiWoongE 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.

고생하셨습니다 !!!

@seongjinss555
seongjinss555 merged commit 00ed9c0 into develop Jul 20, 2026
3 checks passed
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.

자료실 업로드 및 알림 목록 개선

3 participants