mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 10:20:23 +08:00
Ship folder-based workspaces and data migration, daily practice, redesigned provider and model settings, and streaming conversation improvements. Synchronize README translations and document the archive/permanent-delete upgrade behavior in assets/releases/ver1-6-9.md. Reduce initial JavaScript by deduplicating English resources and loading animation features after hydration. Keep the existing route size budgets. Update regression fixtures and browser audits for scoped URLs and the new settings and learning interfaces.
59 lines
2.0 KiB
TypeScript
59 lines
2.0 KiB
TypeScript
"use client";
|
|
|
|
import Link from "next/link";
|
|
import { SkillLibraryScope } from "./SkillLibraryScope";
|
|
import { usePathname } from "next/navigation";
|
|
import { ArrowLeft } from "lucide-react";
|
|
import { useTranslation } from "react-i18next";
|
|
|
|
// Hub-and-spoke: the dashboard at `/space` is the only navigator. Once inside a
|
|
// section we don't re-list every sibling on a rail — a single "back to the hub"
|
|
// link keeps the section focused and sends you to the overview to switch.
|
|
function BackToHub() {
|
|
const { t } = useTranslation();
|
|
return (
|
|
<Link
|
|
href="/space"
|
|
className="group inline-flex items-center gap-1.5 text-[13px] text-[var(--muted-foreground)] transition-colors hover:text-[var(--foreground)]"
|
|
>
|
|
<ArrowLeft
|
|
size={15}
|
|
strokeWidth={1.8}
|
|
className="transition-transform group-hover:-translate-x-0.5"
|
|
/>
|
|
{t("Learning Space")}
|
|
</Link>
|
|
);
|
|
}
|
|
|
|
export default function SpaceMain({
|
|
children,
|
|
}: Readonly<{ children: React.ReactNode }>) {
|
|
const pathname = usePathname() ?? "";
|
|
const isDashboard = pathname === "/space";
|
|
|
|
return (
|
|
<div className="h-full overflow-y-auto bg-[var(--background)] [scrollbar-gutter:stable]">
|
|
<div className="mx-auto max-w-5xl px-8 py-8 pb-12">
|
|
{!isDashboard && (
|
|
<div className="mb-5">
|
|
<BackToHub />
|
|
</div>
|
|
)}
|
|
{['/space/skills', '/space/mcp'].includes(pathname) && (
|
|
<div className="mb-5 rounded-lg border border-[var(--border)] p-3 text-sm text-[var(--muted-foreground)]">
|
|
<ResourceLibraryNote />
|
|
</div>
|
|
)}
|
|
{pathname === "/space/skills" && <SkillLibraryScope />}
|
|
{children}
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
function ResourceLibraryNote() {
|
|
const { t } = useTranslation();
|
|
return <>{t("Account resource library. Manage resources here and assign them to workspaces in Settings.")} <Link className="underline" href="/settings#workspace">{t("Workspaces")}</Link></>;
|
|
}
|