feat: gate the TURD tab on data presence (mod-agnostic step 1)#69
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_turdtechs, 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 ofis_turdtechs; exposed asdataCapabilitiesFn(factorio.ts).nav-links.ts: aNavCapabilitiestype, an optionalcapabilityfield onNavLink, andvisibleNavLinks(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).app-nav.tsx,nav-mobile.tsx) query capabilities and filter./turdshows a friendly empty state for a direct visit on a non-Py dataset.queries.test.tscover bothhasTurdcases.vp checkclean; queries suite passes.Refs #68