diff --git a/apps/evo-client/main.cpp b/apps/evo-client/main.cpp index 5ad5d9c..a13c85a 100644 --- a/apps/evo-client/main.cpp +++ b/apps/evo-client/main.cpp @@ -791,6 +791,13 @@ int main(int argc, char** argv) try { static_cast(cell.x.value) / 1000, static_cast(cell.voxel.y) * pitch + static_cast(cell.y.value) / 1000}; + c.extent_um = ph.extent; + c.speed_um_s = ph.movement_speed; + c.conversion_per_thousand = ph.conversion_per_thousand; + c.grown_per_thousand = cell.growth.realized_per_thousand; + c.mass_fg = ph.total_mass; + c.membrane_fg = ph.membrane_mass; + c.ingestion_fg_s = ph.ingestion_rate; if (const auto heading = headings.update(cell.id, at, *camera)) { c.facing = true; c.heading = *heading; diff --git a/apps/evo-client/panels.cpp b/apps/evo-client/panels.cpp index 9652827..00556a6 100644 --- a/apps/evo-client/panels.cpp +++ b/apps/evo-client/panels.cpp @@ -793,6 +793,29 @@ void draw_eyepiece(ImDrawList& list, ImVec2 size) { IM_COL32(0, 0, 0, alpha / 3), std::max(0.0F, rounding - d), 0, step + 0.5F); } } +// Hovering a cell (not over the HUD) rings it and shows what its phenotype says. +void inspect_cell(ImDrawList& list, const SceneCell& c) { + const float r = std::max(c.radius, 5.0F); + list.AddCircle({c.x, c.y}, r * 1.6F + 6.0F, IM_COL32(245, 181, 68, 200), 0, 2.0F); + ImGui::BeginTooltip(); + ImGui::TextColored(lavender, "%s", + c.own ? "YOUR CELL" + : c.dead ? "DEAD CELL - FOOD" + : "ANOTHER CELL"); + ImGui::Text("Size %u µm across, %s", c.extent_um, mass_text(c.mass_fg).c_str()); + if (!c.dead) { + ImGui::Text("Grown %u%%", c.grown_per_thousand / 10); + if (c.speed_um_s == 0) + ImGui::TextUnformatted("Speed cannot swim"); + else + ImGui::Text("Speed %u µm/s", c.speed_um_s); + ImGui::Text("Membrane %s (%u%% of body)", mass_text(c.membrane_fg).c_str(), + c.mass_fg == 0 ? 0U : static_cast(c.membrane_fg * 100 / c.mass_fg)); + ImGui::Text("Intake %s/s", mass_text(c.ingestion_fg_s).c_str()); + ImGui::Text("Converts %u%% of food energy", c.conversion_per_thousand / 10); + } + ImGui::EndTooltip(); +} void draw_scene(const PanelView& v) { if (!v.cellular_scene) return; @@ -803,6 +826,22 @@ void draw_scene(const PanelView& v) { for (const auto& cell : v.cellular_scene->cells) draw_cell(list, cell, time); draw_eyepiece(list, ImGui::GetIO().DisplaySize); + const auto& io = ImGui::GetIO(); + if (io.WantCaptureMouse || !ImGui::IsMousePosValid()) + return; + const SceneCell* hovered = nullptr; + float best = 0; + for (const auto& cell : v.cellular_scene->cells) { + const float dx = io.MousePos.x - cell.x, dy = io.MousePos.y - cell.y; + const float reach = std::max(cell.radius, 5.0F) * 1.4F + 6.0F; + const float distance = dx * dx + dy * dy; + if (distance <= reach * reach && (!hovered || distance < best)) { + hovered = &cell; + best = distance; + } + } + if (hovered) + inspect_cell(list, *hovered); } // The eyepiece corner radius in logical units: HUD windows keep clear of it. float eyepiece_clearance() { diff --git a/apps/evo-client/panels.hpp b/apps/evo-client/panels.hpp index 8d14114..6a1cca2 100644 --- a/apps/evo-client/panels.hpp +++ b/apps/evo-client/panels.hpp @@ -32,6 +32,9 @@ struct SceneCell { std::uint64_t seed{}; // Stable per organism: organelle layout (and orientation at rest). bool facing{}; // Heading is known: the cell faces it, flagella trailing. float heading{}; // Screen radians. + // What hovering the cell shows (its replicated phenotype; no hidden state). + std::uint32_t extent_um{}, speed_um_s{}, conversion_per_thousand{}, grown_per_thousand{}; + std::uint64_t mass_fg{}, membrane_fg{}, ingestion_fg_s{}; }; struct ScenePatch { float x{}, y{}, half{}; // Centre and half side of the 1 mm contact footprint. diff --git a/deploy/kubernetes/region/dev-session-route/listener.yaml b/deploy/kubernetes/region/dev-session-route/listener.yaml index e8b992c..82104c5 100644 --- a/deploy/kubernetes/region/dev-session-route/listener.yaml +++ b/deploy/kubernetes/region/dev-session-route/listener.yaml @@ -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-20261017T015347-29526:1792212827"} + - {name: REGION_SESSION_WINDOW, value: "dev-20261017T020216-38024:1792213336"} - {name: REGION_M10_MAX_GRANT_LIFETIME, value: "14400"} ports: # QUIC (ADR-0090): UDP only; nothing listens on TCP 7400. diff --git a/tests/client_panels.cpp b/tests/client_panels.cpp index 421052f..4b7dd57 100644 --- a/tests/client_panels.cpp +++ b/tests/client_panels.cpp @@ -495,6 +495,14 @@ void cellular_panels(const std::filesystem::path& review) { } if (width != 960) continue; + // Hovering a cell outside the HUD shows its inspection card. + mouse(id, SDL_EVENT_MOUSE_MOTION, 500, 220); + for (int i = 0; i < 3; ++i) + draw(); + const auto* card = ImGui::FindWindowByName("##Tooltip_00"); + CHECK(card && card->Active); + mouse(id, SDL_EVENT_MOUSE_MOTION, 5, 5); + draw(); // E opens the mutation window over the world. SDL_Event e_key{}; e_key.type = SDL_EVENT_KEY_DOWN;