-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor/#131 pdf 미리보기 페이지 넘어가는 단위 수정 #132
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
Changes from 2 commits
1fff387
c0f860a
8b14220
1b9183a
cbdd73b
60fe4f0
a372229
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| import { Document, Page, StyleSheet, Text, View } from '@react-pdf/renderer' | ||
| import { Fragment, type ReactNode } from 'react' | ||
| import { Children, Fragment, type ReactNode } from 'react' | ||
| import type { ResumeBasicInfoFieldsFragment } from '@shared/lib/gql/graphql' | ||
| import { formatDate, formatYYYYMM } from '@shared/lib' | ||
| import { payloadsOf, visibleItems, type ResumeSectionData } from '@entities/resume' | ||
|
|
@@ -33,7 +33,9 @@ const styles = StyleSheet.create({ | |
| divider: { borderBottomWidth: 1, borderBottomColor: COLOR.divider, marginTop: 12, marginBottom: 24 }, | ||
|
|
||
| sections: { flexDirection: 'column', gap: 44 }, | ||
| section: { flexDirection: 'row', gap: 48 }, | ||
| // 섹션 = [제목+첫 항목 줄] + [빈 열+나머지 항목 줄]을 세로로 쌓음. 세로 gap은 항목 간격(24)과 동일. | ||
| section: { flexDirection: 'column', gap: 24 }, | ||
| sectionLine: { flexDirection: 'row', gap: 48 }, // 제목(또는 빈 열) | 본문 | ||
| sectionTitle: { width: 72, flexShrink: 0, fontSize: 13, color: COLOR.subtler }, | ||
| sectionBody: { flex: 1, flexDirection: 'column', gap: 24 }, | ||
|
|
||
|
|
@@ -74,12 +76,25 @@ const Subtitle = ({ parts }: { parts: Array<string | null | undefined> }) => { | |
| ) | ||
| } | ||
|
|
||
| const SectionRow = ({ title, children }: { title: string; children: ReactNode }) => ( | ||
| <View style={styles.section}> | ||
| <Text style={styles.sectionTitle}>{title}</Text> | ||
| <View style={styles.sectionBody}>{children}</View> | ||
| </View> | ||
| ) | ||
| const SectionRow = ({ title, children }: { title: string; children: ReactNode }) => { | ||
| const [first, ...rest] = Children.toArray(children) | ||
| return ( | ||
| // '제목 + 첫 항목'을 wrap={false}로 묶어, 페이지 경계에서 제목만 홀로 남는 분리를 막는다(묶음은 항목 하나 크기라 | ||
| // 항상 한 페이지에 들어감 → 겹침 없음). 나머지 항목은 자유롭게 나뉘어(빈 좌측 열로 정렬 유지) 큰 섹션도 이어진다. | ||
| <View style={styles.section}> | ||
| <View style={styles.sectionLine} wrap={false}> | ||
| <Text style={styles.sectionTitle}>{title}</Text> | ||
| <View style={styles.sectionBody}>{first}</View> | ||
|
Comment on lines
+80
to
+87
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== Locate file =="
fd -a 'ResumePdfDocument\.tsx$' . || true
echo "== File excerpt =="
if [ -f src/features/resume_pdf_download/ui/ResumePdfDocument.tsx ]; then
wc -l src/features/resume_pdf_download/ui/ResumePdfDocument.tsx
sed -n '1,180p' src/features/resume_pdf_download/ui/ResumePdfDocument.tsx | cat -n
fi
echo "== Relevant occurrences =="
rg -n "FirstElement|Children.toArray|wrap=\{false\}|SkillGrid|skillGrid|ResumeItem|`@react-pdf/renderer`" src/features/resume_pdf_download -S || trueRepository: YAPP-Github/28th-Web-Team-1-FE Length of output: 12033 🌐 Web query:
💡 Result: In Citations:
🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== ResumePdfDocument tail =="
sed -n '175,230p' src/features/resume_pdf_download/ui/ResumePdfDocument.tsx | cat -n
echo "== package dependencies =="
if [ -f package.json ]; then
node - <<'JS'
const fs = require('fs')
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'))
for (const sec of ['dependencies','devDependencies']) {
if (!pkg[sec]) continue
for (const [k,v] of Object.entries(pkg[sec])) {
if (k === '`@react-pdf/renderer`' || k === 'react-pdf') console.log(`${k}: ${v}`)
}
}
JS
fi
echo "== tests related to pdf/download =="
fd -i '.*pdf.*|.*download.*|.*resume.*' src test tests __tests__ 2>/dev/null | head -80 || true
rg -n "ResumePdfDocument|CoreSkill|CORE_SKILL|wrap=\{false\}|minPresenceAhead|Page" src test tests 2>/dev/null || trueRepository: YAPP-Github/28th-Web-Team-1-FE Length of output: 27744 첫 자녀 단위로
🤖 Prompt for AI AgentsSource: MCP tools |
||
| </View> | ||
| {rest.length > 0 && ( | ||
| <View style={styles.sectionLine}> | ||
| <View style={styles.sectionTitle} /> | ||
| <View style={styles.sectionBody}>{rest}</View> | ||
| </View> | ||
| )} | ||
| </View> | ||
| ) | ||
| } | ||
|
|
||
| /** | ||
| * 제목 + 부제(+ 선택적 본문) 구조의 공통 아이템 블록. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: YAPP-Github/28th-Web-Team-1-FE
Length of output: 30472
🌐 Web query:
TanStack Query v5 queryClient invalidateQueries returns Promise useMutation documentation💡 Result:
In TanStack Query v5, the queryClient.invalidateQueries method returns a Promise [1][2]. This Promise resolves once the invalidation process—which includes marking the matching queries as stale and potentially refetching active queries—has completed [1][3][4]. Awaiting this Promise is particularly useful when used within mutation callbacks like onSuccess [5][6]. By returning (or awaiting) this Promise inside the mutation lifecycle, you ensure that the mutation remains in a pending state (e.g., isPending remains true) until the invalidated queries have finished refetching [5][6]. Key points regarding this behavior: - Purpose of the Promise: It allows you to synchronize your code with the completion of the background refetching triggered by the invalidation [7][4]. - Mutation Integration: You can use async/await within useMutation callbacks (such as onSuccess) to wait for invalidations to finish before the mutation is considered fully settled [5][6]. - Granularity: If invalidating multiple queries, you can wrap multiple queryClient.invalidateQueries calls in Promise.all to await them all simultaneously [5][6]. Example usage within useMutation: const mutation = useMutation({ mutationFn: addTodo, onSuccess: async => { // Wait for the query to be invalidated and refetched await queryClient.invalidateQueries({ queryKey: ['todos'] }); }, });
Citations:
목록·카운트 무효화도 모두
await처리해 주세요.queryClient.invalidateQueries()는 TanStack Query v5에서 Promise를 반환하므로, 목록·카운트 무효화도Promise.all로 병렬 await해야 mutation 성공의 refetch 완료 시점이 보장됩니다.await queryClient.invalidateQueries({ queryKey: resumeKeys.detail(workspaceId, resumeId) }) - queryClient.invalidateQueries({ queryKey: resumeKeys.lists() }) - queryClient.invalidateQueries({ queryKey: resumeKeys.counts(workspaceId) }) + await Promise.all([ + queryClient.invalidateQueries({ queryKey: resumeKeys.lists() }), + queryClient.invalidateQueries({ queryKey: resumeKeys.counts(workspaceId) }) + ])📝 Committable suggestion
🤖 Prompt for AI Agents