Files
aevolution/apps/evo-client/panels.cpp
T
dingoandClaude Opus 5.5 3320a8a574
Foundation / checks (deploy) (push) Successful in 3m26s
Foundation / checks (ecs) (push) Successful in 2m2s
Foundation / checks (client) (push) Successful in 12m47s
Foundation / checks (tsan) (push) Canceled after 0s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (network) (push) Canceled after 11m44s
Foundation / checks (checks) (push) Canceled after 17m14s
Foundation / checks (postgres) (push) Canceled after 4m27s
client: skip used grants; scale the engineering UI with the window
- A stale_grant before Welcome spends only that grant: the session tries the next one
  in the bundle and ends as exhausted when none is left (other refusals still stop).
- UI scale (ADR-0084 amendment): embedded scalable font (ProggyForever), scale from
  logical window height (720 reference, 1.0-2.5) times a Ctrl+= / Ctrl+- nudge; panel
  sizes and table columns in logical units; movable panels placed again per scale.
- --size W,H for engineering review screenshots.
- Tests: client_remote_session (stale grant, exhausted), client_ui_state (scale).
Refresh the dev session window.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 12:09:57 -04:00

523 lines
24 KiB
C++

#include "panels.hpp"
#include "evo/client/labels.hpp"
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <imgui.h>
#include <string>
namespace evo::client_app {
namespace {
using client::LaunchPhase;
// Logical sizes at the current UI scale (window height and Ctrl+= / Ctrl+-).
float px(float v) {
return v * ImGui::GetStyle().FontScaleMain;
}
// A panel placed once (the user may move or resize it), and again at each new UI scale.
ImGuiCond placed(float& seen) {
const float scale = ImGui::GetStyle().FontScaleMain;
if (scale == seen)
return ImGuiCond_FirstUseEver;
seen = scale;
return ImGuiCond_Always;
}
ImVec4 color(render::Color c) {
return {static_cast<float>(c.red) / 255.0F, static_cast<float>(c.green) / 255.0F,
static_cast<float>(c.blue) / 255.0F, static_cast<float>(c.alpha) / 255.0F};
}
void copy(std::array<char, client::max_field_bytes>& out, const std::string& in) {
out.fill('\0');
std::memcpy(out.data(), in.data(), std::min(in.size(), out.size() - 1));
}
std::string text(const std::array<char, client::max_field_bytes>& in) {
return {in.begin(), std::find(in.begin(), in.end(), '\0')};
}
void row(const char* label, const std::string& value, const std::string& unit = {}) {
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::TextUnformatted(label);
ImGui::TableNextColumn();
ImGui::TextUnformatted(value.c_str());
ImGui::TableNextColumn();
ImGui::TextUnformatted(unit.c_str());
}
void swatch(const char* id, render::Color c, const char* label) {
ImGui::ColorButton(id, color(c), ImGuiColorEditFlags_NoTooltip | ImGuiColorEditFlags_NoAlpha,
{px(14), px(14)});
ImGui::SameLine();
ImGui::TextUnformatted(label);
}
constexpr ImVec4 amber{0.94F, 0.67F, 0.16F, 1.0F}, red{0.95F, 0.35F, 0.35F, 1.0F},
green{0.35F, 0.80F, 0.60F, 1.0F};
ImVec4 freshness_color(client::Freshness f) {
return f == client::Freshness::current ? green : f == client::Freshness::stale ? amber : red;
}
const char* outcome_name(client::OutcomeState s) {
switch (s) {
case client::OutcomeState::sent:
return "sent (no reply yet)";
case client::OutcomeState::admitted:
return "admitted (not yet durable)";
case client::OutcomeState::rejected:
return "rejected";
case client::OutcomeState::durable:
return "durable, no effect";
case client::OutcomeState::not_committed:
return "not committed";
case client::OutcomeState::unknown:
return "UNKNOWN (connection lost)";
case client::OutcomeState::simulated:
return "simulated (not durable)";
}
return "?";
}
void disabled_wrapped(const char* text) {
ImGui::PushStyleColor(ImGuiCol_Text, ImGui::GetStyleColorVec4(ImGuiCol_TextDisabled));
ImGui::TextWrapped("%s", text);
ImGui::PopStyleColor();
}
std::string key_label(client::KeyCode key) {
return key == client::no_key ? std::string{"-"} : std::string{client::key_name(key)};
}
std::string controls_hint(const client::Bindings& b) {
using client::Action;
const auto k = [&](Action action) { return key_label(b.slot(action).primary); };
return "Click selects, wheel zooms. Move " + k(Action::move_up) + " " + k(Action::move_left) +
" " + k(Action::move_down) + " " + k(Action::move_right) + "; pan " + k(Action::pan_up) +
" " + k(Action::pan_left) + " " + k(Action::pan_down) + " " + k(Action::pan_right) +
"; UI capture " + k(Action::toggle_capture) + ".";
}
// Fixed wording only (never echoes paths or file bytes); wraps inside the launcher.
void error_text(client::LaunchError error) {
ImGui::PushStyleColor(ImGuiCol_Text, red);
ImGui::TextWrapped("%s", std::string{client::launch_error_text(error)}.c_str());
ImGui::PopStyleColor();
}
constexpr std::array<const char*, world::field_count + 1> layer_names{
"Water", "Dissolved nitrogen", "Dissolved phosphorus",
"Organic carbon", "Organic nitrogen", "Organic phosphorus",
"Organic other", "Organic energy", "Incident energy",
"Heat", "Moisture (saturation)"};
void launcher(const PanelView& v, FormBuffers& form, PanelActions& a) {
const auto phase = v.launcher->phase();
const auto& io = ImGui::GetIO();
ImGui::SetNextWindowPos({io.DisplaySize.x * 0.5F, io.DisplaySize.y * 0.5F}, ImGuiCond_Always,
{0.5F, 0.5F});
ImGui::SetNextWindowSize({std::min(px(520), io.DisplaySize.x - px(16)), 0}, ImGuiCond_Always);
ImGui::Begin("Aeternalis Evolution - engineering client", nullptr,
ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse);
ImGui::TextWrapped("Choose a data source. Nothing here is a game or a player account.");
if (ImGui::SmallButton("Controls..."))
a.open_controls = true;
ImGui::Separator();
if (ImGui::Button("Local fixture", {px(160), 0}))
a.fixture = true;
ImGui::SameLine();
ImGui::TextWrapped("In-memory stand-in: environment changes and static organisms. Not a "
"server, not an ecosystem, not authoritative.");
ImGui::Separator();
ImGui::TextUnformatted("Connect to a dev region");
ImGui::BeginDisabled(!v.remote_available || phase == LaunchPhase::connecting);
ImGui::InputText("Endpoint (host:port)", form.endpoint.data(), form.endpoint.size());
ImGui::InputText("Server name", form.server_name.data(), form.server_name.size());
ImGui::InputText("Dev CA file", form.authority.data(), form.authority.size());
ImGui::InputText("Grant bundle file", form.grants.data(), form.grants.size());
const bool start = phase == LaunchPhase::choosing && ImGui::Button("Connect", {px(160), 0});
ImGui::EndDisabled();
if (start)
a.connect = true;
if (!v.remote_available)
ImGui::TextColored(amber, "Remote mode needs a build with EVO_BUILD_NETWORK.");
if (v.form_error)
error_text(*v.form_error);
if (phase == LaunchPhase::connecting) {
ImGui::TextColored(amber, "Connecting (TLS handshake and grant check)...");
if (ImGui::Button("Cancel", {px(120), 0}))
a.cancel = true;
}
if (phase == LaunchPhase::failed) {
error_text(v.launcher->error());
if (ImGui::Button("Retry", {px(120), 0}))
a.retry = true;
ImGui::SameLine();
if (ImGui::Button("Cancel", {px(120), 0}))
a.cancel = true;
}
ImGui::TextDisabled("Files are read when you connect; nothing is saved.");
ImGui::End();
}
void banner(const PanelView& v, PanelActions& a) {
const auto& io = ImGui::GetIO();
ImGui::SetNextWindowPos({io.DisplaySize.x * 0.5F, px(4)}, ImGuiCond_Always, {0.5F, 0});
ImGui::Begin("##mode", nullptr,
ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_AlwaysAutoResize |
ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoSavedSettings);
if (v.mode == Mode::fixture) {
ImGui::TextColored(amber, "LOCAL FIXTURE - in-memory stand-in, not authoritative");
ImGui::SameLine();
if (ImGui::SmallButton("Launcher"))
a.back = true;
ImGui::SameLine();
if (ImGui::SmallButton("Controls"))
a.open_controls = true;
} else {
ImGui::TextColored(v.remote && v.remote->phase == "connected" ? green : amber,
"DEV REGION - %s%s", v.remote ? v.remote->phase.c_str() : "?",
v.remote && v.remote->stale_view ? " - STALE (last view, frozen)" : "");
ImGui::SameLine();
if (ImGui::SmallButton("Disconnect"))
a.ask_disconnect = true;
ImGui::SameLine();
if (ImGui::SmallButton("Controls"))
a.open_controls = true;
}
ImGui::End();
}
void legend(const PanelView& v, render::EnvironmentDisplay& display) {
static float seen = 0;
const auto when = placed(seen);
ImGui::SetNextWindowPos({px(8), px(40)}, when);
ImGui::SetNextWindowSize({px(300), 0}, when);
ImGui::Begin("Legend");
int current = display.mode == render::EnvironmentDisplay::Mode::moisture
? static_cast<int>(world::field_count)
: static_cast<int>(display.field);
if (ImGui::Combo("Layer", &current, layer_names.data(), static_cast<int>(layer_names.size()))) {
display = current == static_cast<int>(world::field_count)
? render::EnvironmentDisplay{render::EnvironmentDisplay::Mode::moisture}
: render::EnvironmentDisplay{render::EnvironmentDisplay::Mode::field,
static_cast<world::Field>(current)};
}
if (display.mode == render::EnvironmentDisplay::Mode::moisture)
ImGui::TextWrapped("Water saturation, linear from 0 %% (low) to 100 %% (high).");
else
ImGui::TextWrapped("%s", client::density_scale(display.field).c_str());
swatch("##low", render::ramp(0), "Present: low");
ImGui::SameLine();
swatch("##mid", render::ramp(0.5), "mid");
ImGui::SameLine();
swatch("##high", render::ramp(1), "high");
swatch("##zero", render::palette::present_zero, "Present zero (black)");
swatch("##missing", render::palette::missing_a, "Missing: checkerboard");
swatch("##notreq", render::palette::not_requested, "Not requested: hollow outline");
swatch("##undef", render::palette::undefined, "Undefined moisture (no capacity)");
swatch("##stale", render::palette::stale_outline, "Stale: dimmed, amber outlines");
ImGui::Separator();
const auto env = v.environment ? v.environment->freshness() : client::Freshness::none;
const auto org = v.organisms ? v.organisms->freshness() : client::Freshness::none;
ImGui::TextColored(freshness_color(env), "Environment: %s",
std::string{client::freshness_name(env)}.c_str());
ImGui::TextColored(freshness_color(org), "Organisms: %s",
std::string{client::freshness_name(org)}.c_str());
if (v.mode == Mode::remote && v.organisms && v.organisms->current() &&
v.organisms->current()->cells().empty())
ImGui::TextWrapped("No individual organisms: this region reports pooled inventories only.");
if (v.mode == Mode::fixture)
ImGui::TextWrapped("Fixture organisms are static presentation data built from genomes.");
if (v.visible_organisms >= 0)
ImGui::Text("Organisms drawn: %d", v.visible_organisms);
if (v.bindings != nullptr)
disabled_wrapped(controls_hint(*v.bindings).c_str());
ImGui::End();
}
void inspector(const PanelView& v) {
const auto& io = ImGui::GetIO();
static float seen = 0;
const auto when = placed(seen);
ImGui::SetNextWindowPos({io.DisplaySize.x - px(8), px(40)}, when, {1, 0});
ImGui::SetNextWindowSize({px(420), 0}, when);
ImGui::Begin("Inspector");
const auto* env = v.environment ? v.environment->current() : nullptr;
const auto* orgs = v.organisms ? v.organisms->current() : nullptr;
const auto* organism = v.selection->organism(orgs);
const auto* cell = v.selection->cell(env);
if (organism == nullptr && cell == nullptr) {
ImGui::TextWrapped("Click an organism or habitat cell to inspect it.");
ImGui::End();
return;
}
const auto freshness = organism ? v.organisms->freshness() : v.environment->freshness();
if (freshness == client::Freshness::stale)
ImGui::TextColored(amber, "STALE: values are from an older revision.");
if (ImGui::BeginTable("rows", 3, ImGuiTableFlags_RowBg | ImGuiTableFlags_SizingFixedFit)) {
for (const auto& r : organism ? client::organism_rows(*organism) : client::cell_rows(*cell))
row(r.label.c_str(), r.value, r.unit);
ImGui::EndTable();
}
if (cell != nullptr && ImGui::BeginTable("fields", 2, ImGuiTableFlags_RowBg)) {
// Values wrap inside the column so missing/not-requested explanations stay readable.
ImGui::TableSetupColumn("field", ImGuiTableColumnFlags_WidthFixed, px(150));
ImGui::TableSetupColumn("value", ImGuiTableColumnFlags_WidthStretch);
for (std::size_t k = 0; k < world::field_count; ++k) {
const auto field = static_cast<world::Field>(k);
const auto value = client::describe_field(*cell, field);
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::TextUnformatted(std::string{client::field_name(field)}.c_str());
ImGui::TableNextColumn();
const bool tinted = value.kind == client::ValueKind::missing ||
value.kind == client::ValueKind::not_requested;
if (tinted)
ImGui::PushStyleColor(ImGuiCol_Text,
value.kind == client::ValueKind::missing
? red
: ImGui::GetStyleColorVec4(ImGuiCol_TextDisabled));
ImGui::TextWrapped("%s", value.text.c_str());
if (tinted)
ImGui::PopStyleColor();
}
const auto moisture = client::describe_moisture(*cell);
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::TextUnformatted("Moisture");
ImGui::TableNextColumn();
ImGui::TextWrapped("%s", moisture.text.c_str());
ImGui::EndTable();
}
ImGui::End();
}
// Rebinding: each slot button arms key capture for that slot; the panel holds UI
// capture, so no key or click reaches the world while it is open (ADR-0085).
void controls(const PanelView& v, PanelActions& a) {
if (v.controls == nullptr)
return;
const auto& io = ImGui::GetIO();
ImGui::SetNextWindowPos({io.DisplaySize.x * 0.5F, io.DisplaySize.y * 0.5F}, ImGuiCond_Always,
{0.5F, 0.5F});
ImGui::SetNextWindowSize({std::min(px(460), io.DisplaySize.x - px(16)), 0}, ImGuiCond_Always);
ImGui::Begin("Controls", nullptr,
ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse |
ImGuiWindowFlags_NoSavedSettings);
disabled_wrapped("Keys are named by their US-layout position. Mouse click (select) and "
"wheel (zoom) are fixed. Escape cancels a key capture.");
if (ImGui::BeginTable("bindings", 3, ImGuiTableFlags_RowBg)) {
ImGui::TableSetupColumn("Action", ImGuiTableColumnFlags_WidthStretch);
ImGui::TableSetupColumn("Primary", ImGuiTableColumnFlags_WidthFixed, px(120));
ImGui::TableSetupColumn("Secondary", ImGuiTableColumnFlags_WidthFixed, px(150));
ImGui::TableHeadersRow();
for (std::size_t k = 0; k < client::action_count; ++k) {
const auto action = static_cast<client::Action>(k);
const auto& slot = v.controls->draft()[k];
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::TextUnformatted(std::string{client::action_name(action)}.c_str());
for (const bool secondary : {false, true}) {
ImGui::TableNextColumn();
const ControlSlot here{action, secondary};
const auto key = secondary ? slot.secondary : slot.primary;
const std::string label =
(v.capturing == here ? std::string{"Press a key"} : key_label(key)) + "##" +
std::to_string(k) + (secondary ? "s" : "p");
ImGui::BeginDisabled(v.capturing.has_value());
if (ImGui::Button(label.c_str(), {px(100), 0}))
a.capture_key = here;
if (secondary && key != client::no_key) {
ImGui::SameLine();
if (ImGui::SmallButton(("x##clear" + std::to_string(k)).c_str()))
a.clear_secondary = action;
}
ImGui::EndDisabled();
}
}
ImGui::EndTable();
}
if (v.capturing) {
ImGui::TextColored(amber, "Press a key for %s (Escape cancels).",
std::string{client::action_name(v.capturing->action)}.c_str());
if (ImGui::Button("Cancel capture", {px(140), 0}))
a.cancel_capture = true;
}
if (v.controls_problem) {
ImGui::PushStyleColor(ImGuiCol_Text, red);
ImGui::TextWrapped("%s", client::describe(*v.controls_problem).c_str());
ImGui::PopStyleColor();
}
ImGui::BeginDisabled(v.capturing.has_value());
if (ImGui::Button("Apply", {px(100), 0}))
a.apply_controls = true;
ImGui::SameLine();
if (ImGui::Button("Reset defaults", {px(130), 0}))
a.reset_controls = true;
ImGui::SameLine();
if (ImGui::Button("Cancel", {px(100), 0}))
a.close_controls = true;
ImGui::EndDisabled();
ImGui::End();
}
void session(const PanelView& v) {
if (!v.remote)
return;
const auto& io = ImGui::GetIO();
static float seen = 0;
const auto when = placed(seen);
ImGui::SetNextWindowPos({px(8), io.DisplaySize.y - px(8)}, when, {0, 1});
ImGui::SetNextWindowSize({px(360), 0}, when);
ImGui::Begin("Session");
const auto& s = *v.remote;
if (ImGui::BeginTable("status", 3, ImGuiTableFlags_SizingFixedFit)) {
row("Connection", s.phase);
row("Session / epoch", std::to_string(s.session) + " / " + std::to_string(s.epoch));
row("Region", std::to_string(s.region) + " (" + std::to_string(s.handoffs) + " crossings)");
row("Server tick", std::to_string(s.server_tick));
row("Simulated through", std::to_string(s.simulated_tick));
row("Grants left", std::to_string(s.grants_left));
row("Snapshot", s.snapshot_tick == 0 ? std::string{"none yet"}
: "tick " + std::to_string(s.snapshot_tick) + ", " +
std::to_string(s.cells) + " cells, " +
std::to_string(s.organisms) + " organisms");
if (s.focused)
row("Interest", std::to_string(s.focus_x) + ", " + std::to_string(s.focus_y) + ", z " +
std::to_string(s.focus_z) + " (radius 7)");
row("Snapshot bytes", std::to_string(s.snapshot_bytes));
if (s.marker) { // Probe marker (ADR-0094, EXPERIMENT): predicted and smoothed.
char position[64];
std::snprintf(position, sizeof position, "%.2f, %.2f m", s.marker_x_mm / 1000,
s.marker_y_mm / 1000);
row("Probe marker", position);
row("Prediction", std::to_string(s.inputs_pending) + " pending, lead " +
std::to_string(s.lead) + " ticks");
row("Corrections", std::to_string(s.corrections) + ", max error " +
std::to_string(s.max_error_um / 1000) + " mm, " +
std::to_string(s.snaps) + " snaps");
char delay[48];
std::snprintf(delay, sizeof delay, "%zu, %.1f ticks behind, %zu stale", s.other_markers,
s.interpolation_delay, s.stale_markers);
row("Other markers", delay);
}
ImGui::EndTable();
}
disabled_wrapped("Intentions (newest first; this is the record, toasts expire):");
if (v.outcomes &&
ImGui::BeginTable("outcomes", 3, ImGuiTableFlags_RowBg | ImGuiTableFlags_SizingFixedFit)) {
const auto& entries = v.outcomes->entries();
int shown = 0;
for (auto it = entries.rbegin(); it != entries.rend() && shown < 10; ++it, ++shown) {
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::Text("#%llu", static_cast<unsigned long long>(it->sequence));
ImGui::TableNextColumn();
ImGui::TextUnformatted(outcome_name(it->state));
ImGui::TableNextColumn();
if (it->state == client::OutcomeState::durable)
ImGui::Text("tick %llu, commit %llu", static_cast<unsigned long long>(it->tick),
static_cast<unsigned long long>(it->commit_sequence));
else if (it->state == client::OutcomeState::rejected)
ImGui::Text("status %u", static_cast<unsigned>(it->detail));
else if (it->tick != 0)
ImGui::Text("tick %llu", static_cast<unsigned long long>(it->tick));
}
ImGui::EndTable();
}
ImGui::End();
}
// Newest at the bottom right. Each notice wraps its text beside a reserved close
// column, so the button is always visible; the stack stops at 60 % of the viewport
// height and counts what it could not show (those still expire or can be dismissed
// once space frees). Notices are not the outcome record (Session panel is).
void notices(const PanelView& v, PanelActions& a) {
const auto& io = ImGui::GetIO();
const float width = std::min(px(notice_width), io.DisplaySize.x - px(16));
const float top = io.DisplaySize.y * 0.4F;
float y = io.DisplaySize.y - px(8);
const auto list = v.ui->notices();
std::size_t hidden = 0;
for (auto it = list.rbegin(); it != list.rend(); ++it) {
const auto& n = *it;
if (y < top || width < 120) {
++hidden;
continue;
}
ImGui::SetNextWindowPos({io.DisplaySize.x - px(8), y}, ImGuiCond_Always, {1, 1});
ImGui::SetNextWindowSize({width, 0}, ImGuiCond_Always);
const std::string id = notice_window_prefix + std::to_string(n.id);
ImGui::Begin(id.c_str(), nullptr,
ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoMove |
ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing);
if (ImGui::BeginTable("notice", 2)) {
ImGui::TableSetupColumn("text", ImGuiTableColumnFlags_WidthStretch);
ImGui::TableSetupColumn("close", ImGuiTableColumnFlags_WidthFixed,
px(notice_close_width));
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::PushStyleColor(ImGuiCol_Text, n.level == client::NoticeLevel::error ? red
: n.level == client::NoticeLevel::warning ? amber
: green);
ImGui::TextWrapped("%s", n.text.c_str());
ImGui::PopStyleColor();
ImGui::TableNextColumn();
if (ImGui::Button(("x" + id).c_str(), {px(notice_close_width), 0}))
a.dismiss_notice = n.id;
ImGui::EndTable();
}
y -= ImGui::GetWindowHeight() + px(4);
ImGui::End();
}
if (v.ui->evicted_notices() > 0 || hidden > 0) {
ImGui::SetNextWindowPos({io.DisplaySize.x - px(8), y}, ImGuiCond_Always, {1, 1});
ImGui::Begin("##evicted", nullptr,
ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_AlwaysAutoResize |
ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing);
if (hidden > 0)
ImGui::TextDisabled("%zu more notices (dismiss to show)", hidden);
if (v.ui->evicted_notices() > 0)
ImGui::TextDisabled("%llu older notices discarded",
static_cast<unsigned long long>(v.ui->evicted_notices()));
ImGui::End();
}
}
void dialog(const PanelView& v, PanelActions& a) {
const auto& d = v.ui->dialog();
if (!d)
return;
const std::string id = d->title + "##dialog" + std::to_string(d->id);
ImGui::OpenPopup(id.c_str());
if (ImGui::BeginPopupModal(id.c_str(), nullptr, ImGuiWindowFlags_AlwaysAutoResize)) {
ImGui::TextWrapped("%s", d->body.c_str());
if (ImGui::Button("Confirm", {px(120), 0}))
a.confirm_dialog = d->id;
ImGui::SameLine();
if (ImGui::Button("Cancel", {px(120), 0}))
a.cancel_dialog = d->id;
ImGui::EndPopup();
}
}
} // namespace
void FormBuffers::load(const client::ConnectForm& f) {
copy(endpoint, f.endpoint);
copy(server_name, f.server_name);
copy(authority, f.authority_path);
copy(grants, f.grants_path);
}
client::ConnectForm FormBuffers::form() const {
return {text(endpoint), text(server_name), text(authority), text(grants)};
}
PanelActions draw_panels(const PanelView& view, FormBuffers& form,
render::EnvironmentDisplay& display) {
PanelActions actions;
if (view.mode == Mode::launcher) {
launcher(view, form, actions);
} else {
banner(view, actions);
legend(view, display);
inspector(view);
session(view);
}
controls(view, actions);
notices(view, actions);
dialog(view, actions);
return actions;
}
} // namespace evo::client_app