Add type-safe navigation helpers and public pages

- Create gotoLogin() helper for login redirects with search params
- Add /terms and /privacy public routes with Tailwind typography
- Update auth-guard to allow unauthenticated access to public pages
- Fix resolve() usage across navigation components using as const pattern
- Fix eslint-disable-next-line placement for svelte/no-navigation-without-resolve
- Document SvelteKit resolve() patterns in CLAUDE.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
igm
2026-01-11 14:19:33 +08:00
parent 76a5e40900
commit 628b01f4d8
33 changed files with 281 additions and 96 deletions

View File

@@ -100,7 +100,9 @@ describe("formatRelativeDate", () => {
test("returns formatted date for older dates in same year", () => {
// Use a "now" later in the year to test same-year formatting
const laterNow = new Date("2024-06-15T12:00:00Z");
const result = formatRelativeDate("2024-01-15T12:00:00Z", { now: laterNow });
const result = formatRelativeDate("2024-01-15T12:00:00Z", {
now: laterNow,
});
expect(result).toBe("Jan 15");
});

View File

@@ -1,9 +1,9 @@
export {
type FormatRelativeDateOptions,
formatDate,
formatDateTime,
formatLongDate,
formatRelativeDate,
formatRelativeTime,
type FormatRelativeDateOptions,
} from "./format-date.js";
export { formatRole, getUserInitials } from "./user.js";

View File

@@ -51,9 +51,9 @@ describe("getUserInitials", () => {
});
test("handles empty display name", () => {
expect(
getUserInitials({ displayName: "", email: "bob@example.com" }),
).toBe("BO");
expect(getUserInitials({ displayName: "", email: "bob@example.com" })).toBe(
"BO",
);
});
});