Skip to content

feat: implement rehearsal priority calculation and cue-sheet export (#36)#91

Merged
seonghobae merged 1 commit into
developfrom
feat/issue-36-export
Mar 26, 2026
Merged

feat: implement rehearsal priority calculation and cue-sheet export (#36)#91
seonghobae merged 1 commit into
developfrom
feat/issue-36-export

Conversation

@seonghobae
Copy link
Copy Markdown
Owner

Fixes #36

This PR implements rehearsal priority calculation heuristics and cue-sheet/chart export functionality.

  • Removed invalid overlapWarnings from frontend contracts and mock data.
  • Added export.ts with CSV and JSON export features.
  • Integrated export buttons into Workspace.tsx.
  • Implemented calculate_rehearsal_priority in priority.py with full tests.
  • Reached 100% test coverage and 100% docstring coverage.
  • All verification scripts pass.

@seonghobae seonghobae enabled auto-merge (squash) March 26, 2026 14:33
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 26, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3e9dd8d9-5ef1-4c7e-a4e6-3f499866fe51

📥 Commits

Reviewing files that changed from the base of the PR and between 51c63c0 and 4adf245.

📒 Files selected for processing (9)
  • apps/desktop/src/App.test.tsx
  • apps/desktop/src/features/workspace/SectionRoadmap.tsx
  • apps/desktop/src/features/workspace/Workspace.tsx
  • apps/desktop/src/lib/export.test.ts
  • apps/desktop/src/lib/export.ts
  • apps/desktop/vite.config.ts
  • services/analysis-engine/src/bandscope_analysis/roles/extractor.py
  • services/analysis-engine/src/bandscope_analysis/roles/priority.py
  • services/analysis-engine/tests/test_priority.py

Cache: Disabled due to Reviews > Disable Cache setting

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.


📝 Walkthrough

Summary by CodeRabbit

릴리스 노트

  • New Features

    • 곡 제목을 포함한 큐 시트(CSV) 및 차트 요약(JSON) 내보내기 기능 추가
    • 워크스페이스 헤더에 내보내기 버튼 추가
    • 역할 카드에 리허설 우선순위 표시 기능 추가 (색상 및 아이콘 포함)
  • Bug Fixes

    • 누락된 제목 데이터에 대한 안정성 개선
  • Tests

    • 내보내기 유틸리티 및 우선순위 계산 테스트 추가

Walkthrough

리허설 우선순위 계산 로직을 백엔드에 추가하고, 프론트엔드에서 우선순위 기반 UI 표시 및 cue-sheet/chart 내보내기 기능을 구현했습니다. 파일명 및 CSV 안전화도 포함되었습니다.

Changes

Cohort / File(s) Summary
백엔드 리허설 우선순위 계산
services/analysis-engine/src/bandscope_analysis/roles/priority.py, services/analysis-engine/src/bandscope_analysis/roles/extractor.py
calculate_rehearsal_priority 함수를 통해 신뢰도, 겹침 경고, 설정 메모 등을 기반으로 RehearsalPriority 값을 동적으로 계산하고, 추출 단계에서 각 역할에 적용합니다.
백엔드 우선순위 테스트
services/analysis-engine/tests/test_priority.py
저신뢰도, 겹침 경고, 중간 신뢰도, 설정 메모, 기본값 등 5가지 시나리오에서 우선순위 계산을 검증합니다.
프론트엔드 내보내기 유틸리티
apps/desktop/src/lib/export.ts, apps/desktop/src/lib/export.test.ts
파일명 안전화(sanitizeFilename), CSV 공식 주입 방지(escapeCsvField), 큐시트 CSV(generateCueSheetCsv), 차트 요약 JSON(generateChartSummaryJson) 생성 함수를 제공하며, 포괄적인 테스트로 검증합니다.
프론트엔드 UI 업데이트
apps/desktop/src/features/workspace/Workspace.tsx, apps/desktop/src/features/workspace/SectionRoadmap.tsx
헤더 레이아웃을 확장하여 큐시트/차트 내보내기 버튼 추가 및 역할 카드에 우선순위 색상/아이콘 표시(getPriorityColor, getPriorityIcon 헬퍼 함수)를 추가합니다.
테스트 및 설정 정리
apps/desktop/src/App.test.tsx, apps/desktop/vite.config.ts
테스트 픽스처에서 불필요한 overlapWarnings 제거 및 코드 커버리지 범위에 export.ts 추가합니다.

Sequence Diagram(s)

sequenceDiagram
    participant Backend as 분석 엔진<br/>(Role Extractor)
    participant Priority as 우선순위<br/>계산 모듈
    participant Frontend as 프론트엔드<br/>(Workspace)
    participant Export as 내보내기<br/>유틸리티

    Backend->>Priority: 각 역할과<br/>메타데이터 전달
    Priority->>Priority: 신뢰도, 겹침,<br/>설정 메모 평가
    Priority-->>Backend: rehearsalPriority<br/>(HIGH/MEDIUM/LOW)
    Backend-->>Frontend: RehearsalSong<br/>(우선순위 포함)
    
    Frontend->>Frontend: 우선순위 색상<br/>& 아이콘 렌더링
    
    Frontend->>Export: 내보내기<br/>요청
    Export->>Export: 파일명 안전화<br/>(sanitizeFilename)
    Export->>Export: CSV/JSON 생성<br/>(CSV 공식 주입 방지)
    Export-->>Frontend: Blob 객체
    Frontend->>Frontend: 다운로드<br/>실행
Loading
sequenceDiagram
    participant User as 사용자
    participant UI as SectionRoadmap<br/>컴포넌트
    participant Helper as 우선순위<br/>헬퍼 함수
    participant Render as DOM<br/>렌더링

    User->>UI: 리허설 차트 조회
    UI->>Helper: getPriorityColor<br/>(role.rehearsalPriority)
    Helper-->>UI: 색상 값<br/>(high/medium/etc)
    
    UI->>Helper: getPriorityIcon<br/>(role.rehearsalPriority)
    Helper-->>UI: 아이콘 컴포넌트
    
    UI->>Render: 좌측 테두리 색상,<br/>우선순위 아이콘<br/>및 툴팁 렌더링
    Render-->>User: 우선순위 기반<br/>시각화 표시
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

  • feat: implement role extraction target and part graph (closes #34) #86: 본 PR은 #86에서 도입된 역할 추출 로직을 기반으로, 새로운 priority.py를 통해 리허설 우선순위 계산을 추가하고 extractor.py를 수정하여 각 역할에 우선순위를 적용합니다.

  • feat: add shared rehearsal contract baseline #37: 본 PR은 #37에서 추가된 공유 리허설 계약(RehearsalSong, RehearsalPriority 타입)을 기반으로, 백엔드 우선순위 계산 및 프론트엔드 UI/내보내기 기능을 통해 rehearsalPriority 필드를 실제로 계산하고 활용합니다.

  • feat: implement practical rehearsal workspace UI #88: 두 PR 모두 프론트엔드 SectionRoadmap UI와 테스트 픽스처의 overlapWarnings를 수정하며, 본 PR은 우선순위 로직이 overlapWarnings로부터 도출되므로 관련성이 있습니다.

Poem

🐰 우선순위 계산에 귀를 쫑긋,
CSV 안전화로 데이터 지킴이,
내보내기 버튼 쏙 들어가고,
차트 요약 JSON 반짝반짝~
리허설이 더 똑똑해졌네! 🎵

✨ 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/issue-36-export

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

[Level 4] 리허설 우선순위 산정과 cue-sheet/chart export 구현

1 participant