feat(api): 세션·통계·설정 API 연동 기반을 추가
맥락: - 실제 세션 엔진과 통계·설정 저장을 백엔드와 연결할 프론트 API 경계를 먼저 정리할 필요가 있었다. 변경사항: - focus session, stats, preferences API 계층과 타입을 추가하고 메서드 주석에 Backend Codex 지시 사항을 작성했다. - /space를 현재 세션 조회, 시작, 일시정지, 재개, 다시 시작, 완료, 종료 API 흐름에 연결하고 API 실패 시 로컬 미리보기 fallback을 유지했다. - /stats와 /settings를 API 기반 fetch/save 구조로 전환하고 auth/apiClient를 보강했다. - React 19 규칙에 맞게 관련 훅과 HUD/시트 구현을 정리해 lint/build가 통과하도록 보정했다. 검증: - npm run lint - npm run build 세션-상태: 프론트에서 세션·통계·설정 API를 호출할 준비가 된 상태 세션-다음: 백엔드가 주석에 맞춘 엔드포인트와 응답 스키마를 구현하도록 협업 세션-리스크: 실제 서버 응답 필드명이 현재 타입과 다르면 프론트 매핑 조정이 추가로 필요
This commit is contained in:
@@ -42,23 +42,30 @@ export const SpaceSideSheet = ({
|
||||
}
|
||||
|
||||
if (open) {
|
||||
setShouldRender(true);
|
||||
let nestedRaf = 0;
|
||||
const raf = window.requestAnimationFrame(() => {
|
||||
setVisible(true);
|
||||
setShouldRender(true);
|
||||
nestedRaf = window.requestAnimationFrame(() => {
|
||||
setVisible(true);
|
||||
});
|
||||
});
|
||||
|
||||
return () => {
|
||||
window.cancelAnimationFrame(raf);
|
||||
window.cancelAnimationFrame(nestedRaf);
|
||||
};
|
||||
}
|
||||
|
||||
setVisible(false);
|
||||
const hideRaf = window.requestAnimationFrame(() => {
|
||||
setVisible(false);
|
||||
});
|
||||
closeTimerRef.current = window.setTimeout(() => {
|
||||
setShouldRender(false);
|
||||
closeTimerRef.current = null;
|
||||
}, transitionMs);
|
||||
|
||||
return () => {
|
||||
window.cancelAnimationFrame(hideRaf);
|
||||
if (closeTimerRef.current) {
|
||||
window.clearTimeout(closeTimerRef.current);
|
||||
closeTimerRef.current = null;
|
||||
|
||||
Reference in New Issue
Block a user