Skip to content

Restore UI compatibility with older browsers#2

Open
highvoltaage wants to merge 1 commit intomainfrom
codex/set-up-game-state-and-mechanics
Open

Restore UI compatibility with older browsers#2
highvoltaage wants to merge 1 commit intomainfrom
codex/set-up-game-state-and-mechanics

Conversation

@highvoltaage
Copy link
Copy Markdown
Owner

Summary

  • replace optional chaining and nullish coalescing in the browser logic so older browsers can parse the modules and render the interface
  • normalize resource label fallbacks in UI panels to avoid relying on modern operators while keeping labels consistent
  • ensure machine tiles record deposit resources without using nullish coalescing for better compatibility

Testing

  • pytest

https://chatgpt.com/codex/tasks/task_e_68ff98ba34c4832e85873e98d38d6ef0

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/test_game_state.py
Comment on lines +1 to +20
import json
import math
import subprocess
from pathlib import Path

from factory_launch import GameState
from factory_launch.constants import (
COAL_DRILL_OUTPUT_PER_SECOND,
PLAYER_STACK_LIMIT,
)
from factory_launch.machines import CoalDrill, StoneSmelter


def test_initial_state_has_resources_and_machines():
state = GameState()
assert len(state.drills) == 2
assert len(state.smelters) == 1
chest = state.storage_chests[0]
assert chest.items == {}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Import required modules in test file

The test suite references math.sqrt, math.isclose, subprocess.run, and json.loads, but only Path and project modules are imported at the top of the file. When pytest runs, the first reference to any of those modules will raise a NameError and stop the suite before exercising the new code. Add the missing import math, import subprocess, and import json statements so the tests execute.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant