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
28 changes: 25 additions & 3 deletions jobdri/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default function Home() {
);

// 🌟 작성 중인 모의지원(Drafts) 매핑
const mappedDrafts = inProgressList.map((item) => {
const mappedDrafts: DraftData[] = inProgressList.map((item) => {
const jobPosting = jobPostingById.get(item.jobPostingId);

return {
Expand All @@ -75,6 +75,9 @@ export default function Home() {
updatedAt: item.createdAt
? formatRelativeDate(item.createdAt)
: "-",
createdAtTime: item.createdAt
? new Date(item.createdAt).getTime()
: 0,
};
});

Expand All @@ -85,7 +88,7 @@ export default function Home() {
);

// 🌟 순수 채용 공고(Drafts) 매핑
const savedOnlyDrafts = jobPostings
const savedOnlyDrafts: DraftData[] = jobPostings
.filter(
(jobPosting) => !linkedJobPostingIds.has(jobPosting.jobPostingId),
)
Expand All @@ -102,6 +105,9 @@ export default function Home() {
updatedAt: jobPosting.createdAt
? formatRelativeDate(jobPosting.createdAt)
: "-",
createdAtTime: jobPosting.createdAt
? new Date(jobPosting.createdAt).getTime()
: 0,
}));

const mappedResults = completedList.map((item) => {
Expand All @@ -123,7 +129,23 @@ export default function Home() {
return cardData;
});

setDrafts([...savedOnlyDrafts, ...mappedDrafts]);
const sortedDrafts = [...savedOnlyDrafts, ...mappedDrafts].sort(
(a, b) => {
const timeDifference =
(b.createdAtTime ?? 0) - (a.createdAtTime ?? 0);

if (timeDifference !== 0) {
return timeDifference;
}

return (
(b.mockApplyId ?? b.jobPostingId) -
(a.mockApplyId ?? a.jobPostingId)
Comment on lines +141 to +143

Copy link
Copy Markdown

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

Add a final tie-breaker across ID namespaces.

mockApplyId and jobPostingId come from different sequences. If timestamps and numeric IDs match, this comparator returns 0, so the result is not fully deterministic. Add a final namespaced tie-breaker such as b.id.localeCompare(a.id).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@jobdri/src/app/page.tsx` around lines 141 - 143, Update the comparator in the
sorting callback around mockApplyId and jobPostingId to add a final
deterministic tie-breaker when the numeric comparison returns zero. Use the
records’ namespaced id values, ordering them consistently with the existing
descending sort, such as comparing b.id against a.id via localeCompare.

);
},
);

setDrafts(sortedDrafts);
setResults(mappedResults);
} catch (error) {
console.error("데이터를 불러오는데 실패했습니다.", error);
Expand Down
2 changes: 1 addition & 1 deletion jobdri/src/components/common/dropdown/DropDownMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default function DropDownMenu({
role="menuitem"
disabled={item.disabled}
onClick={item.onClick}
className="flex w-full items-center self-stretch border-b border-line-neutral-default bg-bg-contents-default px-4 py-3 text-left text-label14-med text-text-neutral-description [font-feature-settings:'liga'_off,'clig'_off] hover:bg-fill-quaternary-assistive-hover active:bg-fill-quaternary-default-pressed disabled:cursor-not-allowed disabled:text-text-neutral-disabled"
className="flex w-full items-center self-stretch border-b border-line-neutral-default bg-bg-contents-default px-4 py-3 text-left text-label14-med text-text-neutral-description [font-feature-settings:'liga'_off,'clig'_off] last:border-b-0 hover:bg-fill-quaternary-assistive-hover active:bg-fill-quaternary-default-pressed disabled:cursor-not-allowed disabled:text-text-neutral-disabled"
>
{item.label}
</button>
Expand Down
12 changes: 4 additions & 8 deletions jobdri/src/components/common/lnb/Lnb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export default function Lnb({
initialActiveItem = "apply",
email,
className,
defaultRecentOpen = true,
defaultRecentOpen = false,
disableCreditFetch = false,
}: LnbProps) {
const router = useRouter();
Expand Down Expand Up @@ -401,15 +401,11 @@ export default function Lnb({

{showComingSoonModal &&
createPortal(
<div className="fixed inset-0 z-[100] flex items-center justify-center bg-black/50">
<div className="fixed inset-0 z-[100] flex items-center justify-center bg-bg-lightbox-default">
<ModalNotice
variant="single"
layout="centered"
type="alertModal"
title="아직 준비중인 서비스입니다"
description={[
"더 나은 서비스를 위해 노력하고 있습니다!",
"조금만 기다려 주세요",
].join("\n")}
description={"더 나은 서비스를 위해 노력하고 있습니다!\n조금만 기다려 주세요"}
onClose={() => setShowComingSoonModal(false)}
primaryAction={{
label: "확인",
Expand Down
19 changes: 5 additions & 14 deletions jobdri/src/components/common/lnb/LnbShared.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -496,18 +496,9 @@ function RecentItemsSection({
function SearchEmptyState() {
return (
<div className="flex h-[200px] items-center justify-center gap-2.5 self-stretch">
<div className="flex flex-col items-center justify-center gap-5 p-0">
<div
className="h-20 w-20 shrink-0 border border-pink-400 bg-pink-100"
aria-hidden="true"
/>

<div className="flex flex-col items-center justify-center gap-2">
<p className="text-center text-b16-semibold text-text-neutral-caption [font-feature-settings:'liga'_off,'clig'_off]">
검색 결과가 없습니다
</p>
</div>
</div>
<p className="text-center text-b16-semibold text-text-neutral-caption [font-feature-settings:'liga'_off,'clig'_off]">
검색 결과가 없습니다
</p>
</div>
);
}
Expand Down Expand Up @@ -666,7 +657,7 @@ export function LnbDefaultFooter({
<div className="flex items-center justify-between self-stretch px-2 py-3">
<div ref={accountMenuRef} className="relative flex items-center gap-2">
{isAccountMenuOpen && (
<div className="absolute bottom-[calc(100%+5px)] left-0 z-50 flex w-[200px] flex-col items-start gap-0 rounded-toast-s border border-line-neutral-default bg-bg-lightbox-light p-1 shadow-card backdrop-blur-[2px]">
<div className="absolute bottom-[calc(100%+5px)] left-0 z-50 flex w-[200px] flex-col items-start gap-0 rounded-toast-s border border-line-neutral-default bg-bg-contents-default p-1 shadow-card">
<TextButton
label="로그아웃"
size="small"
Expand Down Expand Up @@ -762,7 +753,7 @@ export function LnbFoldedFooter({
<div className="flex items-center justify-center self-stretch py-3">
<div ref={accountMenuRef} className="relative">
{isAccountMenuOpen && (
<div className="absolute bottom-0 left-[calc(100%+12px)] z-50 flex w-[124px] flex-col items-start rounded-toast-s border border-line-neutral-default bg-bg-lightbox-light p-1 shadow-card backdrop-blur-[2px]">
<div className="absolute bottom-0 left-[calc(100%+12px)] z-50 flex w-[124px] flex-col items-start rounded-toast-s border border-line-neutral-default bg-bg-contents-default p-1 shadow-card">
<TextButton
label="로그아웃"
size="small"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function ResultApplicationCard({
if (isRetryDisabled) return;

setIsMenuOpen(false);
onRetryClick?.(); // 부모로부터 받은 다시하기 함수 실행
onRetryClick?.(); // 부모로부터 받은 재도전하기 함수 실행
};

return (
Expand Down Expand Up @@ -124,8 +124,10 @@ export function ResultApplicationCard({
<div className="flex items-end justify-between self-stretch mt-6">
<p className="text-cap12-med text-text-neutral-caption">{createdAt}</p>
<div className="flex flex-row justify-center items-end gap-0.5">
<p className="text-h24-bold">{score}</p>
<p className="text-label14-semibold">점</p>
<p className="text-h24-bold text-text-neutral-title">{score}</p>
<div className="flex items-center pb-0.5">
<p className="text-label14-semibold">점</p>
</div>
<Icon type="CHEVRON_R" className="text-icon-neutral-default" />
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions jobdri/src/components/mockApply/home/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ export interface DraftData {
position: string;
currentStep: number;
updatedAt: string;
createdAtTime?: number;
// logoUrl?: string; // 실제 API에서는 로고 이미지 URL을 받을 수 있습니다.
}