Skip to content
Open
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
12 changes: 10 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,11 @@ export const App = () => {
account={composeAccount}
api={services.api}
onSubmit={handleSubmit}
replyingTo={replyTarget ? { id: replyTarget.id, summary: replySummary ?? "" } : null}
replyingTo={
replyTarget
? { id: replyTarget.id, summary: replySummary ?? "", spoilerText: replyTarget.spoilerText }
: null
}
Comment on lines +1154 to +1158
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

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

동일한 replyingTo 객체 리터럴을 이 컴포넌트 내에서 2곳(사이드 ComposeBox, MobileComposeMenu)에서 중복 생성하고 있습니다. const replyingTo = ...처럼 한 번만 만들고 재사용하면 필드 추가 시 누락/불일치 위험을 줄일 수 있습니다.

Copilot uses AI. Check for mistakes.
onCancelReply={() => {
setReplyTarget(null);
setMentionSeed(null);
Expand Down Expand Up @@ -1343,7 +1347,11 @@ export const App = () => {
composeAccountSelector={composeAccountSelector}
api={services.api}
onSubmit={handleSubmit}
replyingTo={replyTarget ? { id: replyTarget.id, summary: replySummary ?? "" } : null}
replyingTo={
replyTarget
? { id: replyTarget.id, summary: replySummary ?? "", spoilerText: replyTarget.spoilerText }
: null
}
onCancelReply={() => {
setReplyTarget(null);
setMentionSeed(null);
Expand Down
17 changes: 16 additions & 1 deletion src/ui/components/ComposeBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const ComposeBox = ({
files: File[];
spoilerText: string;
}) => Promise<boolean>;
replyingTo: { id: string; summary: string } | null;
replyingTo: { id: string; summary: string; spoilerText: string } | null;
onCancelReply: () => void;
mentionText: string | null;
accountSelector?: React.ReactNode;
Comment on lines 50 to 55
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

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

replyingTo의 shape를 { id; summary; spoilerText } 인라인 타입으로 여러 컴포넌트에서 반복 정의하고 있어, 필드 추가/변경 시 누락이 발생하기 쉽습니다(이번 변경도 그 케이스). 공용 타입(예: ReplyTarget/ReplyingTo type alias)을 한 곳에 정의해 ComposeBox/MobileComposeMenu/App에서 재사용하도록 정리하는 게 유지보수에 안전합니다.

Copilot uses AI. Check for mistakes.
Expand Down Expand Up @@ -302,6 +302,21 @@ export const ComposeBox = ({
}
}, [mentionText]);

useEffect(() => {
if (!replyingTo) {
setCwEnabled(false);
setCwText("");
return;
}
if (!replyingTo.spoilerText) {
setCwEnabled(false);
setCwText("");
return;
}
setCwEnabled(true);
setCwText(replyingTo.spoilerText);
}, [replyingTo?.id, replyingTo?.spoilerText]);

// 이모지 패널이 열리면 이모지 로드
useEffect(() => {
if (emojiPanelOpen && account) {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/components/MobileMenus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type MobileComposeMenuProps = {
files: File[];
spoilerText: string;
}) => Promise<boolean>;
replyingTo: { id: string; summary: string } | null;
replyingTo: { id: string; summary: string; spoilerText: string } | null;
onCancelReply: () => void;
mentionText: string | null;
};
Expand Down
Loading