fix(client): stabilize HUD and anchor draggable panels
Foundation / checks (checks) (push) Successful in 5s
Foundation / checks (client) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 4s
Foundation / checks (network) (push) Successful in 5s
Foundation / checks (postgres) (push) Successful in 4s
Foundation / checks (tsan) (push) Successful in 4s
Foundation / checks (deploy) (push) Successful in 4m29s
Foundation / postgres-tools (push) Successful in 20s
Foundation / server-image (push) Canceled after 1m43s
Foundation / image (push) Canceled after 1m43s
Foundation / checks (checks) (push) Successful in 5s
Foundation / checks (client) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 4s
Foundation / checks (network) (push) Successful in 5s
Foundation / checks (postgres) (push) Successful in 4s
Foundation / checks (tsan) (push) Successful in 4s
Foundation / checks (deploy) (push) Successful in 4m29s
Foundation / postgres-tools (push) Successful in 20s
Foundation / server-image (push) Canceled after 1m43s
Foundation / image (push) Canceled after 1m43s
This commit is contained in:
+94
-26
@@ -1145,12 +1145,68 @@ bool action_button(const char* label, ImVec2 size, ImVec4 accent) {
|
||||
ImGui::PopStyleColor(4);
|
||||
return pressed;
|
||||
}
|
||||
void panel_heading(const char* title, bool& minimized) {
|
||||
ImVec2 hud_position(ImVec2 position, ImVec2 size) {
|
||||
const auto display = ImGui::GetIO().DisplaySize;
|
||||
const float margin = px(8);
|
||||
return {std::clamp(position.x, margin, std::max(margin, display.x - size.x - margin)),
|
||||
std::clamp(position.y, margin, std::max(margin, display.y - size.y - margin))};
|
||||
}
|
||||
void place_hud_panel(HudPanelPlacement& placement, ImVec2 fallback, ImVec2 size) {
|
||||
const auto display = ImGui::GetIO().DisplaySize;
|
||||
size.x = std::min(size.x, std::max(1.0F, display.x - 2 * px(8)));
|
||||
size.y = std::min(size.y, std::max(1.0F, display.y - 2 * px(8)));
|
||||
auto position = fallback;
|
||||
if (placement.anchor)
|
||||
position = {placement.anchor->first * display.x, placement.anchor->second * display.y};
|
||||
position = hud_position(position, size);
|
||||
if (placement.anchor)
|
||||
placement.anchor = {position.x / display.x, position.y / display.y};
|
||||
ImGui::SetNextWindowPos(position, ImGuiCond_Always);
|
||||
ImGui::SetNextWindowSize(size, ImGuiCond_Always);
|
||||
}
|
||||
float collapsed_height(bool energy = false) {
|
||||
return 2 * ImGui::GetStyle().WindowPadding.y + ImGui::GetFrameHeight() +
|
||||
(energy ? ImGui::GetTextLineHeightWithSpacing() : 0);
|
||||
}
|
||||
void begin_hud_body(const char* id) {
|
||||
ImGui::BeginChild(id, {0, 0}, ImGuiChildFlags_None, ImGuiWindowFlags_AlwaysVerticalScrollbar);
|
||||
ImGui::PushTextWrapPos(0);
|
||||
}
|
||||
void end_hud_body() {
|
||||
ImGui::PopTextWrapPos();
|
||||
ImGui::EndChild();
|
||||
}
|
||||
// The heading stays outside the scrollable body. Only this handle moves a panel.
|
||||
void panel_heading(const char* title, bool& minimized, HudPanelPlacement& placement) {
|
||||
ImGui::PushID(title);
|
||||
const float right = ImGui::GetCursorPosX() + ImGui::GetContentRegionAvail().x;
|
||||
ImGui::AlignTextToFramePadding();
|
||||
ImGui::TextUnformatted(title);
|
||||
ImGui::SameLine();
|
||||
const float small_width = ImGui::CalcTextSize(" + ").x + 2 * ImGui::GetStyle().FramePadding.x;
|
||||
ImGui::SetCursorPosX(right - 2 * small_width - ImGui::GetStyle().ItemSpacing.x);
|
||||
ImGui::SmallButton("::");
|
||||
if (ImGui::IsItemActivated()) {
|
||||
const auto position = ImGui::GetWindowPos();
|
||||
placement.drag_origin = {position.x, position.y};
|
||||
}
|
||||
if (ImGui::IsItemActive() && ImGui::IsMouseDragging(ImGuiMouseButton_Left)) {
|
||||
ImGui::SetMouseCursor(ImGuiMouseCursor_ResizeAll);
|
||||
const auto delta = ImGui::GetMouseDragDelta(ImGuiMouseButton_Left);
|
||||
const auto position = hud_position(
|
||||
{placement.drag_origin.first + delta.x, placement.drag_origin.second + delta.y},
|
||||
ImGui::GetWindowSize());
|
||||
const auto display = ImGui::GetIO().DisplaySize;
|
||||
placement.anchor = {position.x / display.x, position.y / display.y};
|
||||
ImGui::SetWindowPos(position);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetMouseCursor(ImGuiMouseCursor_ResizeAll);
|
||||
ImGui::SetTooltip("Drag to place %s. Double-click to reset its position.", title);
|
||||
if (ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left))
|
||||
placement.anchor.reset();
|
||||
}
|
||||
ImGui::SameLine();
|
||||
ImGui::SetCursorPosX(right - ImGui::CalcTextSize(" + ").x -
|
||||
2 * ImGui::GetStyle().FramePadding.x);
|
||||
if (ImGui::SmallButton(minimized ? " + " : " - "))
|
||||
@@ -1201,35 +1257,32 @@ void hud_vitals(const PanelView& v, FormBuffers& form, bool compact) {
|
||||
const auto& io = ImGui::GetIO();
|
||||
const float clearance = eyepiece_clearance();
|
||||
const float width = std::min(px(300), io.DisplaySize.x - 2 * px(12));
|
||||
if (compact)
|
||||
ImGui::SetNextWindowPos({px(12), px(64)}, ImGuiCond_Always);
|
||||
else
|
||||
ImGui::SetNextWindowPos({clearance, io.DisplaySize.y - px(16)}, ImGuiCond_Always, {0, 1});
|
||||
const auto* play = v.cellular_play;
|
||||
const auto* d = diagnostics(v);
|
||||
if (!play || play->life() == 0)
|
||||
return; // The life window speaks for a cell that is not alive.
|
||||
const float max_height =
|
||||
compact ? std::max(px(120), io.DisplaySize.y - px(220)) : io.DisplaySize.y * 0.43F;
|
||||
ImGui::SetNextWindowSizeConstraints({width, 0}, {width, max_height});
|
||||
// Keep table width stable when the constrained card gains its vertical scrollbar.
|
||||
ImGui::SetNextWindowContentSize(
|
||||
{width - 2 * ImGui::GetStyle().WindowPadding.x - ImGui::GetStyle().ScrollbarSize, 0});
|
||||
const float height = form.vitals_minimized ? collapsed_height(true) : max_height;
|
||||
place_hud_panel(form.vitals_placement,
|
||||
compact ? ImVec2{px(12), px(64)}
|
||||
: ImVec2{clearance, io.DisplaySize.y - px(16) - height},
|
||||
{width, height});
|
||||
ImGui::Begin("Vitals", nullptr,
|
||||
hud_flags | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_AlwaysAutoResize |
|
||||
(form.vitals_minimized ? ImGuiWindowFlags_None
|
||||
: ImGuiWindowFlags_AlwaysVerticalScrollbar));
|
||||
panel_heading("Your cell", form.vitals_minimized);
|
||||
hud_flags | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoScrollbar);
|
||||
panel_heading("Your cell", form.vitals_minimized, form.vitals_placement);
|
||||
if (form.vitals_minimized) {
|
||||
if (d)
|
||||
ImGui::Text("Energy %s", energy_text(d->reserve_energy_pj).c_str());
|
||||
ImGui::End();
|
||||
return;
|
||||
}
|
||||
begin_hud_body("##body");
|
||||
if (!play->fresh())
|
||||
ImGui::TextColored(amber, "Waiting for a fresh server view");
|
||||
if (!d) {
|
||||
disabled_wrapped("Your cell's reserves appear with the next server view.");
|
||||
end_hud_body();
|
||||
ImGui::End();
|
||||
return;
|
||||
}
|
||||
@@ -1321,6 +1374,7 @@ void hud_vitals(const PanelView& v, FormBuffers& form, bool compact) {
|
||||
if (d->light_pj != 0)
|
||||
ImGui::TextDisabled("Sunlight +%s", energy_text(d->light_pj).c_str());
|
||||
}
|
||||
end_hud_body();
|
||||
ImGui::End();
|
||||
}
|
||||
// Bottom centre: the three things a cell does, with what a bud still needs and the last
|
||||
@@ -1339,9 +1393,11 @@ void hud_dock(const PanelView& v, FormBuffers& form, PanelActions& a, bool compa
|
||||
left = std::max(left, eyepiece_clearance() + std::min(px(300), io.DisplaySize.x) + px(12));
|
||||
left = std::max(px(12), std::min(left, io.DisplaySize.x - width - px(12)));
|
||||
ImGui::SetNextWindowPos({left, io.DisplaySize.y - px(16)}, ImGuiCond_Always, {0, 1});
|
||||
ImGui::SetNextWindowSizeConstraints({width, 0}, {width, io.DisplaySize.y});
|
||||
ImGui::SetNextWindowSize(
|
||||
{width, std::min(px(compact ? 140.0F : 180.0F), io.DisplaySize.y - px(32))},
|
||||
ImGuiCond_Always);
|
||||
ImGui::Begin("Actions", nullptr,
|
||||
hud_flags | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_AlwaysAutoResize);
|
||||
hud_flags | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoScrollbar);
|
||||
const float each =
|
||||
(ImGui::GetContentRegionAvail().x - 2 * ImGui::GetStyle().ItemSpacing.x) / 3.0F;
|
||||
const bool active = play && play->fresh() && play->life() != 0;
|
||||
@@ -1383,6 +1439,7 @@ void hud_dock(const PanelView& v, FormBuffers& form, PanelActions& a, bool compa
|
||||
}
|
||||
ImGui::EndTooltip();
|
||||
}
|
||||
begin_hud_body("##details");
|
||||
// Rules 13 (v14): continue as the bud, or grow the organism toward Emerge.
|
||||
if (d && d->members != 0 && play && play->life() != 0) {
|
||||
if (d->members == 1) {
|
||||
@@ -1436,6 +1493,7 @@ void hud_dock(const PanelView& v, FormBuffers& form, PanelActions& a, bool compa
|
||||
}
|
||||
}
|
||||
}
|
||||
end_hud_body();
|
||||
ImGui::End();
|
||||
}
|
||||
// Upper left: what the colours mean, steering, food in range, recent actions.
|
||||
@@ -1444,16 +1502,20 @@ void hud_notes(const PanelView& v, FormBuffers& form, PanelActions& a, bool comp
|
||||
return;
|
||||
const auto& io = ImGui::GetIO();
|
||||
const float clearance = eyepiece_clearance();
|
||||
ImGui::SetNextWindowPos({clearance, px(64)}, ImGuiCond_Always);
|
||||
ImGui::SetNextWindowSizeConstraints({px(260), 0},
|
||||
{px(260), std::max(px(120), io.DisplaySize.y * 0.41F)});
|
||||
place_hud_panel(
|
||||
form.notes_placement, {clearance, px(64)},
|
||||
{px(260), form.notes_minimized
|
||||
? collapsed_height()
|
||||
: std::min(px(260), std::max(px(120), io.DisplaySize.y * 0.41F))});
|
||||
ImGui::Begin("Field notes", nullptr,
|
||||
hud_flags | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_AlwaysAutoResize);
|
||||
panel_heading("Field notes", form.notes_minimized);
|
||||
hud_flags | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoScrollbar);
|
||||
panel_heading("Field notes", form.notes_minimized, form.notes_placement);
|
||||
if (form.notes_minimized) {
|
||||
ImGui::End();
|
||||
return;
|
||||
}
|
||||
begin_hud_body("##body");
|
||||
ImGui::PushTextWrapPos(-1);
|
||||
for (std::size_t i = 0; i < nutrient_names.size(); ++i) {
|
||||
const float glyph_size = ImGui::GetTextLineHeight();
|
||||
const auto at = ImGui::GetCursorScreenPos();
|
||||
@@ -1463,8 +1525,9 @@ void hud_notes(const PanelView& v, FormBuffers& form, PanelActions& a, bool comp
|
||||
ImGui::SameLine(0, ImGui::GetStyle().ItemInnerSpacing.x);
|
||||
ImGui::TextUnformatted(nutrient_names.at(i));
|
||||
if (i % 2 == 0 && i + 1 < nutrient_names.size())
|
||||
ImGui::SameLine(px(130));
|
||||
ImGui::SameLine(px(112));
|
||||
}
|
||||
ImGui::PopTextWrapPos();
|
||||
if (ImGui::CollapsingHeader("Food in range")) {
|
||||
const bool active =
|
||||
v.cellular_play && v.cellular_play->fresh() && v.cellular_play->life() != 0;
|
||||
@@ -1564,6 +1627,7 @@ void hud_notes(const PanelView& v, FormBuffers& form, PanelActions& a, bool comp
|
||||
"vulnerable for 10 seconds before it is suspended.");
|
||||
ImGui::Checkbox("Engineering panels", &form.engineering);
|
||||
}
|
||||
end_hud_body();
|
||||
ImGui::End();
|
||||
}
|
||||
// Upper right: a quiet callout while an offer waits; click it or press E.
|
||||
@@ -1888,16 +1952,19 @@ void hud_map(const PanelView& v, FormBuffers& form, bool compact) {
|
||||
const auto& scene = *v.cellular_scene;
|
||||
const auto& io = ImGui::GetIO();
|
||||
const float width = px(compact ? 184.0F : 210.0F);
|
||||
ImGui::SetNextWindowPos({io.DisplaySize.x - (compact ? px(12) : eyepiece_clearance()), px(126)},
|
||||
ImGuiCond_Always, {1, 0});
|
||||
ImGui::SetNextWindowSizeConstraints({width, 0}, {width, io.DisplaySize.y - px(200)});
|
||||
place_hud_panel(form.map_placement,
|
||||
{io.DisplaySize.x - (compact ? px(12) : eyepiece_clearance()) - width, px(126)},
|
||||
{width, form.map_minimized ? collapsed_height()
|
||||
: std::min(px(compact ? 192.0F : 300.0F),
|
||||
io.DisplaySize.y - px(200))});
|
||||
ImGui::Begin("Nearby", nullptr,
|
||||
hud_flags | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_AlwaysAutoResize);
|
||||
panel_heading("Nearby", form.map_minimized);
|
||||
hud_flags | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoScrollbar);
|
||||
panel_heading("Nearby", form.map_minimized, form.map_placement);
|
||||
if (form.map_minimized) {
|
||||
ImGui::End();
|
||||
return;
|
||||
}
|
||||
begin_hud_body("##body");
|
||||
if (const auto* s = v.cellular_scene; s && s->region_cells != 0)
|
||||
ImGui::TextDisabled("%zu cells in this region", s->region_cells);
|
||||
auto at = ImGui::GetCursorScreenPos();
|
||||
@@ -1972,6 +2039,7 @@ void hud_map(const PanelView& v, FormBuffers& form, bool compact) {
|
||||
ImGui::SetTooltip(
|
||||
"Camera-centred local map. Unseen space is unknown.\nRings: pools. Dots: nutrients. "
|
||||
"Triangles: cells.\nLocal +Y is up; planetary north is not defined.");
|
||||
end_hud_body();
|
||||
ImGui::End();
|
||||
}
|
||||
void cellular(const PanelView& v, FormBuffers& form, PanelActions& a) {
|
||||
|
||||
@@ -81,11 +81,17 @@ struct CellularScene {
|
||||
// Notice layout (logical pixels); the window name is the prefix plus the notice id.
|
||||
inline constexpr float notice_width = 320, notice_close_width = 22;
|
||||
inline constexpr const char* notice_window_prefix = "##notice";
|
||||
// Text-field storage for the connect form (bounded; never persisted).
|
||||
// HUD positions are client-session preferences in normalized viewport coordinates.
|
||||
struct HudPanelPlacement {
|
||||
std::optional<std::pair<float, float>> anchor;
|
||||
std::pair<float, float> drag_origin{};
|
||||
};
|
||||
// Connect form fields and presentation preferences; never persisted.
|
||||
struct FormBuffers {
|
||||
bool engineering{};
|
||||
bool evolution_open{}; // The mutation window (E or the callout opens it).
|
||||
bool notes_minimized{}, vitals_minimized{}, map_minimized{};
|
||||
HudPanelPlacement notes_placement, vitals_placement, map_placement;
|
||||
bool bud_become{}; // Rules 13: the next bud is the player's cell.
|
||||
CellularControls cellular_controls;
|
||||
std::array<char, client::max_field_bytes> endpoint{}, server_name{}, authority{}, grants{};
|
||||
|
||||
@@ -12,7 +12,7 @@ spec:
|
||||
env:
|
||||
- {name: REGION_SESSION, value: "dev"}
|
||||
- {name: REGION_SESSION_LISTEN, value: "0.0.0.0:7400"}
|
||||
- {name: REGION_SESSION_WINDOW, value: "dev-20261026T181727-f8813e1e:1793053047"}
|
||||
- {name: REGION_SESSION_WINDOW, value: "dev-20261026T191314-bce3e436:1793056394"}
|
||||
- {name: REGION_M10_MAX_GRANT_LIFETIME, value: "14400"}
|
||||
ports:
|
||||
# QUIC (ADR-0090): UDP only; nothing listens on TCP 7400.
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# Project status and next steps
|
||||
|
||||
## Stable and movable cellular panels - 2026-10-26
|
||||
|
||||
The client HUD now uses stable card dimensions and scrolling content, keeping
|
||||
headings and action buttons fixed as live messages change. Field notes, Vitals
|
||||
and Nearby have a dedicated drag handle, session anchoring, viewport clamping
|
||||
and double-click position reset. See [controls](engineering/CLIENT_VISUAL_REFRESH.md)
|
||||
and [executed validation](engineering/VALIDATION.md). No biological or wire rule changed.
|
||||
|
||||
## DEV startup wildlife and Bud controls - 2026-10-26
|
||||
|
||||
[ADR-0180](adr/0180-dev-starting-wildlife.md) implements opt-in, nursery-funded
|
||||
|
||||
@@ -131,3 +131,18 @@ at 13 px.
|
||||
- **Applying it.** The scale goes to ImGui's `FontScaleMain` and to `ScaleAllSizes`,
|
||||
taken from the unscaled style. Panel sizes are given in logical units at that scale.
|
||||
Movable panels return to their default place and size once, at each new scale.
|
||||
|
||||
## Amendment (2026-10-26): stable, anchored cellular HUD cards
|
||||
|
||||
At the maintainer's request, Field notes, Vitals and Nearby use a distinct drag
|
||||
handle beside minimize. Client-session normalized positions remain anchored on
|
||||
release, including through viewport/UI-scale changes, and clamp inside the new
|
||||
viewport. Double-clicking the handle resets its position. This supersedes the
|
||||
scale-reset behavior above for these three cards; no layout is saved to disk.
|
||||
|
||||
Their expanded outer sizes and the action dock size depend only on viewport and
|
||||
UI scale. Scrollable bodies reserve scrollbar gutters and wrap live text; the
|
||||
headings and action buttons stay outside those bodies. Thus temporary text and
|
||||
scrollbar thresholds cannot resize/reposition the outer panels. This reuses the
|
||||
pinned toolkit and existing pointer-capture boundary; biological authority,
|
||||
protocols, dependencies and headless APIs are unchanged.
|
||||
|
||||
@@ -117,3 +117,12 @@ uses the current server-projected charge, including the inherited plan and fee.
|
||||
Insufficient funding disables it, with a hover tooltip listing required and held
|
||||
energy, carbon, nitrogen, phosphorus and other matter. Internal-cell litter shows
|
||||
the maximum possible charge. The server remains authoritative at execution time.
|
||||
|
||||
The cellular HUD cards use client-owned session placement in `FormBuffers`.
|
||||
Only each heading's drag handle moves its card; normalized anchors are retained
|
||||
through redraws, collapse/restore and viewport/scale changes, with on-screen
|
||||
clamping and a double-click reset. Fixed outer dimensions and scrollable bodies
|
||||
with reserved gutters prevent live text from feeding back into panel geometry.
|
||||
The action dock's button row stays outside its scrolling details. This state is
|
||||
presentation-only and is neither persisted nor sent to the server; see the
|
||||
[visual refresh controls](../engineering/CLIENT_VISUAL_REFRESH.md).
|
||||
|
||||
@@ -37,9 +37,20 @@ violet for budding. Labels and authoritative enable/disable logic remain intact;
|
||||
color alone does not communicate affordability or success. Existing bindings
|
||||
remain authoritative; decorative shortcut numbers are not invented.
|
||||
|
||||
Field notes, Vitals and Nearby have explicit minus/plus buttons. Collapsing
|
||||
Vitals retains energy. State lasts for the client session; it is not saved.
|
||||
The responsive compact layout keeps the dock and map within the viewport.
|
||||
Field notes, Vitals and Nearby have explicit minus/plus buttons and a separate
|
||||
`::` drag handle. Drag the handle to place a card; releasing anchors its position.
|
||||
Double-click the handle to restore the responsive default. Collapsing Vitals
|
||||
retains energy. Placement and collapse state last for the client session and are
|
||||
not saved to disk. Anchors use normalized viewport coordinates and are clamped
|
||||
inside the window when it is resized or the UI scale changes.
|
||||
|
||||
Expanded card sizes depend on viewport/scale, not the current text. Overflow
|
||||
scrolls inside a body with a reserved vertical scrollbar gutter; headings stay
|
||||
fixed and long text wraps at the body width. Minimize/restore intentionally
|
||||
changes a card's height. The action dock likewise keeps its buttons fixed above
|
||||
a scrollable details area. Changing nutrient values, growth warnings, pending
|
||||
results, region-edge notices and stale observations cannot resize or re-anchor
|
||||
these panels. The responsive compact layout keeps the dock and map within the viewport.
|
||||
|
||||
Nearby is a camera-centred observation map with a fixed six-millimetre radius.
|
||||
It reads the received food and organism views only, including observations
|
||||
|
||||
@@ -10249,3 +10249,47 @@ Publication limit: the scoped commit was created locally, but the configured HTT
|
||||
remote rejected git push with an authentication failure. Git Credential Manager
|
||||
is configured; no stored credential was deleted or changed. A user-authorized retry uses credentials supplied outside the repository. Unrelated drafts and untracked files
|
||||
remain outside the commit.
|
||||
|
||||
## 2026-10-26 - Stable HUD geometry and anchored panel dragging
|
||||
|
||||
Scope: apps/evo-client panel drawing/state and native panel regression, with the
|
||||
ADR-0084 presentation amendment. No simulation, server, wire, dependency or
|
||||
persistent-settings format changed. Unrelated drafts and untracked work remain
|
||||
untouched.
|
||||
|
||||
Executed:
|
||||
|
||||
- GCC 14.2 Release/NDEBUG in the existing release-preset build/playtest-release:
|
||||
rebuilt evo-client, panel and UI-model targets; client CTests excluding the
|
||||
panel test passed 9/9. The final production panel executable passed separately
|
||||
with SDL_VIDEO_DRIVER=dummy, SDL_RENDER_DRIVER=software and review output in
|
||||
ignored build/hud-review. Earlier panel CTest runs also passed during iteration.
|
||||
- MSVC 19.44: tools/windows-check.ps1 -Preset client -Action check passed; all
|
||||
10/10 client CTests passed with TMP/TEMP in ignored build/playtest-windows-tmp.
|
||||
- Clang 19 analysis-preset build/playtest-analysis: rebuilt evo-client and its
|
||||
panel regression with clang-tidy and warnings as errors; build passed.
|
||||
- Clang 19 ASan+UBSan, existing asan-preset build/client-asan: rebuilt the final
|
||||
native panel test and its production panels; focused CTest passed 1/1.
|
||||
- Repository format-check passed with clang-format 19, including a dry run of
|
||||
the changed app header through the same formatter; git diff --check passed.
|
||||
- Native coverage at 640x480, 960x640 and 1280x800 changes diagnostics/membership,
|
||||
growth warnings, sunlight, edge/stale/census text and expanded notes on each
|
||||
of 16 consecutive frames. Outer position/size and child content width must
|
||||
remain identical, with zero horizontal overflow. Action details exercise both
|
||||
fitting and vertically overflowing content without changing the button row.
|
||||
- Real SDL pointer events drag all three card handles, release and retain their
|
||||
anchors, minimize/restore a moved card, resize the viewport, drag far outside
|
||||
bounds and double-click the reset handle. Bounds and pointer capture prevent
|
||||
world clicks. Existing Bud/tooltip, evolution, death/restart and panel capture
|
||||
checks remain in the same native regression.
|
||||
- Generated native BMPs for normal, overflowing and moved panels in
|
||||
build/hud-review. Reviewed PNG conversions at 640x480, 960x640 and 1280x800.
|
||||
The first review showed the nutrient legend breaking a word in its narrower
|
||||
scrolling body; a tighter two-column legend with unwrapped names fixed it,
|
||||
followed by the final Release, Windows, analysis and sanitizer checks above.
|
||||
|
||||
Limits: positions/collapse state are client-session preferences, not saved across
|
||||
application restarts. Hardware DPI, accessibility, touch interaction and motion
|
||||
comfort still need interactive review. No deployment, live session, World0 change,
|
||||
reset or prune occurred. The required pre-push session-window refresh is desired
|
||||
Git configuration only.
|
||||
|
||||
@@ -500,6 +500,76 @@ void cellular_panels(const std::filesystem::path& review) {
|
||||
if (width >= 880)
|
||||
CHECK(fits(ImGui::FindWindowByName("Field notes")) &&
|
||||
disjoint(vitals, ImGui::FindWindowByName("Field notes")));
|
||||
// Live messages may change overflow, but never move/resize the cards or
|
||||
// reflow their content width. Exercise every frame, including empty data.
|
||||
struct Geometry {
|
||||
ImGuiWindow* panel;
|
||||
ImVec2 position, size;
|
||||
float body_width;
|
||||
};
|
||||
std::vector<Geometry> geometry;
|
||||
bool details_fit = false, details_overflow = false;
|
||||
for (const auto* name : {"Vitals", "Nearby", "Actions", "Field notes"}) {
|
||||
auto* panel = ImGui::FindWindowByName(name);
|
||||
if (!panel || !panel->Active)
|
||||
continue;
|
||||
CHECK(panel->DC.ChildWindows.Size == 1);
|
||||
geometry.push_back(
|
||||
{panel, panel->Pos, panel->Size, panel->DC.ChildWindows[0]->InnerRect.GetWidth()});
|
||||
}
|
||||
for (int sample = 0; sample < 16; ++sample) {
|
||||
auto changing = diagnostics;
|
||||
changing.members = static_cast<std::uint16_t>(sample % 3 == 0 ? 8 : 1);
|
||||
changing.growth_per_thousand = sample % 2 == 0 ? 1000 : 475;
|
||||
changing.growth_limit = static_cast<std::uint8_t>(sample % 7);
|
||||
changing.light_pj = sample % 2 == 0 ? 0 : 1'000'000;
|
||||
changing.bud_cost_energy_pj = sample % 2 == 0 ? 0 : 1'000'000;
|
||||
changing.bud_cost_matter_fg =
|
||||
sample % 2 == 0 ? std::array<std::uint64_t, 4>{} : diagnostics.bud_cost_matter_fg;
|
||||
perception.diagnostics =
|
||||
sample % 4 == 0 ? std::optional<network::CellularLifeDiagnostics>{} : changing;
|
||||
scene.at_edge = sample % 2 == 0;
|
||||
scene.stale = sample % 2 != 0;
|
||||
scene.region_cells = sample % 2 == 0 ? 0 : 256;
|
||||
if (auto* notes = ImGui::FindWindowByName("Field notes"); notes && notes->Active) {
|
||||
auto* body = notes->DC.ChildWindows[0];
|
||||
for (const auto* heading : {"Food in range", "Burning reserve matter", "Body",
|
||||
"Steering", "Recent actions", "Help"})
|
||||
body->StateStorage.SetInt(body->GetID(heading), sample % 2);
|
||||
}
|
||||
draw();
|
||||
for (const auto& card : geometry) {
|
||||
CHECK(fits(card.panel));
|
||||
CHECK(card.panel->Pos.x == card.position.x && card.panel->Pos.y == card.position.y);
|
||||
CHECK(card.panel->Size.x == card.size.x && card.panel->Size.y == card.size.y);
|
||||
CHECK(card.panel->DC.ChildWindows[0]->InnerRect.GetWidth() == card.body_width);
|
||||
const auto* body = card.panel->DC.ChildWindows[0];
|
||||
CHECK(body->ScrollMax.x == 0);
|
||||
if (card.panel == dock) {
|
||||
details_fit = details_fit || body->ScrollMax.y == 0;
|
||||
details_overflow = details_overflow || body->ScrollMax.y > 0;
|
||||
}
|
||||
}
|
||||
if (!review.empty() && sample == 15) {
|
||||
std::filesystem::create_directories(review);
|
||||
CHECK(app->request_screenshot(
|
||||
(review / ("cellular-overflow-" + std::to_string(width) + ".bmp")).string()));
|
||||
draw();
|
||||
}
|
||||
}
|
||||
CHECK(details_fit && details_overflow);
|
||||
perception.diagnostics = diagnostics;
|
||||
scene.at_edge = false;
|
||||
scene.stale = false;
|
||||
scene.region_cells = 0;
|
||||
if (auto* notes = ImGui::FindWindowByName("Field notes"); notes && notes->Active) {
|
||||
auto* body = notes->DC.ChildWindows[0];
|
||||
for (const auto* heading : {"Food in range", "Burning reserve matter", "Body",
|
||||
"Steering", "Recent actions", "Help"})
|
||||
body->StateStorage.SetInt(body->GetID(heading), 0);
|
||||
}
|
||||
for (int i = 0; i < 3; ++i)
|
||||
draw();
|
||||
// Minimize/restore stays local to the panel, including a same-batch click.
|
||||
const auto toggle = [&](const char* name, bool& minimized) {
|
||||
const auto* panel = ImGui::FindWindowByName(name);
|
||||
@@ -526,6 +596,78 @@ void cellular_panels(const std::filesystem::path& review) {
|
||||
toggle("Nearby", form.map_minimized);
|
||||
if (width >= 880)
|
||||
toggle("Field notes", form.notes_minimized);
|
||||
if (width == 960) {
|
||||
const auto handle = [](const ImGuiWindow* panel) {
|
||||
const auto& style = ImGui::GetStyle();
|
||||
const float small = ImGui::CalcTextSize(" + ").x + 2 * style.FramePadding.x;
|
||||
const float grab = ImGui::CalcTextSize("::").x + 2 * style.FramePadding.x;
|
||||
return ImVec2{panel->Pos.x + panel->Size.x - style.WindowPadding.x - 2 * small -
|
||||
style.ItemSpacing.x + grab / 2,
|
||||
panel->Pos.y + style.WindowPadding.y + ImGui::GetFrameHeight() / 2};
|
||||
};
|
||||
const auto drag = [&](const char* name, HudPanelPlacement& placement, float dx,
|
||||
float dy) {
|
||||
auto* panel = ImGui::FindWindowByName(name);
|
||||
CHECK(panel);
|
||||
const auto start = handle(panel);
|
||||
const auto previous = panel->Pos;
|
||||
mouse(id, SDL_EVENT_MOUSE_MOTION, start.x, start.y);
|
||||
draw();
|
||||
mouse(id, SDL_EVENT_MOUSE_BUTTON_DOWN, start.x, start.y);
|
||||
draw();
|
||||
CHECK(!app->take_navigation().click);
|
||||
mouse(id, SDL_EVENT_MOUSE_MOTION, start.x + dx, start.y + dy);
|
||||
draw();
|
||||
mouse(id, SDL_EVENT_MOUSE_BUTTON_UP, start.x + dx, start.y + dy);
|
||||
for (int i = 0; i < 3; ++i)
|
||||
draw();
|
||||
CHECK(!app->take_navigation().click && placement.anchor && fits(panel));
|
||||
CHECK(panel->Pos.x != previous.x || panel->Pos.y != previous.y);
|
||||
return panel->Pos;
|
||||
};
|
||||
const auto anchored = drag("Vitals", form.vitals_placement, 40, -30);
|
||||
toggle("Vitals", form.vitals_minimized);
|
||||
CHECK(vitals->Pos.x == anchored.x && vitals->Pos.y == anchored.y);
|
||||
for (int i = 0; i < 4; ++i)
|
||||
draw();
|
||||
CHECK(vitals->Pos.x == anchored.x && vitals->Pos.y == anchored.y);
|
||||
drag("Field notes", form.notes_placement, 30, 10);
|
||||
drag("Nearby", form.map_placement, -35, 20);
|
||||
if (!review.empty()) {
|
||||
mouse(id, SDL_EVENT_MOUSE_MOTION, 5, 5);
|
||||
draw();
|
||||
CHECK(app->request_screenshot((review / "cellular-panels-moved.bmp").string()));
|
||||
draw();
|
||||
}
|
||||
CHECK(SDL_SetWindowSize(window(), 640, 480));
|
||||
for (int i = 0; i < 4; ++i)
|
||||
draw();
|
||||
for (const auto* name : {"Vitals", "Nearby"}) {
|
||||
const auto* panel = ImGui::FindWindowByName(name);
|
||||
const auto extent = ImGui::GetIO().DisplaySize;
|
||||
CHECK(panel && panel->Pos.x >= 0 && panel->Pos.y >= 0 &&
|
||||
panel->Pos.x + panel->Size.x <= extent.x &&
|
||||
panel->Pos.y + panel->Size.y <= extent.y);
|
||||
}
|
||||
CHECK(SDL_SetWindowSize(window(), width, height));
|
||||
for (int i = 0; i < 4; ++i)
|
||||
draw();
|
||||
drag("Nearby", form.map_placement, 10'000, 10'000);
|
||||
// The reset gesture uses the same production handle, with no world click.
|
||||
const auto reset_at = handle(ImGui::FindWindowByName("Nearby"));
|
||||
for (int click = 0; click < 2; ++click) {
|
||||
mouse(id, SDL_EVENT_MOUSE_MOTION, reset_at.x, reset_at.y);
|
||||
mouse(id, SDL_EVENT_MOUSE_BUTTON_DOWN, reset_at.x, reset_at.y);
|
||||
draw();
|
||||
mouse(id, SDL_EVENT_MOUSE_BUTTON_UP, reset_at.x, reset_at.y);
|
||||
draw();
|
||||
}
|
||||
CHECK(!form.map_placement.anchor && !app->take_navigation().click);
|
||||
form.vitals_placement.anchor.reset();
|
||||
form.notes_placement.anchor.reset();
|
||||
for (int i = 0; i < 3; ++i)
|
||||
draw();
|
||||
}
|
||||
mouse(id, SDL_EVENT_MOUSE_MOTION, 5, 5);
|
||||
// A depleted channel vanishes independently. Stale observations retain the food
|
||||
// silhouettes but never their fresh opacity. Inspect the world draw list, not HUD.
|
||||
|
||||
Reference in New Issue
Block a user