fix: QA 버그 5건 수정 — 뒤로 가기로 시트 닫기, 로그인 후 댓글 복귀, 터치 영역 44px, 순위 대기 칩 비활성, 위치 찾기 후 지역 시트 닫기

This commit is contained in:
minaChoi committed 2026-10-08 09:18:05 +09:00
1 parent 471353212a
commit f1846ddf66
8 files changed
+72 -33

No files matched your search

+5 -5
View File
@@ -116,11 +116,11 @@
| [x] | 공유 이미지: 카드 아래 긴 제목이 한 줄 폭에 눌려 찌그러짐 — 두 줄 나눔 또는 말줄임 | 공유 이미지 점검 (10/7) | `frontend/src/b/storyImage.ts` (`fillText`) |
| [x] | 공유 이미지: 카드 아래 제목을 빼고 주소 알약으로 바꿈 (시안 A, 사용자 결정). 카드 안 제목과 카드 아래 제목이 같아 두 번 보임. 아래 줄을 뺄지, 다른 말(지역·날짜)로 바꿀지 정하기 | 공유 이미지 점검 (10/7) | `frontend/src/b/storyImage.ts` |
| [x] | 노치(아이폰 상단 카메라 영역) 대응 — 화면 위·아래가 노치·홈 막대에 가리지 않게 safe-area 여백 점검 | 사용자 요청 | `frontend/index.html`, `frontend/src/b/BLayout.tsx` |
| [ ] | 안드로이드 뒤로 가기: 시트가 열려 있을 때 시트만 닫히지 않고 페이지가 뒤로 감 (방문 기록 미사용) | QA 작성 중 발견 (10/8) | `frontend/src/b/Sheets.tsx:53` |
| [ ] | 로그아웃 상태에서 댓글 "게시" → 로그인 시트 → 로그인 후 시트가 닫혀 쓰던 댓글이 사라지고 댓글 화면으로 안 돌아옴 | QA 작성 중 발견 (10/8) | `frontend/src/b/Sheets.tsx:662`, `:753` |
| [ ] | 터치 영역 44px 미만 — 포스트 하트·댓글·보내기 28px, 댓글 하트 약 16px, 시트 × 30px | QA 작성 중 발견 (10/8) | `frontend/src/b/Post.tsx:426`, `frontend/src/b/Sheets.tsx:637`, `:96` |
| [ ] | 주말 순위 로드 실패 시 토/일 칩이 눌리는 것처럼 보이지만 동작 없음 | QA 작성 중 발견 (10/8) | `frontend/src/b/WeekPage.tsx:278` |
| [ ] | **[결정 필요]** "지금 위치로 찾기" 성공 후 지역 시트가 안 닫힘 (목록에서 고르면 닫힘) — 닫을지 정하기 | QA 작성 중 발견 (10/8) | `frontend/src/b/region.tsx:44`, `frontend/src/b/Sheets.tsx:938` |
| [x] | 안드로이드 뒤로 가기: 시트가 열려 있을 때 시트만 닫히지 않고 페이지가 뒤로 감 (방문 기록 미사용) | QA 작성 중 발견 (10/8) | `frontend/src/b/Sheets.tsx:53` |
| [x] | 로그아웃 상태에서 댓글 "게시" → 로그인 시트 → 로그인 후 시트가 닫혀 쓰던 댓글이 사라지고 댓글 화면으로 안 돌아옴 | QA 작성 중 발견 (10/8) | `frontend/src/b/Sheets.tsx:662`, `:753` |
| [x] | 터치 영역 44px 미만 — 포스트 하트·댓글·보내기 28px, 댓글 하트 약 16px, 시트 × 30px | QA 작성 중 발견 (10/8) | `frontend/src/b/Post.tsx:426`, `frontend/src/b/Sheets.tsx:637`, `:96` |
| [x] | 주말 순위 로드 실패 시 토/일 칩이 눌리는 것처럼 보이지만 동작 없음 | QA 작성 중 발견 (10/8) | `frontend/src/b/WeekPage.tsx:278` |
| [x] | "지금 위치로 찾기" 성공 후 지역 시트가 안 닫힘 (목록에서 고르면 닫힘) — 닫을지 정하기 | QA 작성 중 발견 (10/8) | `frontend/src/b/region.tsx:44`, `frontend/src/b/Sheets.tsx:938` |
| [ ] | **[결정 필요]** 홈 화면 상태바 색(`theme-color`)이 낮 하늘색 고정 — 밤 테마 등 시간대 따라 바꿀지 | 노치 대응 중 발견 (10/8) | `frontend/index.html` |
| [ ] | **[결정 필요]** 데이트 명소: 서울 기존 10곳(직접 고른 곳)을 거리순과 상관없이 앞에 고정할지 | 데이트 명소 전국 확대 (10/8) | `backend/services/week_service.py` (`pick_places`) |
| [ ] | 데이트 명소: 14개 구는 30km 안 실내 명소가 없어 비 오는 날에도 야외만 나옴 | 데이트 명소 전국 확대 (10/8) | `backend/seed/place_tourapi.csv` |
+4 -4
View File
@@ -11,7 +11,7 @@ import { useAuth } from './authContext'
import { useSheet } from './sheetContext'
import { CommentIcon, HeartIcon, SendIcon } from './svg'
import { useCarousel } from './carousel'
import { Arrows, Credit, Ic, Rows, Skel, Thumb } from './ui'
import { Arrows, Credit, Ic, Rows, Skel, TAP44, Thumb } from './ui'
const ACCOUNTS: Record<PostType, readonly [string, string]> = {
[PostType.WEATHER]: ['오늘 날씨', 'sun'],
@@ -423,13 +423,13 @@ function FullCard({ post }: PostProps) {
)}
</div>
<div className="flex items-center gap-3.5 px-3 pt-2.5 pb-1 [&_svg]:size-[26px] [&_svg]:stroke-[1.9]">
<button type="button" onClick={() => setLike(!liked)} aria-pressed={liked} aria-label="좋아요" className="grid size-7 cursor-pointer place-items-center">
<button type="button" onClick={() => setLike(!liked)} aria-pressed={liked} aria-label="좋아요" className={cx('relative grid size-7 cursor-pointer place-items-center', TAP44)}>
<HeartIcon className={liked ? 'fill-(--heart) stroke-(--heart)' : 'fill-none stroke-(--ink)'} />
</button>
<button type="button" onClick={comments} aria-label="댓글 보기" className="grid size-7 cursor-pointer place-items-center">
<button type="button" onClick={comments} aria-label="댓글 보기" className={cx('relative grid size-7 cursor-pointer place-items-center', TAP44)}>
<CommentIcon className="fill-none stroke-(--ink) [stroke-linejoin:round]" />
</button>
<button type="button" onClick={share} aria-label="보내기" className="grid size-7 cursor-pointer place-items-center">
<button type="button" onClick={share} aria-label="보내기" className={cx('relative grid size-7 cursor-pointer place-items-center', TAP44)}>
<SendIcon className="fill-none stroke-(--ink) [stroke-linecap:round] [stroke-linejoin:round]" />
</button>
</div>
+46 -14
View File
@@ -28,16 +28,39 @@ import { useSky } from './skyContext'
import { SHARE_SIZES, shareImage, type ShareSize } from './storyImage'
import { SheetContext, useSheet, type SharePayload, type SheetState } from './sheetContext'
import { HeartIcon } from './svg'
import { Avatar, Ic, Skel, StateBox, Thumb } from './ui'
import { Avatar, Ic, Skel, StateBox, TAP44, Thumb } from './ui'
export function SheetProvider({ children }: { children: ReactNode }) {
const [state, setState] = useState<SheetState>(null)
const open = useCallback((s: Exclude<SheetState, null>) => setState(s), [])
const close = useCallback(() => setState(null), [])
// 창이 열려 있는 동안 방문 기록을 하나 쌓아 두어 뒤로 가기가 창만 닫게 한다
const pushed = useRef(false)
const open = useCallback((s: Exclude<SheetState, null>) => {
if (!pushed.current) {
window.history.pushState({ ...window.history.state, sheet: true }, '')
pushed.current = true
}
setState(s)
}, [])
const close = useCallback(() => {
setState(null)
if (!pushed.current) return
pushed.current = false
window.history.back()
}, [])
const api = useMemo(() => ({ open, close }), [open, close])
useEffect(() => {
const onPop = () => {
if (!pushed.current) return
pushed.current = false
setState(null)
}
window.addEventListener('popstate', onPop)
return () => window.removeEventListener('popstate', onPop)
}, [])
// 로그인이 필요한 요청이 401을 받으면 로그인 창을 띄운다
useEffect(() => subscribeAuth((reason) => reason === 'required' && setState({ type: 'login' })), [])
useEffect(() => subscribeAuth((reason) => reason === 'required' && open({ type: 'login' })), [open])
return (
<SheetContext value={api}>
@@ -53,6 +76,7 @@ const TITLES = { article: '읽을거리', seasonWeek: '이번 주 특집', share
function SheetHost({ state, onClose }: { state: SheetState; onClose: () => void }) {
const ref = useRef<HTMLDialogElement>(null)
const { kind } = useSky()
const { open } = useSheet()
const [gakTitle, setGakTitle] = useState('')
const [articleTitle, setArticleTitle] = useState('')
@@ -75,6 +99,7 @@ function SheetHost({ state, onClose }: { state: SheetState; onClose: () => void
}
}, [isOpen])
const then = state?.type === 'login' ? state.then : undefined
const title = !state ? '' : state.type === 'gak' ? gakTitle : state.type === 'article' ? articleTitle || TITLES.article : TITLES[state.type]
return (
@@ -93,7 +118,7 @@ function SheetHost({ state, onClose }: { state: SheetState; onClose: () => void
<div className="relative border-b border-(--line) px-4 pt-2 pb-2.5 text-center">
<div className="mx-auto mb-2.5 h-1 w-10 rounded-full bg-(--line)" aria-hidden="true" />
<h3 className="m-0 text-[15px] font-extrabold">{title}</h3>
<button type="button" onClick={onClose} aria-label="닫기" className="absolute right-3 bottom-2 grid size-[30px] cursor-pointer place-items-center text-xl text-(--ink2)">
<button type="button" onClick={onClose} aria-label="닫기" className={cx('absolute right-3 bottom-2 grid size-[30px] cursor-pointer place-items-center text-xl text-(--ink2)', TAP44)}>
×
</button>
</div>
@@ -101,8 +126,8 @@ function SheetHost({ state, onClose }: { state: SheetState; onClose: () => void
{state.type === 'article' && <ArticleSheet articleId={state.articleId} onTitle={setArticleTitle} />}
{state.type === 'seasonWeek' && <SeasonWeekSheet />}
{state.type === 'share' && <ShareSheet share={state.share} />}
{state.type === 'comments' && <CommentsSheet postId={state.postId} />}
{state.type === 'login' && <LoginSheet onDone={onClose} />}
{state.type === 'comments' && <CommentsSheet postId={state.postId} draft={state.draft} />}
{state.type === 'login' && <LoginSheet onDone={onClose} onLoggedIn={then ? () => open(then) : onClose} />}
{state.type === 'me' && <MeSheet onDone={onClose} />}
{state.type === 'region' && <RegionSheet onDone={onClose} />}
</div>
@@ -632,14 +657,14 @@ function CommentRow({ c, postId }: { c: CommentData; postId: number }) {
)}
</small>
</div>
<button type="button" onClick={toggle} aria-pressed={liked} aria-label="댓글 좋아요" className="cursor-pointer pt-1">
<button type="button" onClick={toggle} aria-pressed={liked} aria-label="댓글 좋아요" className={cx('relative cursor-pointer pt-1', TAP44)}>
<HeartIcon className={cx('size-4 stroke-2', liked ? 'fill-(--heart) stroke-(--heart)' : 'fill-none stroke-(--ink3)')} />
</button>
</div>
)
}
function CommentsSheet({ postId }: { postId: number }) {
function CommentsSheet({ postId, draft }: { postId: number; draft?: string }) {
const { region } = useRegion()
const { open } = useSheet()
const { loggedIn, me } = useAuth()
@@ -651,13 +676,13 @@ function CommentsSheet({ postId }: { postId: number }) {
})
const add = useMutation(addCommentMutation())
const [addFailed, setAddFailed] = useState(false)
const [text, setText] = useState('')
const [text, setText] = useState(draft ?? '')
const inputRef = useRef<HTMLInputElement>(null)
const comments = list.data?.pages.flatMap((p) => p.comments ?? []) ?? []
const submit = (e: FormEvent) => {
e.preventDefault()
if (!loggedIn) return open({ type: 'login' })
if (!loggedIn) return open({ type: 'login', then: { type: 'comments', postId, draft: text } })
const body = text.trim()
if (!body || add.isPending) return
setAddFailed(false)
@@ -731,7 +756,7 @@ const AUTH_ERRORS: Record<string, string> = {
INVALID_INPUT: '아이디는 영어 소문자·숫자·_ 4~20자, 비밀번호는 8~64자, 닉네임은 2~12자로 써 주세요.',
}
function LoginSheet({ onDone }: { onDone: () => void }) {
function LoginSheet({ onDone, onLoggedIn }: { onDone: () => void; onLoggedIn: () => void }) {
const { me } = useAuth()
const [mode, setMode] = useState<'login' | 'signup'>('login')
const [loginId, setLoginId] = useState('')
@@ -748,7 +773,7 @@ function LoginSheet({ onDone }: { onDone: () => void }) {
return
}
setTokens(res.access_token, res.refresh_token ?? null)
onDone()
onLoggedIn()
}
const fail = () => setError('서버에 닿지 못했어요. 잠시 뒤에 다시 해 주세요.')
@@ -925,6 +950,13 @@ function RegionSheet({ onDone }: { onDone: () => void }) {
const { region, setRegion, locate, locateStatus } = useRegion()
const { me, logout } = useAuth()
const { open } = useSheet()
const alive = useRef(true)
useEffect(() => {
alive.current = true
return () => {
alive.current = false
}
}, [])
const [q, setQ] = useState('')
const deferred = useDeferredValue(q.trim())
const list = useQuery(listRegionsOptions(deferred ? { query: { q: deferred } } : undefined))
@@ -933,7 +965,7 @@ function RegionSheet({ onDone }: { onDone: () => void }) {
return (
<Body>
<button type="button" onClick={locate} disabled={locateStatus === 'locating'} className="w-full cursor-pointer rounded-full bg-(--orange) p-3 font-jua text-[17px] text-white shadow-[inset_0_-5px_0_var(--orange-deep)] disabled:opacity-60">
<button type="button" onClick={() => locate(() => alive.current && onDone())} disabled={locateStatus === 'locating'} className="w-full cursor-pointer rounded-full bg-(--orange) p-3 font-jua text-[17px] text-white shadow-[inset_0_-5px_0_var(--orange-deep)] disabled:opacity-60">
지금 위치로 찾기
</button>
<p className="mt-2 min-h-5 text-center text-[13px] font-bold text-(--ink2)" aria-live="polite">
+1 -1
View File
@@ -273,7 +273,7 @@ export function WeekPage() {
{rankDays.length ? (
<Chips label="순위 볼 날" items={rankDays.map((d) => [d.day, `${d.weekday}요일 ${shortDay(d.day)}`] as const)} value={rankDay?.day ?? ''} onChange={setRankPick} />
) : (
<Chips label="순위 볼 날" items={RANK_TABS_HOLD} value="토" onChange={() => {}} />
<Chips label="순위 볼 날" items={RANK_TABS_HOLD} value="토" onChange={() => {}} disabled />
)}
{rankItems.length ? (
<ul className={cx('mx-3 mt-1.5 flex flex-col transition-opacity', ranking.isPlaceholderData && 'opacity-60')}>
+4 -3
View File
@@ -35,7 +35,7 @@ export function RegionProvider({ children }: { children: ReactNode }) {
writeStored(r)
}, [])
const findNearest = useCallback(() => {
const findNearest = useCallback((onFound?: () => void) => {
navigator.geolocation.getCurrentPosition(
(pos) => {
nearestRegion({ query: { lat: pos.coords.latitude, lon: pos.coords.longitude } })
@@ -43,6 +43,7 @@ export function RegionProvider({ children }: { children: ReactNode }) {
if (!res.region) throw new Error('가까운 구를 찾지 못함')
setRegion(res.region)
setLocateStatus('idle')
onFound?.()
})
.catch(() => setLocateStatus('error'))
},
@@ -51,13 +52,13 @@ export function RegionProvider({ children }: { children: ReactNode }) {
)
}, [setRegion])
const locate = useCallback(() => {
const locate = useCallback((onFound?: () => void) => {
if (!canLocate) {
setLocateStatus('error')
return
}
setLocateStatus('locating')
findNearest()
findNearest(onFound)
}, [canLocate, findNearest])
// 처음 온 사람만 위치 권한을 물어 가장 가까운 구로 맞춘다
+1 -1
View File
@@ -3,7 +3,7 @@ import type { RegionData } from '../api/client/types.gen'
export type LocateStatus = 'idle' | 'locating' | 'denied' | 'error'
export type RegionApi = { region: RegionData; setRegion: (r: RegionData) => void; locate: () => void; locateStatus: LocateStatus }
export type RegionApi = { region: RegionData; setRegion: (r: RegionData) => void; locate: (onFound?: () => void) => void; locateStatus: LocateStatus }
export const DEFAULT_REGION: RegionData = { code: '1144000000', name: '서울 마포구', short_name: '마포구', lat: 37.56071, lon: 126.91053 }
+4 -2
View File
@@ -1,13 +1,15 @@
import { createContext, use } from 'react'
export type SharePayload = { title: string; slides: HTMLElement[] }
type CommentsState = { type: 'comments'; postId: number; draft?: string }
export type SheetState =
| { type: 'gak'; indexId: number }
| { type: 'article'; articleId: number }
| { type: 'share'; share: SharePayload }
| { type: 'comments'; postId: number }
| CommentsState
| { type: 'seasonWeek' }
| { type: 'login' }
| { type: 'login'; then?: CommentsState }
| { type: 'me' }
| { type: 'region' }
| null
+7 -3
View File
@@ -109,9 +109,12 @@ export function Rail({ children, className, label }: { children: ReactNode; clas
)
}
type ChipsProps<K extends string> = { items: readonly (readonly [K, string])[]; value: K; onChange: (k: K) => void; label: string }
// 보이는 크기는 두고 누르는 영역만 가운데 44×44로 넓힌다 (위치 지정된 요소에 붙인다)
export const TAP44 = 'after:absolute after:top-1/2 after:left-1/2 after:size-11 after:-translate-1/2'
export function Chips<K extends string>({ items, value, onChange, label }: ChipsProps<K>) {
type ChipsProps<K extends string> = { items: readonly (readonly [K, string])[]; value: K; onChange: (k: K) => void; label: string; disabled?: boolean }
export function Chips<K extends string>({ items, value, onChange, label, disabled }: ChipsProps<K>) {
return (
<ChipStrip label={label}>
{items.map(([k, l]) => (
@@ -119,8 +122,9 @@ export function Chips<K extends string>({ items, value, onChange, label }: Chips
key={k}
type="button"
aria-pressed={value === k}
disabled={disabled}
onClick={() => onChange(k)}
className={cx('shrink-0 cursor-pointer rounded-full px-3.5 py-[7px] text-[13.5px] font-bold', value === k ? 'bg-(--ink) text-white' : 'bg-white text-(--ink2) shadow-[inset_0_-3px_0_var(--shade)]')}
className={cx('shrink-0 cursor-pointer rounded-full disabled:cursor-default px-3.5 py-[7px] text-[13.5px] font-bold', value === k ? 'bg-(--ink) text-white' : 'bg-white text-(--ink2) shadow-[inset_0_-3px_0_var(--shade)]')}
>
{l}
</button>