diff --git a/src/db/projects.rs b/src/db/projects.rs index 7438830..dba8a16 100644 --- a/src/db/projects.rs +++ b/src/db/projects.rs @@ -50,9 +50,9 @@ pub struct ApiAdminProject { pub tags: Vec, pub status: String, pub description: String, - #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "githubRepo", skip_serializing_if = "Option::is_none")] pub github_repo: Option, - #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "demoUrl", skip_serializing_if = "Option::is_none")] pub demo_url: Option, #[serde(rename = "createdAt")] pub created_at: String, // ISO 8601 @@ -114,11 +114,15 @@ impl DbProject { pub struct CreateProjectRequest { pub name: String, pub slug: Option, + #[serde(rename = "shortDescription")] pub short_description: String, pub description: String, pub status: ProjectStatus, + #[serde(rename = "githubRepo")] pub github_repo: Option, + #[serde(rename = "demoUrl")] pub demo_url: Option, + #[serde(rename = "tagIds")] pub tag_ids: Vec, // UUID strings } @@ -126,11 +130,15 @@ pub struct CreateProjectRequest { pub struct UpdateProjectRequest { pub name: String, pub slug: Option, + #[serde(rename = "shortDescription")] pub short_description: String, pub description: String, pub status: ProjectStatus, + #[serde(rename = "githubRepo")] pub github_repo: Option, + #[serde(rename = "demoUrl")] pub demo_url: Option, + #[serde(rename = "tagIds")] pub tag_ids: Vec, // UUID strings } diff --git a/web/src/routes/+layout.svelte b/web/src/routes/+layout.svelte index 57831c4..e496349 100644 --- a/web/src/routes/+layout.svelte +++ b/web/src/routes/+layout.svelte @@ -61,8 +61,17 @@ }); onMount(() => { - // Randomly choose background component (50/50 chance) - backgroundComponent = Math.random() < 0.5 ? "clouds" : "dots"; + // Detect if this is a page reload (F5 or CTRL+F5) vs initial load or SPA navigation + const navigation = performance.getEntriesByType( + "navigation", + )[0] as PerformanceNavigationTiming; + const isReload = navigation?.type === "reload"; + + // Randomize on reload OR if not yet set (initial load) + // SPA navigation doesn't trigger onMount, so background stays stable + if (isReload || backgroundComponent === null) { + backgroundComponent = Math.random() < 0.5 ? "clouds" : "dots"; + } // Initialize theme store themeStore.init();