Skip to content

Fix dev UI showing == Any when dependency version isn't installed#404

Open
Goober5000 wants to merge 1 commit intoKnossosNET:mainfrom
Goober5000:fix/ui_missing_version
Open

Fix dev UI showing == Any when dependency version isn't installed#404
Goober5000 wants to merge 1 commit intoKnossosNET:mainfrom
Goober5000:fix/ui_missing_version

Conversation

@Goober5000
Copy link
Copy Markdown
Contributor

@Goober5000 Goober5000 commented May 10, 2026

In the package manager dev UI, opening a mod whose dependency targets
a version that isn't currently installed showed the operator as '=='
and the version as 'Any', regardless of what the JSON specified.

The operator-detection block in EditorDependencyItem's constructor was
nested inside if (currentVersion != null), so when the requested
version wasn't found in the installed list, the version dropdown
correctly fell back to 'Any' but the operator type incorrectly stayed
at its default 0 ('==').

Move the operator detection out of that conditional so it always runs,
and surface the requested version as its own dropdown entry when it
isn't installed -- mirroring what the missing-mod branch already does.
Extract the operator detection and operator stripping into two private
static helpers shared by both branches.

Depends on #402; in draft until that is merged.

In the package manager dev UI, opening a mod whose dependency targets
a version that isn't currently installed showed the operator as '=='
and the version as 'Any', regardless of what the JSON specified.

The operator-detection block in EditorDependencyItem's constructor was
nested inside `if (currentVersion != null)`, so when the requested
version wasn't found in the installed list, the version dropdown
correctly fell back to 'Any' but the operator type incorrectly stayed
at its default 0 ('==').

Move the operator detection out of that conditional so it always runs,
and surface the requested version as its own dropdown entry when it
isn't installed -- mirroring what the missing-mod branch already does.
Extract the operator detection and operator stripping into two private
static helpers shared by both branches.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Goober5000 Goober5000 force-pushed the fix/ui_missing_version branch from 668fe17 to 7374f33 Compare May 10, 2026 21:38
@Goober5000 Goober5000 marked this pull request as ready for review May 10, 2026 21:38
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.

2 participants