Skip to content

fix(editor): Server List undo steps after a click, and the bar's tooltip only on hover - #846

Merged
Mosch0512 merged 3 commits into
sven-n:mainfrom
Mosch0512:fix/server-list-undo-steps
Oct 22, 2026
Merged

Mosch0512 merged 3 commits into
sven-n:mainfrom
Mosch0512:fix/server-list-undo-steps

Conversation

@Mosch0512

Copy link
Copy Markdown
Collaborator

What this does

Two follow-ups to #845 (the Server List window):

  • What was typed stays an undo step of its own. A text field's edit became an undo step only once no widget was active. Leaving the field with a click on a button or box made that widget active, and its change joined the typed text in one step: renaming Helheim to Asgard and then clicking Move up gave one step "Move Asgard", and one Undo took back both. A name followed by a click into the description became one step too. Leaving a field now ends its edit as a step, and the list buttons, the test server box and the channel types first make what was typed a step before they change the groups.
  • The editor bar names the undo step only for its tooltip. The bar asked for the names of the next Undo and Redo on every frame; for the Server List window that compared the group lists and formatted a text each frame while a change was typed. They are asked for only while a button is hovered, as before feat: server list as JSON with a Server List editor window #845.

docs/server-list.md now says what one undo step is.

Testing

  • New Server List window tests in server_list_data_tests draw the window without a renderer, type into the name field and then press Move down, the test server box or the description field, and check that the typed name is an undo step of its own. The server list tests link Winmain.cpp for the editor's globals now, as the item tool tests do; TestImGuiContext moved to tests/data/TestImGuiContext.h for both.
  • server_list_data_tests: 41/41 pass; the item tool tests (test_item_database_files, [editor]): 46/46 pass (Windows, Release, editor build).
  • clang-format 21.1.8 on the changed lines.
  • Not tried in the game yet.

Commits

  1. test(data): the ImGui test context in a header of its own
  2. fix(editor): what was typed in the Server List window stays an undo step of its own
  3. perf(editor): the editor bar names its undo step only for the tooltip

The item tool tests drew their windows in a TestImGuiContext of their own
file. The Server List window test of the next commit draws an editor window
the same way, so the context moves to tests/data/TestImGuiContext.h.
…tep of its own

A text field's edit became an undo step only once no widget was active.
Leaving the field with a click on a button or box made that widget active,
and its change, made on release, joined the typed text in one step:
renaming Helheim to Asgard and clicking Move up gave one step "Move Asgard",
and one Undo took back both. A name followed by a click into the
description became one step too.

Leaving a field now ends its edit as a step, and a button, the test server
box and a channel type first make what was typed a step before they change
the groups. The new window test types into the fields and presses the
widgets in the same frame, as ImGui's activation does; the server list
tests link Winmain.cpp for the editor's globals, as the item tool tests do.
RenderBarButtons asked the tool for the names of its next Undo and Redo on
every frame, also when no tooltip showed; for the Server List window that
compared the group lists and formatted a text each frame while a change was
typed. The names are asked for only while a button is hovered, as before the
shared Undo and Redo, and whether a step is left is asked again after a
click.
@Mosch0512
Mosch0512 merged commit 139faa9 into sven-n:main Oct 22, 2026
7 checks passed
@Mosch0512
Mosch0512 deleted the fix/server-list-undo-steps branch October 25, 2026 18:30
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.

1 participant