Skip to content

Conversation

izub
Copy link
Contributor

@izub izub commented Sep 4, 2025

Description:

Added missing factory description to instructions and improved some instruction texts. Fixes #1974.

Screenshot 2025-09-04 222654

Please complete the following:

  • I have added screenshots for all UI updates
  • I process any text displayed to the user through translateText() and I've added it to the en.json file
  • I have added relevant tests to the test directory
  • I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced

Please put your Discord username so you can be contacted if a bug or regression is found:

dutchster_

Copy link
Contributor

coderabbitai bot commented Sep 4, 2025

Walkthrough

Added English copy updates for factory and port descriptions and inserted a Factory row in the HelpModal build menu. Changes are limited to one locale JSON and one client UI TypeScript file; no runtime logic or public API changes.

Changes

Cohort / File(s) Summary
Localization (English)
resources/lang/en.json
Updated build_factory_desc to describe automatic rail links, regular train spawns, and gold per visited building (including neighbor bonuses). Clarified build_port_desc wording to "Trade with a player stops..."
Help modal UI
src/client/HelpModal.ts
Added a Factory row to the Build menu table (label key help_modal.build_factory, icon cell, description key help_modal.build_factory_desc) placed between Port and Warship rows.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant UI as HelpModal
  participant I18n as Translation Store

  User->>UI: Open Help → Build tab
  UI->>I18n: Request labels/descriptions (port, factory, warship...)
  I18n-->>UI: Returns localized strings (including build_factory_desc)
  UI->>UI: Render Build table with new Factory row between Port and Warship
  Note right of UI: UI-only change — no backend interaction
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Assessment against linked issues

Objective Addressed Explanation
Add missing Factory description to Build menu (issue #1974)

Possibly related PRs

Suggested labels

Bug Fix

Suggested reviewers

  • evanpelle
  • Aotumuri

Poem

A factory line in the Help menu grows,
Trains sing gold where the new text shows.
Ports clarified, an icon in place,
Small words, bright change — a friendlier space. 🚂⚓


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 067d824 and aecdb33.

📒 Files selected for processing (1)
  • resources/lang/en.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • resources/lang/en.json

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
resources/lang/en.json (2)

97-97: Polish Factory description for clarity (active voice).

Shorter and clearer wording; same meaning.

-    "build_factory_desc": "Creates railroads automatically with nearby cities, ports and other factories. Trains are spawned regularly and will get you a fixed amount of gold for each building visited along the route.",
+    "build_factory_desc": "Automatically creates railroads connecting nearby cities, ports, and factories. Trains spawn regularly and earn a fixed amount of gold for each building visited on the route.",

60-60: Typo: “recieved” → “received”.

User-facing text—fix spelling.

-    "ui_events_quickchat": "Quick Chat - You can see sent and recieved chat messages here. Send a message to a player by clicking the Quick Chat icon in their Info menu.",
+    "ui_events_quickchat": "Quick Chat - You can see sent and received chat messages here. Send a message to a player by clicking the Quick Chat icon in their Info menu.",
src/client/HelpModal.ts (1)

462-466: Icon class and locales OK; DRY table is optional.

  • .factory-icon is defined (src/client/styles.css:379) and matches peer icons.
  • All non-EN locale files include help_modal.build_factory and help_modal.build_factory_desc.
  • Optional: replace manual <tr>s with a typed array of row configs to generate table rows and reduce repetition.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 1fa2685 and 0dce700.

📒 Files selected for processing (2)
  • resources/lang/en.json (1 hunks)
  • src/client/HelpModal.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: andrewNiziolek
PR: openfrontio/OpenFrontIO#1007
File: resources/lang/de.json:115-115
Timestamp: 2025-06-02T14:27:37.609Z
Learning: For OpenFrontIO project: When localization keys are renamed in language JSON files, the maintainers separate technical changes from translation content updates. They wait for community translators to update the actual translation values rather than attempting to translate in the same PR. This allows technical changes to proceed while ensuring accurate translations from native speakers.
🧬 Code graph analysis (1)
src/client/HelpModal.ts (2)
src/client/LangSelector.ts (1)
  • translateText (248-268)
src/client/Utils.ts (1)
  • translateText (82-137)
🔇 Additional comments (2)
resources/lang/en.json (1)

101-101: Apply proposed wording tweak for build_port_desc
Matches game rules and aligns with other help texts.

src/client/HelpModal.ts (1)

462-466: Factory row addition looks correct.

Keys map to existing entries in en.json; placement after Port and before Warship matches the menu flow.

coderabbitai[bot]
coderabbitai bot previously approved these changes Sep 4, 2025
@abdallahbahrawi1
Copy link
Contributor

It will get 10k for each port/city visit, and 0 if it visited another Factory.
Trains can go from your land to your neighbor lands if rails get formed , and for each visit your neighbor will get 50k if allied with you , and 30k if he is a teammate, and vice versa if the train came from your neighbor land to yours
, i think you should mention these as well, and please make sure the numbers are correct, because changes might happen at anytime

@izub
Copy link
Contributor Author

izub commented Sep 4, 2025

It will get 10k for each port/city visit, and 0 if it visited another Factory. Trains can go from your land to your neighbor lands if rails get formed , and for each visit your neighbor will get 50k if allied with you , and 30k if he is a teammate, and vice versa if the train came from your neighbor land to yours , i think you should mention these as well, and please make sure the numbers are correct, because changes might happen at anytime

@abdallahbahrawi1 I've mentioned visits to neighbors, but similar to other instructions they should remain concise, I don't want to add too much information as it's just a quick overview. Also not mentioning amounts since they can be changed any time and translations will take time to update.

@CLAassistant
Copy link

CLAassistant commented Sep 5, 2025

CLA assistant check
All committers have signed the CLA.

@github-project-automation github-project-automation bot moved this from Triage to Final Review in OpenFront Release Management Sep 5, 2025
@evanpelle evanpelle added this to the v26 milestone Sep 5, 2025
@evanpelle evanpelle added this pull request to the merge queue Sep 5, 2025
Merged via the queue into openfrontio:main with commit 0c9149e Sep 5, 2025
9 of 10 checks passed
@github-project-automation github-project-automation bot moved this from Final Review to Complete in OpenFront Release Management Sep 5, 2025
@izub izub deleted the factory-instructions branch September 5, 2025 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Complete
Development

Successfully merging this pull request may close these issues.

Factory description missing in instructions
4 participants