Skip to content

Make the admin panel a side panel that docks and floats - #1676

Open
lex wants to merge 6 commits into
Refactorio:developfrom
lex:admin-panel-dock
Open

lex wants to merge 6 commits into
Refactorio:developfrom
lex:admin-panel-dock

Conversation

@lex

@lex lex commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

The admin panel becomes a side panel like Settings (#1675): it docks under the top buttons, the pin floats it, and the X and the top button close it.

  • Built with Gui.add_panel (frameless, as wide as its page): the page buttons on the left and the page on the right, as before.
  • It no longer becomes player.opened, so Escape doesn't close it any more. Closing it, by the X or the top button, still raises on_admin_gui_closed, so the moderation guide's windows close with it.
  • The moderation guide's windows open beside the panel when it floats, and in the middle of the screen when it is docked. Beside it, their offset was in pixels, so at a UI scale of 200% they overlapped the panel (on develop too); it is now in GUI pixels.
  • The test that it opens on its first page finds the panel docked or floating.

Docked, a panel can be no taller than the column under the top buttons: past it, the game cuts the column off with a scroll bar of its own. The Players page is about 35 px too tall for it at 1080p, so docked it gets that scroll bar (1_docked_players); the other pages open whole. Floating, the panel is as tall as its page. Kick & ban stays on the Players page with the other admin actions.

Tests

  • In a client: it opens docked on its first page, every page opens docked (Players, Map, Lua console), ticking a reason or flipping the online/offline switch redraws the Players page in place, the pin floats it, every page works floating too, the guide's windows open docked and floating, and the X closes it.
  • luacheck .: 0 warnings / 0 errors.

Screenshots

Docked, Players:

1_docked_players

Docked, Map:

2_docked_map

Docked, Lua console:

3_docked_console

Floating:

4_floating

🤖 Generated with Claude Code

lex and others added 5 commits November 2, 2026 23:04
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d panel

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… clear of the floating panel

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment on lines +63 to +71
-- a page of its own, so that each page opens whole when the panel is docked
pages[#pages +1] = {
type = 'sprite-button',
sprite = 'utility/danger_icon',
tooltip = '[font=default-bold]Kick & ban[/font]',
name = kick_ban_button_name,
auto_toggle = true,
tags = { admin_only = false },
}

@RedRafe RedRafe Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm okay to making Admin panel a panel type. I'm not okay with moving some admin actions to a separate page.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

there's some restriction on the height apparently and you'll get a scroll bar instead if you don't move them

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Put it back in d2903c5; docked, the Players page gets the game's column scroll bar at 1080p, floating it's fine.

RedRafe would rather keep the admin actions together on one page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@RedRafe

RedRafe commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

If floating window doesn't get the scrollbar & fits whole, I think the docked version too should override the max height: since floating window would be sitting in the middle of the screen, if there is enough space for it, there should be enough space even if panel is docked of the upper left, correct?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants