Skip to content

feat: gate the TURD tab on data presence (mod-agnostic step 1)#69

Merged
ApocDev merged 2 commits into
mainfrom
feat/gate-turd-on-data
Jul 1, 2026
Merged

feat: gate the TURD tab on data presence (mod-agnostic step 1)#69
ApocDev merged 2 commits into
mainfrom
feat/gate-turd-on-data

Conversation

@ApocDev

@ApocDev ApocDev commented Jul 1, 2026

Copy link
Copy Markdown
Owner

First step toward running PyOps on any mod set / vanilla (#68), keeping Py first-class.

TURD is a Pyanodons mechanic — on a non-Py dataset there are no is_turd techs, so the TURD tab led to an empty page. This gates it on whether the data is actually present, rather than sniffing for a named mod (more robust: survives partial installs, mod renames, and other overhauls).

Changes

  • dataCapabilities() (db/queries.ts) → { hasTurd }, a cheap count of is_turd techs; exposed as dataCapabilitiesFn (factorio.ts).
  • nav-links.ts: a NavCapabilities type, an optional capability field on NavLink, and visibleNavLinks(caps). Gating hides a link only once caps are loaded and the flag is explicitly false, so the tab never flashes out while the query loads (the common Py case shows it immediately).
  • Both navs (app-nav.tsx, nav-mobile.tsx) query capabilities and filter.
  • /turd shows a friendly empty state for a direct visit on a non-Py dataset.
  • Tests in queries.test.ts cover both hasTurd cases.
  • README: softened the "needs the Py mods" wording.

vp check clean; queries suite passes.

Refs #68

ApocDev added 2 commits July 1, 2026 11:30
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
PyOps needs Factorio + a data dump, not specifically the Py mods; note that
Py-specific views appear only when that data is present.

Refs #68
@ApocDev
ApocDev merged commit a531dc7 into main Jul 1, 2026
1 check passed
@ApocDev
ApocDev deleted the feat/gate-turd-on-data branch July 1, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant