Skip to content

Conversation

Boostry123
Copy link
Contributor

@Boostry123 Boostry123 commented Aug 30, 2025

Description:

Noticed things were a bit not centered and title had Modal in it.

image
image
---------------------------------------------------------------------------------------------------------------------------
image
image

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:

boostry

Copy link
Contributor

coderabbitai bot commented Aug 30, 2025

Walkthrough

Replaced hardcoded UI text with localized strings, removed button padding and fixed preview sizing in FlagInput, and wrapped the modal search input in a centered padded container with localized placeholder. Changes are presentational/localization-only; runtime behavior and public APIs are unchanged.

Changes

Cohort / File(s) Summary of Changes
Flag input styling
src/client/FlagInput.ts
Imported translateText; removed p-[4px] from the flag button classes; removed explicit width/height from the flag-preview <span> (left dynamic inline style); replaced title="Pick a flag!" with translateText("flag_input.button_title"). Rendering/update logic unchanged.
Modal structure & input
src/client/FlagInputModal.ts
Imported translateText; set <o-modal> title to translateText("flag_input.title"); wrapped the search input in <div class="flex justify-center w-full p-[1rem]">; localized input placeholder to translateText("flag_input.search_flag"). Core behavior unchanged.
Localization strings
resources/lang/en.json
Added top-level flag_input object with title: "Select Flag", button_title: "Pick a flag!", and search_flag: "Search...".

Sequence Diagram(s)

(omitted — changes are presentational/localization-only and do not modify control flow)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

UI/UX, Translation

Suggested reviewers

  • scottanderson
  • evanpelle

Poem

A tiny title learns to speak,
The button trims a softer cheek.
Centered search, the flags in view,
Small words translated, tidy too. 🏁


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 (4)
src/client/FlagInput.ts (2)

75-77: Mind the tap target after removing padding

Dropping p-[4px] can shrink the clickable area, especially on mobile. Consider preserving an accessible minimum size and visible focus for keyboard users.

- class="border rounded-lg flex cursor-pointer border-black/30
- dark:border-gray-300/60 bg-white/70 dark:bg-[rgba(55,65,81,0.7)]
- "
+ class="border rounded-lg flex cursor-pointer border-black/30
+ dark:border-gray-300/60 bg-white/70 dark:bg-[rgba(55,65,81,0.7)]
+ min-w-[44px] min-h-[44px] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500"

Please sanity-check at 320px width and with keyboard nav.


82-85: Preview can collapse without explicit sizing

With width/height removed, the span may render at 0×0 and the img set to 100% won’t show. Give the container a sensible default that can still be overridden.

- style="display:inline-block;
-            vertical-align:middle; background:#333; border-radius:6px;
-            overflow:hidden;"
+ style="display:inline-block; vertical-align:middle; background:#333; border-radius:6px; overflow:hidden;
+            width: var(--flag-preview-w, 48px); height: var(--flag-preview-h, 64px);"

If you prefer fluid sizing, an alternative is aspect-ratio: 3/4 plus a max-height.

src/client/FlagInputModal.ts (2)

21-24: Localize user-facing strings

Title "Select flag" should go through your i18n helper (e.g., translateText/t) per the PR checklist. Same for the "Search..." placeholder if not already handled elsewhere.

Also, the input class includes both border-none and border; drop the redundancy:

- class="h-[2rem] border-none border border-gray-300 
+ class="h-[2rem] border border-gray-300 

37-39: Prevent double scroll with the new padded wrapper

With the added p-[1rem] wrapper, the fixed h-[90%] on the grid can cause vertical overflow in smaller viewports. Prefer flex growth over hardcoded height.

- class="flex flex-wrap justify-evenly gap-[1rem] overflow-y-auto overflow-x-hidden h-[90%]"
+ class="flex flex-wrap justify-evenly gap-[1rem] overflow-y-auto overflow-x-hidden flex-1 min-h-0"

Test at 320×568 and ensure the modal body doesn’t create two scrollbars.

📜 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 1ae7ebc and ac767a0.

📒 Files selected for processing (2)
  • src/client/FlagInput.ts (1 hunks)
  • src/client/FlagInputModal.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: VariableVince
PR: openfrontio/OpenFrontIO#1655
File: resources/maps/giantworldmap/manifest.json:165-174
Timestamp: 2025-07-31T12:03:08.052Z
Learning: In OpenFrontIO draft PRs, flag names in map manifest files may be placeholders that will be updated to match the actual SVG flag file names when the assets are received. The final naming depends on the actual flag SVG files provided, not code naming conventions.
🔇 Additional comments (1)
src/client/FlagInputModal.ts (1)

21-21: UI copy change looks good

Removing “Modal” from the title to “Select flag” matches the PR objective and reads cleaner.

coderabbitai[bot]
coderabbitai bot previously approved these changes Aug 30, 2025
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: 1

🧹 Nitpick comments (1)
resources/lang/en.json (1)

619-622: Align button copy with existing style; drop the exclamation.

Most buttons use neutral Title Case (e.g., “Start Game”). Suggest “Select Flag” to match “select_lang.title: Select Language” and keep tone consistent.

   "flag_input": {
     "title": "Select Flag",
-    "button_title": "Pick a flag!"
+    "button_title": "Select Flag"
   },
📜 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 a603d2d and 16d4703.

📒 Files selected for processing (3)
  • resources/lang/en.json (1 hunks)
  • src/client/FlagInput.ts (2 hunks)
  • src/client/FlagInputModal.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/client/FlagInput.ts
  • src/client/FlagInputModal.ts
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-05-30T18:11:56.014Z
Learnt from: VariableVince
PR: openfrontio/OpenFrontIO#959
File: resources/maps/GatewayToTheAtlantic.json:124-124
Timestamp: 2025-05-30T18:11:56.014Z
Learning: In OpenFrontIO, flag names in map JSON files can use spaces (like "Amazigh flag") and don't need to follow slug format. Flag assets are stored with matching filenames including spaces (e.g., "Amazigh flag.svg"). Nation names and flag names are not translated/localized in the translation files.

Applied to files:

  • resources/lang/en.json

coderabbitai[bot]
coderabbitai bot previously approved these changes Sep 2, 2025
@evanpelle evanpelle dismissed coderabbitai[bot]’s stale review September 4, 2025 02:44

The merge-base changed after approval.

@evanpelle evanpelle requested a review from a team as a code owner September 4, 2025 02:44
@Boostry123 Boostry123 force-pushed the reaf/Flag-Input-Selector branch from b3ca504 to 485149e Compare September 4, 2025 23:19
coderabbitai[bot]
coderabbitai bot previously approved these changes Sep 4, 2025
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 (1)
src/client/index.html (1)

201-201: Align widths within the row; prefer flex-basis over percentage widths.

Changing md:w-[15%]md:w-[20%] for <flag-input> may make the row uneven at md+ because its siblings still use md:w-[15%]. This can cause earlier wrapping or crowd the username-input. Consider making sizing consistent across siblings, or switch to flex-basis + grow to let the name field take the rest cleanly.

Apply on this line:

-<flag-input class="w-[20%] md:w-[20%]"></flag-input>
+<flag-input class="shrink-0 basis-[20%] md:basis-[20%]"></flag-input>

Optional follow-ups outside this line for consistency (no diff provided):

  • territory-patterns-modal: add shrink-0 basis-[20%] md:basis-[20%] (or keep 15% everywhere).
  • news-button: match the same basis as above when visible.
  • username-input: use flex-1 min-w-0 instead of w-full so it expands and truncates nicely.

Please verify at 768–1024px:

  • The row does not wrap unexpectedly when news-button is visible/hidden.
  • The username field keeps enough space and does not overflow.
📜 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 485149e and 3be7886.

📒 Files selected for processing (1)
  • src/client/index.html (1 hunks)

@CLAassistant
Copy link

CLAassistant commented Sep 5, 2025

CLA assistant check
All committers have signed the CLA.

@evanpelle evanpelle modified the milestones: v25, v26 Sep 5, 2025
Copy link
Collaborator

@evanpelle evanpelle left a comment

Choose a reason for hiding this comment

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

Thanks!

@github-project-automation github-project-automation bot moved this from Development to Final Review in OpenFront Release Management 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 76723e6 Sep 5, 2025
13 of 14 checks passed
@github-project-automation github-project-automation bot moved this from Final Review to Complete in OpenFront Release Management Sep 5, 2025
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.

3 participants