Skip to content

Add scheduling algorithm #3062

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 17, 2025
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
1 change: 1 addition & 0 deletions apps/calendar/src/app/[locale]/(root)/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export default async function Navbar({
}
separator={<NavbarSeparator />}
onlyOnMobile={onlyOnMobile}
className="bg-background"
/>
);
}
8 changes: 8 additions & 0 deletions apps/calendar/src/app/[locale]/(root)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
'use client';

import { DEV_MODE } from '@/constants/common';
import { useQuery, useQueryClient } from '@tanstack/react-query';
import { Button } from '@tuturuuu/ui/button';
import { SmartCalendar } from '@tuturuuu/ui/legacy/calendar/smart-calendar';
import { useLocale, useTranslations } from 'next-intl';
import Link from 'next/link';

export default function Home() {
const t = useTranslations('calendar');
Expand All @@ -11,6 +14,11 @@ export default function Home() {

return (
<div className="relative flex h-screen flex-col overflow-y-auto p-4 pt-16 md:p-8 md:pt-20 md:pb-4 lg:p-16 lg:pt-20 lg:pb-4">
{DEV_MODE && (
<Link href="/scheduler">
<Button>Scheduler</Button>
</Link>
)}
Comment on lines +17 to +21
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Locale is dropped from the Scheduler link – navigation will break

Link points to "/scheduler", ignoring the active locale segment (/en, /vi, …). Users will be routed to the default-locale page, losing translation context.

-<Link href="/scheduler">
+<Link href={`/${locale}/scheduler`}>

If you rely on next-intl’s <Link locale={false|...}> API, use that instead.

📝 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
{DEV_MODE && (
<Link href="/scheduler">
<Button>Scheduler</Button>
</Link>
)}
{DEV_MODE && (
<Link href={`/${locale}/scheduler`}>
<Button>Scheduler</Button>
</Link>
)}
🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 17-21: apps/calendar/src/app/[locale]/(root)/page.tsx#L17-L21
Added lines #L17 - L21 were not covered by tests

🤖 Prompt for AI Agents
In apps/calendar/src/app/[locale]/(root)/page.tsx around lines 17 to 21, the
Link to "/scheduler" does not include the active locale segment, causing
navigation to lose translation context. Update the Link component to preserve
the current locale by using next-intl's locale-aware Link API, such as adding
the locale prop or setting locale={false} to keep the current locale in the URL.

<SmartCalendar
t={t}
locale={locale}
Expand Down
Loading