From 1c6352cc3d09007be52e9837ca345e036bcd6522 Mon Sep 17 00:00:00 2001 From: ApocDev Date: Wed, 1 Jul 2026 11:30:32 -0400 Subject: [PATCH 1/2] feat(app): hide the TURD tab when the dataset has no TURD data TURD is a Pyanodons mechanic; on a non-Py mod set (or vanilla) there are no is_turd techs, so the tab led to an empty page. Add a data-driven capability signal (dataCapabilities -> hasTurd, a count of is_turd techs) exposed via dataCapabilitiesFn, and gate the nav link on it in both the desktop bar and the mobile drawer. Keyed on the data being present, not on detecting a named mod, so it survives partial installs and other overhauls. The /turd route also shows an empty state for a direct visit. First step toward running on any mod set (#68). Refs #68 --- app/src/components/app-nav.tsx | 7 ++++--- app/src/components/nav-links.ts | 22 ++++++++++++++++++++-- app/src/components/nav-mobile.tsx | 7 +++++-- app/src/db/queries.test.ts | 14 ++++++++++++++ app/src/db/queries.ts | 16 ++++++++++++++++ app/src/routes/turd.tsx | 8 ++++++++ app/src/server/factorio.ts | 3 +++ 7 files changed, 70 insertions(+), 7 deletions(-) diff --git a/app/src/components/app-nav.tsx b/app/src/components/app-nav.tsx index 5590d0d..1857357 100644 --- a/app/src/components/app-nav.tsx +++ b/app/src/components/app-nav.tsx @@ -6,9 +6,9 @@ import { BridgeIndicator } from "./bridge-indicator"; import { HorizonMenu } from "./horizon-menu"; import { LogisticsMenu } from "./logistics-menu"; import { NavMobile } from "./nav-mobile"; -import { NAV_LINKS, SETTINGS_LINK } from "./nav-links"; +import { SETTINGS_LINK, visibleNavLinks } from "./nav-links"; import { activeRunCount, subscribeRuns } from "../lib/chat-store"; -import { modDriftFn } from "../server/factorio"; +import { dataCapabilitiesFn, modDriftFn } from "../server/factorio"; import { driftModal } from "../lib/drift-store"; /** Persistent re-entry point for the data-sync modal: a small amber chip in the @@ -54,6 +54,7 @@ const active = "!text-foreground border-b-2 border-primary bg-muted/30"; * bar shows from `xl` up (desktop/Steam Deck); below that it collapses to a * hamburger drawer (NavMobile) so it never forces the page wider than the screen. */ export function AppNav() { + const caps = useQuery({ queryKey: ["dataCapabilities"], queryFn: () => dataCapabilitiesFn() }); return (