Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions src/screens/analysis/AnalysisScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2917,21 +2917,22 @@ const AnalysisScreen = ({ navigation }: any) => {
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#1c1c1c",
backgroundColor: colors.background,
},
header: {
height: 50,
justifyContent: "center",
alignItems: "center",
paddingHorizontal: 20,
paddingTop: 16,
paddingBottom: 16,
paddingVertical: 16,
borderBottomWidth: 1,
borderBottomColor: colors.border,
backgroundColor: colors.background,
position: "relative",
},
headerTitle: {
fontSize: 18,
fontWeight: "600",
color: "#ffffff",
fontSize: 20,
fontWeight: "700",
color: colors.text,
},
content: {
flex: 1,
Expand All @@ -2940,6 +2941,7 @@ const styles = StyleSheet.create({
maxWidth: 400,
alignSelf: "center",
width: "100%",
paddingTop: 12,
paddingHorizontal: 20,
paddingBottom: 100,
},
Expand Down
11 changes: 7 additions & 4 deletions src/screens/chatbot/ChatbotScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,10 @@ const ChatbotScreen = ({ navigation }: any) => {
<View
style={[
styles.chatinputContainer,
{ paddingBottom: insets.bottom > 0 ? Math.max(insets.bottom, 4) : 4 },
{
// 하단바와 적당한 거리 유지
paddingBottom: 5,
},
]}
>
<TextInput
Expand Down Expand Up @@ -631,7 +634,7 @@ const styles = StyleSheet.create({
},
scrollViewContent: {
flexGrow: 1,
paddingBottom: 10,
paddingBottom: 0,
},
mainContent: {
flex: 1,
Expand Down Expand Up @@ -800,7 +803,7 @@ const styles = StyleSheet.create({
borderRadius: 12,
},
messagesContainer: {
paddingBottom: 10,
paddingBottom: 4,
},
message: {
maxWidth: "80%",
Expand Down Expand Up @@ -831,7 +834,7 @@ const styles = StyleSheet.create({
chatinputContainer: {
flexDirection: "row",
paddingHorizontal: 10,
paddingTop: 8,
paddingTop: 6,
backgroundColor: NEW_COLORS.card_bg,
borderTopWidth: 1,
borderTopColor: NEW_COLORS.separator,
Expand Down
32 changes: 31 additions & 1 deletion src/screens/exercise/ExerciseScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ interface Activity {
externalId?: string; // 운동/스트레칭 외부 ID
saveTitle?: string;
groupKey?: string;
category?: string;
title?: string;
targetMuscle?: string;
bodyPart?: string;
}

const DETAIL_TIME_REGEX = /(오전|오후)\s*\d{1,2}:\d{2}/gi;

Choose a reason for hiding this comment

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

코드 리뷰 코멘트

  1. 변경 사항: 코드에 새로운 필드 category, title, targetMuscle, bodyPart가 추가되었습니다.

    • 추가된 필드들은 Activity 인터페이스의 일부로, 타입이 정의되지 않았습니다. 이들 필드의 타입을 명시하는 것이 좋습니다. 예를 들어, categorystring 타입이어야 하는데 해당정보가 없습니다.
  2. 의미적 명확성: 추가된 각 프로퍼티들에 대한 주석이 없으므로, 이들의 목적과 사용하는 곳에서의 적절한 사용법에 대한 문서화가 필요합니다. 어떤 값을 기대하는지, 어떤 상황에서 사용하는지 명확히 해야 합니다.

  3. 정규 표현식: DETAIL_TIME_REGEX에 대한 오류는 없어 보이나, 주석 또는 설명이 없다면 이 정규 표현식의 목적과 사용할 때의 주의 사항을 명시해주는 것이 좋습니다.

  4. 일관성 검토: 인터페이스에 새 필드를 추가할 때, 기존의 필드와 일관성 있는 네이밍 컨벤션을 사용하는 것이 중요합니다. targetMusclebodyPart는 특정한 분야의 내용이라, 문맥에 따라 혼란스러울 수 있으니 주석을 통해 명확하게 해주세요.

  5. 테스트 추가: 코드에 변경이 있을 경우, 새로운 필드들이 의도하는 대로 사용되는지 확인하기 위한 단위 테스트 및 통합 테스트가 필요합니다. 이 변경이 다른 부분에 미치는 영향을 명확히 파악할 수 있도록 해야 합니다.

결론적으로, 코드는 기본적인 구조를 갖추고 있으나, 명확성, 타입 정의, 문서화, 테스트 등에 개선이 필요합니다.

Expand Down Expand Up @@ -1101,7 +1105,19 @@ const ExerciseScreen = ({ navigation }: any) => {

try {
const response = await getTodayWorkoutTime(finalUserId);
setTodayTotalWorkoutSeconds(response.totalSeconds || 0);
console.log("[EXERCISE][TIME] getTodayWorkoutTime 응답 받음:", {
totalSeconds: response.totalSeconds,
response,
});
const totalSeconds = response.totalSeconds || 0;
setTodayTotalWorkoutSeconds(totalSeconds);

// 달력의 오늘 운동 시간도 즉시 반영
const todayStr = formatDateToString(new Date());
setDailyWorkoutSeconds((prev) => ({
...prev,
[todayStr]: totalSeconds,
}));
} catch (e) {
console.error("[EXERCISE][TIME] 오늘 운동 시간 조회 실패:", e);
setTodayTotalWorkoutSeconds(0);
Expand Down Expand Up @@ -3725,6 +3741,13 @@ const ExerciseScreen = ({ navigation }: any) => {
prev.filter((activity) => activity.id !== workoutId)
);

// 진행률 및 달력 데이터 새로고침
await loadTodayProgress();
await loadWeeklyCalories();
if (workoutDate) {
await loadCalendarCalories([workoutDate]);
}

// eventBus로 운동 삭제 이벤트 발생 (캘린더 새로고침용)
eventBus.emit("workoutSessionDeleted", {
sessionId: sessionId || null,
Expand Down Expand Up @@ -3817,6 +3840,11 @@ const ExerciseScreen = ({ navigation }: any) => {
// 오늘 날짜라면 홈/분석 쪽에서도 시간이 바로 0으로 반영되도록
try {
await loadTodayWorkoutTime();
await loadTodayProgress();
await loadWeeklyCalories();
if (targetDateStr) {
await loadCalendarCalories([targetDateStr]);
}
} catch (e) {
console.error(
"[WORKOUT][DELETE_ALL] 오늘 운동 시간 재조회 실패:",
Expand Down Expand Up @@ -4509,6 +4537,8 @@ const ExerciseScreen = ({ navigation }: any) => {
try {
await loadTodayWorkoutTime(); // ✅ 오늘 운동 시간 업데이트
await loadWeeklyCalories();
const todayStr = formatDateToString(new Date());
await loadCalendarCalories([todayStr]); // ✅ 오늘 캘린더 운동시간 갱신
} catch (error) {
console.error(
"[PROGRESS] 운동 완료 후 주간 진행률 새로고침 실패:",
Expand Down
Loading