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
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import { cn } from "@repo/timo-design-system/utils";
import type {
TodoPriorityTypes,
TodoTimerStatusTypes,
} from "@/app/(main)/home/_types/todo-type";
} from "@/app/[locale]/(main)/home/_types/todo-type";

import { convertDurationToTimeText } from "@/app/(main)/home/_utils/todo-time";
import { convertDurationToTimeText } from "@/app/[locale]/(main)/home/_utils/todo-time";

const PRIORITY_MAP: Record<
TodoPriorityTypes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
import { AddTaskButton } from "@repo/timo-design-system/ui";
import { useState } from "react";

import type { Todo } from "@/app/(main)/home/_types/todo-type";
import type { Todo } from "@/app/[locale]/(main)/home/_types/todo-type";

import { HomeDateInformation } from "@/app/(main)/home/_components/HomeDateInformation";
import { HomeTodoCard } from "@/app/(main)/home/_components/HomeTodoCard";
import { todoMocks } from "@/app/(main)/home/_mocks/todo-mock";
import { HomeDateInformation } from "@/app/[locale]/(main)/home/_components/HomeDateInformation";
import { HomeTodoCard } from "@/app/[locale]/(main)/home/_components/HomeTodoCard";
import { todoMocks } from "@/app/[locale]/(main)/home/_mocks/todo-mock";
import {
convertDateToDateText,
convertDateToDayOfWeek,
} from "@/app/(main)/home/_utils/date";
} from "@/app/[locale]/(main)/home/_utils/date";

export const HomeTodoContainer = () => {
const [todos, setTodos] = useState<Todo[]>(todoMocks);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Todo } from "@/app/(main)/home/_types/todo-type";
import { Todo } from "@/app/[locale]/(main)/home/_types/todo-type";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

타입 전용 import에는 import type을 붙여주세요.

Todo는 타입으로만 쓰이는데, 같은 계층의 HomeTodoContainer.tsx(Line 6)는 import type { Todo }를 쓰는 반면 여기는 값 import 구문을 그대로 쓰고 있어요. 사소하지만 번들 최적화와 일관성을 위해 맞춰주시면 좋을 것 같습니다.

💡 제안
-import { Todo } from "`@/app/`[locale]/(main)/home/_types/todo-type";
+import type { Todo } from "`@/app/`[locale]/(main)/home/_types/todo-type";

관련 문서: TypeScript - import type

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import { Todo } from "@/app/[locale]/(main)/home/_types/todo-type";
import type { Todo } from "`@/app/`[locale]/(main)/home/_types/todo-type";
🤖 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 `@apps/timo-web/app/`[locale]/(main)/home/_mocks/todo-mock.ts at line 1, The
Todo import in the todo-mock module is type-only but is currently written as a
value import, so update the existing import to use type-only syntax for
consistency and better bundling. Keep the change localized to the Todo import in
todo-mock and match the pattern already used in HomeTodoContainer.tsx by making
the import explicitly type-only.


export const todoMocks: Todo[] = [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { HomeTodoContainer } from "@/app/(main)/home/_containers/HomeTodoContainer";
import { HomeTodoContainer } from "@/app/[locale]/(main)/home/_containers/HomeTodoContainer";

export default function HomePage() {
return (
Expand Down
File renamed without changes.
51 changes: 51 additions & 0 deletions apps/timo-web/app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import "./globals.css";
import localFont from "next/font/local";
import { notFound } from "next/navigation";
import { hasLocale, NextIntlClientProvider } from "next-intl";

import type { Metadata } from "next";

import { routing } from "@/i18n/routing";
import { QueryProvider } from "@/providers/QueryProvider";

const pretendard = localFont({
src: "../../fonts/PretendardVariable.woff2",
variable: "--font-family-pretendard",
weight: "45 920",
display: "swap",
});

export const metadata: Metadata = {
title: "Timo",
description: "Timo web",
};

interface RootLayoutProps {
children: React.ReactNode;
params: Promise<{ locale: string }>;
}

export function generateStaticParams() {
return routing.locales.map((locale) => ({ locale }));
}

export default async function RootLayout({
children,
params,
}: Readonly<RootLayoutProps>) {
const { locale } = await params;

if (!hasLocale(routing.locales, locale)) {
notFound();
}

return (
<html lang={locale} className={pretendard.variable}>
<body>
<NextIntlClientProvider>
<QueryProvider>{children}</QueryProvider>
</NextIntlClientProvider>
</body>
</html>
);
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default function Home() {
return <>Hi Timo</>;
return <></>;
}
Comment thread
kimminna marked this conversation as resolved.
32 changes: 0 additions & 32 deletions apps/timo-web/app/layout.tsx

This file was deleted.

3 changes: 0 additions & 3 deletions apps/timo-web/app/login/page.tsx

This file was deleted.

25 changes: 15 additions & 10 deletions apps/timo-web/components/layout/sidebar/NavigationSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,51 +20,56 @@ import {
} from "@repo/timo-design-system/icons";
import { TabButton } from "@repo/timo-design-system/ui";
import Image from "next/image";
import Link from "next/link";
import { usePathname } from "next/navigation";
import { useTranslations } from "next-intl";

import { ROUTES } from "@/constants/routes";
import { Link, usePathname } from "@/i18n/navigation";

const NAV_ITEMS = [
{
href: ROUTES.HOME,
label: "",
labelKey: "home",
OnIcon: HomeOnIcon,
OffIcon: HomeOffIcon,
HoverIcon: HomeHoverIcon,
className: undefined,
},
{
href: ROUTES.TODAY,
label: "오늘",
labelKey: "today",
OnIcon: TodayOnIcon,
OffIcon: TodayOffIcon,
HoverIcon: TodayHoverIcon,
className: undefined,
},
{
href: ROUTES.FOCUS,
label: "집중 모드",
labelKey: "focus",
OnIcon: TimerOnIcon,
OffIcon: TimerOffIcon,
HoverIcon: TimerHoverIcon,
className: undefined,
},
{
href: ROUTES.STATISTICS,
label: "통계",
labelKey: "statistics",
OnIcon: ChartOnIcon,
OffIcon: ChartOffIcon,
HoverIcon: ChartHoverIcon,
className: undefined,
},
{
href: ROUTES.SETTINGS,
label: "설정",
labelKey: "settings",
OnIcon: SettingOnIcon,
OffIcon: SettingOffIcon,
HoverIcon: SettingHoverIcon,
className: "mt-auto",
},
];
] as const;

export const NavigationSidebar = () => {
const t = useTranslations("Navigation");
const pathname = usePathname();
const isActivePath = (pathname: string, href: string) =>
pathname === href || pathname.startsWith(`${href}/`);
Expand All @@ -75,7 +80,7 @@ export const NavigationSidebar = () => {
<Image src={timoTextLogo} alt="Timo" width={92} height={35} />
<nav className="flex flex-col gap-2">
{NAV_ITEMS.map(
({ href, label, OnIcon, OffIcon, HoverIcon, className }) => {
({ href, labelKey, OnIcon, OffIcon, HoverIcon, className }) => {
const isSelected = isActivePath(pathname, href);

return (
Expand All @@ -86,7 +91,7 @@ export const NavigationSidebar = () => {
aria-current={isSelected ? "page" : undefined}
>
<TabButton
label={label}
label={t(labelKey)}
icon={
isSelected ? (
<OnIcon width={24} height={24} />
Expand Down
9 changes: 9 additions & 0 deletions apps/timo-web/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { routing } from "@/i18n/routing";
import en from "@/messages/en.json";

declare module "next-intl" {
interface AppConfig {
Locale: (typeof routing.locales)[number];
Messages: typeof en;
}
}
6 changes: 6 additions & 0 deletions apps/timo-web/i18n/navigation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { createNavigation } from "next-intl/navigation";

import { routing } from "@/i18n/routing";

export const { Link, redirect, usePathname, useRouter, getPathname } =
createNavigation(routing);
16 changes: 16 additions & 0 deletions apps/timo-web/i18n/request.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { hasLocale } from "next-intl";
import { getRequestConfig } from "next-intl/server";

import { routing } from "@/i18n/routing";

export default getRequestConfig(async ({ requestLocale }) => {
const requested = await requestLocale;
const locale = hasLocale(routing.locales, requested)
? requested
: routing.defaultLocale;

return {
locale,
messages: (await import(`../messages/${locale}.json`)).default,
};
});
7 changes: 7 additions & 0 deletions apps/timo-web/i18n/routing.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineRouting } from "next-intl/routing";

export const routing = defineRouting({
locales: ["en", "ko"],
defaultLocale: "en",
localePrefix: "always", // as-needed 로 추후 변경

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

localePrefix 설정이 PR 목표와 다릅니다 — TODO 코멘트 확인 필요.

주석에 as-needed 로 추후 변경이라고 적혀 있는데, 연동된 이슈 요구사항은 처음부터 en prefix 없이 as-needed로 동작해야 한다고 명시하고 있어요. 지금 always로 두면 /en/...처럼 영어 경로에도 항상 prefix가 붙어서 요구사항과 어긋납니다.

만약 스택의 다음 PR에서 바로 고칠 계획이라면 괜찮지만, 그렇지 않다면 지금 반영해주시는 게 좋을 것 같아요. 이 TODO, 제가 대신 처리해드릴까요? 아니면 이슈로 등록해드릴까요?

🤖 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 `@apps/timo-web/i18n/routing.ts` at line 6, The localePrefix setting in the
routing configuration is still set to always, which conflicts with the
requirement to use as-needed from the start and avoid an /en prefix on English
routes. Update the localePrefix value in the routing setup to as-needed and
remove or revise the TODO comment so the behavior matches the intended i18n
routing policy.

});
9 changes: 9 additions & 0 deletions apps/timo-web/messages/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"Navigation": {
"home": "Home",
"today": "Today",
"focus": "Focus Mode",
"statistics": "Statistics",
"settings": "Settings"
}
}
9 changes: 9 additions & 0 deletions apps/timo-web/messages/ko.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"Navigation": {
"home": "홈",
"today": "오늘",
"focus": "집중 모드",
"statistics": "통계",
"settings": "설정"
}
}
5 changes: 4 additions & 1 deletion apps/timo-web/next.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
/* global process */
import { withSentryConfig } from "@sentry/nextjs";
import createNextIntlPlugin from "next-intl/plugin";

/** @type {import('next').NextConfig} */
const nextConfig = {
transpilePackages: ["@repo/timo-design-system"],
};

export default withSentryConfig(nextConfig, {
const withNextIntl = createNextIntlPlugin();

export default withSentryConfig(withNextIntl(nextConfig), {
org: "timo-client",
project: "timo-web",
authToken: process.env["SENTRY_AUTH_TOKEN"],
Expand Down
1 change: 1 addition & 0 deletions apps/timo-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"@tanstack/react-query-devtools": "^5.101.1",
"axios": "^1.18.1",
"next": "16.2.0",
"next-intl": "^4.13.1",
Comment thread
kimminna marked this conversation as resolved.
"react": "^19.2.0",
"react-dom": "^19.2.0",
"zod": "^4.4.3"
Expand Down
9 changes: 9 additions & 0 deletions apps/timo-web/proxy.ts

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

미들웨어 파일명이 proxy.ts인데, Next.js는 미들웨어를 middleware.ts로만 인식하는 걸로 알고 있어요. proxy.ts로는 실제로 미들웨어가 동작하지 않을 것 같아서요 middleware.ts로 rename이 필요하지 않을까요?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

middleware -> proxy로 변경이 되었다고 알고 있습니다!

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import createMiddleware from "next-intl/middleware";

import { routing } from "@/i18n/routing";

export default createMiddleware(routing);

export const config = {
matcher: ["/((?!api|_next|.*\\..*).*)"],
};
Loading
Loading