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 5 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 @@
}
separator={<NavbarSeparator />}
onlyOnMobile={onlyOnMobile}
className="bg-background"

Check warning on line 63 in apps/calendar/src/app/[locale]/(root)/navbar.tsx

View check run for this annotation

Codecov / codecov/patch

apps/calendar/src/app/[locale]/(root)/navbar.tsx#L63

Added line #L63 was not covered by tests
/>
);
}
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';

Check warning on line 3 in apps/calendar/src/app/[locale]/(root)/page.tsx

View check run for this annotation

Codecov / codecov/patch

apps/calendar/src/app/[locale]/(root)/page.tsx#L3

Added line #L3 was not covered by tests
import { useQuery, useQueryClient } from '@tanstack/react-query';
import { Button } from '@tuturuuu/ui/button';

Check warning on line 5 in apps/calendar/src/app/[locale]/(root)/page.tsx

View check run for this annotation

Codecov / codecov/patch

apps/calendar/src/app/[locale]/(root)/page.tsx#L5

Added line #L5 was not covered by tests
import { SmartCalendar } from '@tuturuuu/ui/legacy/calendar/smart-calendar';
import { useLocale, useTranslations } from 'next-intl';
import Link from 'next/link';

Check warning on line 8 in apps/calendar/src/app/[locale]/(root)/page.tsx

View check run for this annotation

Codecov / codecov/patch

apps/calendar/src/app/[locale]/(root)/page.tsx#L8

Added line #L8 was not covered by tests

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

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>
)}

Check warning on line 21 in apps/calendar/src/app/[locale]/(root)/page.tsx

View check run for this annotation

Codecov / codecov/patch

apps/calendar/src/app/[locale]/(root)/page.tsx#L17-L21

Added lines #L17 - L21 were not covered by tests
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