Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/client/graphics/layers/GameTopBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export class GameTopBar extends LitElement implements Layer {

return html`
<div
class="absolute top-4 left-1/2 transform -translate-x-1/2 flex justify-center items-center p-1 md:px-1.5 lg:px-4 z-[1100]"
class="fixed top-4 left-1/2 transform -translate-x-1/2 flex justify-center items-center p-1 md:px-1.5 lg:px-4 z-[1100]"
>
Comment on lines 80 to 83
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Ensure consistent positioning for replay view (isAlt)

The default branch now uses fixed positioning (👍 for small-screen stability), but the replay branch above (lines 66-70) is still absolute. That difference will re-introduce the original scrolling bug whenever isAlt === true.

-          class="absolute top-4 left-1/2 transform -translate-x-1/2 flex justify-center items-center p-2"
+          class="fixed top-4 left-1/2 transform -translate-x-1/2 flex justify-center items-center p-2"

Matching both branches keeps behaviour predictable and avoids a second special-case tweak later.

🤖 Prompt for AI Agents
In src/client/graphics/layers/GameTopBar.ts around lines 66 to 83, the replay
view branch (lines 66-70) uses absolute positioning while the default branch
(lines 80-83) uses fixed positioning. To ensure consistent positioning and avoid
scrolling bugs when isAlt is true, change the replay view's container from
absolute to fixed positioning to match the default branch.

<div class="flex justify-center items-center gap-1">
${myPlayer?.isAlive() && !this.game.inSpawnPhase()
Expand Down
Loading