Skip to content

Conversation

@DiesselOne
Copy link
Contributor

@DiesselOne DiesselOne commented Jun 15, 2025

Description:

This fix issue of leaderboard overlaping other elements.
Also give option to dispaly ads below leaderboard since on desktop they are next to each other

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
  • I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors

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

Diessel
image

![image](https://github.com/user-attachmen
Snímek obrazovky 2025-06-17 v 18 28 12
ts/assets/5886ceb2-2d15-4b0e-9c30-8c61b0255f48)
Snímek obrazovky 2025-06-17 v 18 28 36
Snímek obrazovky 2025-06-17 v 18 28 19

@DiesselOne DiesselOne self-assigned this Jun 15, 2025
@DiesselOne DiesselOne requested a review from a team as a code owner June 15, 2025 17:57
@DiesselOne DiesselOne requested a review from evanpelle June 15, 2025 17:57
@DiesselOne DiesselOne added the UI/UX UI/UX changes including assets, menus, QoL, etc. label Jun 15, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 15, 2025

Walkthrough

This update removes the separate PlayerTeamLabel component and integrates its functionality into the GameLeftSidebar. It adjusts sidebar positioning and layout, updates styling for several UI layers, and removes the old PlayerTeamLabel element from the DOM and rendering layers.

Changes

File(s) Summary of Changes
src/client/graphics/layers/GameLeftSidebar.ts Added player team label feature inside sidebar; adjusted sidebar top offset; wrapped leaderboard and team stats in a flex container; updated dynamic styling and visibility logic.
src/client/graphics/layers/PlayerTeamLabel.ts Removed entire PlayerTeamLabel component and related code.
src/client/graphics/GameRenderer.ts Removed import and usage of PlayerTeamLabel component and DOM queries related to it.
src/client/index.html Removed fixed-position <player-team-label> element from page layout.
src/client/graphics/layers/Leaderboard.ts Reduced horizontal padding on leaderboard toggle button for medium screens.
src/client/graphics/layers/ControlPanel.ts Changed background color, blur, and shadow CSS classes for control panel container.
src/client/graphics/layers/PlayerInfoOverlay.ts Updated background color and shadow styling for player info overlay container.
src/client/graphics/layers/TopBar.ts Modified background color, blur, and added subtle shadow to top bar container styling.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant GameLeftSidebar
  participant Leaderboard
  participant TeamStats

  User->>GameLeftSidebar: View sidebar
  GameLeftSidebar->>GameLeftSidebar: Update player team label visibility and color
  GameLeftSidebar->>Leaderboard: Render leaderboard inside flex container
  GameLeftSidebar->>TeamStats: Render team stats with responsive margin
  Leaderboard->>User: Toggle top 5/all players (button click)
  User->>Leaderboard: Click toggle button
  Leaderboard->>Leaderboard: Update view accordingly
Loading

Possibly related PRs

Poem

A label once stood all alone,
Now in the sidebar finds its home.
Sidebar shifts with style and grace,
Team colors shine in their place.
Shadows soften, colors blend,
UI flows from end to end.
🎨✨🕹️

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

npm error Exit handler never called!
npm error This is an error with npm itself. Please report this error at:
npm error https://github.com/npm/cli/issues
npm error A complete log of this run can be found in: /.npm/_logs/2025-06-17T20_30_22_737Z-debug-0.log


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between caa704d and 09f4be3.

📒 Files selected for processing (3)
  • src/client/graphics/GameRenderer.ts (0 hunks)
  • src/client/graphics/layers/Leaderboard.ts (1 hunks)
  • src/client/index.html (0 hunks)
💤 Files with no reviewable changes (2)
  • src/client/index.html
  • src/client/graphics/GameRenderer.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/client/graphics/layers/Leaderboard.ts

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.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai 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

Documentation and Community

  • 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

🔭 Outside diff range comments (1)
src/client/graphics/layers/Leaderboard.ts (1)

184-191: ⚠️ Potential issue

Translate the toggle-button label

Raw strings "Show All" / "Show Top 5" bypass translateText(), which contradicts the PR policy that all user-facing text must be localised. This also makes the UI harder to internationalise later.

-          ${this.showTopFive ? "Show All" : "Show Top 5"}
+          ${this.showTopFive
+            ? translateText("leaderboard.showAll")
+            : translateText("leaderboard.showTopFive")}
🧹 Nitpick comments (1)
src/client/graphics/layers/GameLeftSidebar.ts (1)

67-73: Flex wrapper – double-check class mix

block lg:flex flex-wrap is fine, but flex-wrap does nothing while the element is display:block on small screens. Consider flex lg:flex or dropping flex-wrap until lg.

Also, adding flex 1 to <team-stats> host element works only if its host is display: flex (it defaults to inline). Add block or flex to the host style if width issues appear.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7fa11ed and b9d7d99.

📒 Files selected for processing (2)
  • src/client/graphics/layers/GameLeftSidebar.ts (2 hunks)
  • src/client/graphics/layers/Leaderboard.ts (1 hunks)
🔇 Additional comments (2)
src/client/graphics/layers/Leaderboard.ts (1)

184-185: Padding change looks good

Reducing md:px from 3 to 2.5 keeps the button aligned with the new sidebar spacing. No functional impact spotted.

src/client/graphics/layers/GameLeftSidebar.ts (1)

44-46: Validate top/height combo

top-[50px] with max-h-[calc(100vh-80px)] leaves a 30 px gap at the bottom (50 px + 100vh − 80 px = 100vh − 30 px). If the intent was to occupy the full viewport minus header height, adjust one of the values, e.g. max-h-[calc(100vh-50px)]. Please confirm on all breakpoints.

@VariableVince
Copy link
Contributor

VariableVince commented Jun 15, 2025

As discussed on discord, this contains an improvement (teams leaderboard next to player leaderboard on non-mobile, while on mobile still stacked on top of each other). If it could move up a little more to the top of the screen (where 'Your team: team x' is at the start of a Teams game) then it would be perfect imo.

https://discord.com/channels/1359946986937258015/1381293863712591872/1383871726412370013

@DiesselOne
Copy link
Contributor Author

As discussed on discord, this contains an improvement (teams leaderboard next to player leaderboard on non-mobile, while on mobile still stacked on top of each other). If it could move up a little more to the top of the screen (where 'Your team: team x' is at the start of a Teams game) then it would be perfect imo.

https://discord.com/channels/1359946986937258015/1381293863712591872/1383871726412370013

Check it now please

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: 2

🔭 Outside diff range comments (1)
src/client/graphics/layers/GameLeftSidebar.ts (1)

66-68: Getter may yield undefined, break strictness
game?.config() short-circuits to undefined, so the caller must handle a union type. Coerce to boolean to keep the API simple:

-  private get isTeamGame(): boolean {
-    return this.game?.config().gameConfig().gameMode === GameMode.Team;
-  }
+  private get isTeamGame(): boolean {
+    return !!(
+      this.game && this.game.config().gameConfig().gameMode === GameMode.Team
+    );
+  }
🧹 Nitpick comments (4)
src/client/graphics/layers/GameLeftSidebar.ts (4)

19-23: Avoid new Colord – prefer the factory for clearer, idiomatic usage
colord("#FFFFFF") is the canonical way to create a color instance; the constructor is mostly kept for legacy reasons. Swapping to the factory avoids potential TS type-narrowing issues and reads cleaner.

-import { Colord } from "colord";
+import { colord, Colord } from "colord";
 ...
- private playerColor: Colord = new Colord("#FFFFFF");
+ private playerColor: Colord = colord("#FFFFFF");

31-34: Guard isPlayerTeamLabelVisible behind a strict boolean check
isTeamGame can return undefined (see getter below). Using it directly in an if relies on truthiness and leaks the union type. Either coerce with !! or tighten the getter (see next comment).


77-89: Add semantic role for better accessibility
The label is plain <div>; give screen-readers a hook.

-  <div
+  <div
+    role="status"

Small change, big gain for a11y.


90-96: Duplicate spacing utilities – pick one
gap-2 already handles spacing; space-x-2 is redundant and slightly heavier in the DOM.

-<div class="flex items-center gap-2 space-x-2 text-white mb-2">
+<div class="flex items-center gap-2 text-white mb-2">
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b9d7d99 and 01a286d.

📒 Files selected for processing (7)
  • src/client/graphics/GameRenderer.ts (0 hunks)
  • src/client/graphics/layers/ControlPanel.ts (1 hunks)
  • src/client/graphics/layers/GameLeftSidebar.ts (5 hunks)
  • src/client/graphics/layers/PlayerInfoOverlay.ts (1 hunks)
  • src/client/graphics/layers/PlayerTeamLabel.ts (0 hunks)
  • src/client/graphics/layers/TopBar.ts (1 hunks)
  • src/client/index.html (0 hunks)
💤 Files with no reviewable changes (3)
  • src/client/index.html
  • src/client/graphics/GameRenderer.ts
  • src/client/graphics/layers/PlayerTeamLabel.ts
✅ Files skipped from review due to trivial changes (3)
  • src/client/graphics/layers/ControlPanel.ts
  • src/client/graphics/layers/PlayerInfoOverlay.ts
  • src/client/graphics/layers/TopBar.ts

@github-project-automation github-project-automation bot moved this from Triage to Development in OpenFront Release Management Jun 17, 2025
@evanpelle evanpelle added this to the v24 milestone Jun 17, 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 Jun 17, 2025
@evanpelle evanpelle merged commit b7ee1ca into openfrontio:main Jun 17, 2025
6 of 7 checks passed
@github-project-automation github-project-automation bot moved this from Final Review to Complete in OpenFront Release Management Jun 17, 2025
evanpelle added a commit that referenced this pull request Jun 18, 2025
## Description:
This fix issue of leaderboard overlaping other elements. 
Also give option to dispaly ads below leaderboard since on desktop they
are next to each other

## Please complete the following:

- [ ] I have added screenshots for all UI updates
- [x] 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
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

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

Diessel

![image](https://github.com/user-attachments/assets/28d1a952-b9b1-4990-9a2a-59d221f5c007)

![image](https://github.com/user-attachmen
![Snímek obrazovky 2025-06-17 v 18 28
12](https://github.com/user-attachments/assets/f00bd060-361a-4c2f-98dd-1849f7d705ff)
ts/assets/5886ceb2-2d15-4b0e-9c30-8c61b0255f48)
![Snímek obrazovky 2025-06-17 v 18 28
36](https://github.com/user-attachments/assets/a60943ef-7865-43fa-a400-a7bd381b6ea3)
![Snímek obrazovky 2025-06-17 v 18 28
19](https://github.com/user-attachments/assets/7a328e7a-5a97-4b71-bb7a-40adac2d45c3)

---------

Co-authored-by: evanpelle <evanpelle@gmail.com>
This was referenced Jun 21, 2025
El-Magico777 pushed a commit to El-Magico777/OpenFrontIO-Magico that referenced this pull request Jun 28, 2025
This fix issue of leaderboard overlaping other elements.
Also give option to dispaly ads below leaderboard since on desktop they
are next to each other

- [ ] I have added screenshots for all UI updates
- [x] 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
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors
regression is found:

Diessel

![image](https://github.com/user-attachments/assets/28d1a952-b9b1-4990-9a2a-59d221f5c007)

![image](https://github.com/user-attachmen
![Snímek obrazovky 2025-06-17 v 18 28
12](https://github.com/user-attachments/assets/f00bd060-361a-4c2f-98dd-1849f7d705ff)
ts/assets/5886ceb2-2d15-4b0e-9c30-8c61b0255f48)
![Snímek obrazovky 2025-06-17 v 18 28
36](https://github.com/user-attachments/assets/a60943ef-7865-43fa-a400-a7bd381b6ea3)
![Snímek obrazovky 2025-06-17 v 18 28
19](https://github.com/user-attachments/assets/7a328e7a-5a97-4b71-bb7a-40adac2d45c3)

---------

Co-authored-by: evanpelle <evanpelle@gmail.com>
@coderabbitai coderabbitai bot mentioned this pull request Jul 8, 2025
5 tasks
@coderabbitai coderabbitai bot mentioned this pull request Jul 17, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

UI/UX UI/UX changes including assets, menus, QoL, etc.

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

3 participants