[WIP] Add error handling and logging for TaxProductionUISystem - #2
Merged
Merged
Conversation
binded-zz
marked this pull request as ready for review
March 29, 2026 03:40
Copilot stopped work on behalf of
binded-zz due to an error
March 29, 2026 03:41
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.
Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.
Original prompt
This PR implements essential stabilization and best practices for Cities: Skylines II mods:
TaxProductionUISystem.cs:
TaxProductionWindow.css:
.tax-production-windowstyle includesdisplay: block;afterposition: fixed;so the window always becomes visible when triggered.Result: The mod builds cleanly, is robust against runtime UI errors, user toggles, and looks/works as intended.
The following is the prior conversation context from the user's chat exploration (may be truncated):
Assistant: I've identified and fixed the problem! The windows aren't opening because the CSS is missing the
displayproperty, so even when the window's visibility state changes totrue, the element stays hidden.The Issue
In
src/UI/components/TaxProductionWindow.css, the.tax-production-windowclass doesn't have adisplayproperty. Without it, the element defaults todisplay: none, making it invisible regardless of the React conditional rendering.The Fix
I've updated the CSS to add:
This ensures:
isVisibleistrueThe C# bindings (
TaxProductionUISystem.cs) and React components (TaxMod.tsx,TaxWindow.tsx) are working correctly - they were properly toggling the visibility state. The CSS was just preventing the DOM element from being displayed.Test it now: Click the toolbar button (tax icon in the top-left) to toggle the window open and closed!
User: look at https://github.com/thiago-rcarvalho/cs2-parking-fee-control
Assistant: This is an excellent reference implementation! The Parking Fee Control mod shows best practices for Cities Skylines 2 modding with proper C# and TypeScript/React integration. Here are the key lessons that apply to your project:
Key Architecture Patterns from the Reference
1. Proper C# System Structure (
Mod.cs)OnLoad()2. Comprehensive UISystem (
ParkingFeeUISystem.cs)3. UI System Pattern - Key Methods
What Your Project Should Adopt
Problem in Your Code:
Your CSS is missing the
displayproperty - that's already fixed, but you should also:Fix Your
TaxProductionUISystem.csUpdate it to be more like the reference implementation: