feat(settings): reduce-motion glow, stratum restart notice, hint indents, credits gap in schema (F030/F062/F094/F084)
UX audit, Settings surface (batch 1): - F030: the "Migrate to seed wallet" glow holds a static highlight (no pulse) when Reduce motion is on, instead of animating every frame. - F062: changing the stratum host toggle or allowed-IP now shows a "Restart the daemon to apply" banner with a Restart button (mirrors the debug-categories banner); the dirty flag clears on restart. - F094: hint/warning lines use ImGui::Indent() instead of literal " " space padding (stratum hint/warning, auto-shield address) so indents are DPI-consistent. - F084: the About credits bullet gap reads from schema (tabs.settings.credits-bullet-gap in ui.toml) instead of a hardcoded 8.0f. New strings + ui.toml key. Build + tests green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -949,6 +949,9 @@ zoom-max = { size = 3.0 }
|
||||
[tabs.console.input-area]
|
||||
padding = [8, 8]
|
||||
|
||||
[tabs.settings]
|
||||
credits-bullet-gap = 8.0
|
||||
|
||||
[dialogs]
|
||||
|
||||
[dialogs.about]
|
||||
|
||||
@@ -161,6 +161,7 @@ struct SettingsPageState {
|
||||
bool verbose_logging = false;
|
||||
std::set<std::string> debug_categories;
|
||||
bool debug_cats_dirty = false;
|
||||
bool stratum_dirty = false; // stratum host/allow-IP changed; needs a daemon restart to apply (F062)
|
||||
bool debug_expanded = false;
|
||||
// Debug-options gate: a confirmation + warning (and, when a PIN/passphrase is set, re-auth) is
|
||||
// required before the debug dropdown reveals its options — once per session (passing it once
|
||||
@@ -1355,7 +1356,9 @@ void RenderSettingsPage(App* app) {
|
||||
if (app->daemonAutoShieldActive()) {
|
||||
ImGui::TextColored(material::SuccessVec4(), "%s", TR("autoshield_by_node"));
|
||||
if (!app->daemonAutoShieldAddress().empty())
|
||||
ImGui::TextDisabled(" %s", app->daemonAutoShieldAddress().c_str());
|
||||
ImGui::Indent();
|
||||
ImGui::TextDisabled("%s", app->daemonAutoShieldAddress().c_str()); // (F094)
|
||||
ImGui::Unindent();
|
||||
} else {
|
||||
// Friendly, actionable wording. The seed-not-recoverable case is the common one and has a
|
||||
// clear fix (back up the seed); anything else gets a generic line. Raw daemon text on hover.
|
||||
@@ -1534,7 +1537,9 @@ void RenderSettingsPage(App* app) {
|
||||
if (migrateGlow) {
|
||||
const ImVec2 gmn = ImGui::GetItemRectMin(), gmx = ImGui::GetItemRectMax();
|
||||
const float gdp = Layout::dpiScale();
|
||||
const float pulse = 0.5f + 0.5f * std::sin((float)ImGui::GetTime() * 3.2f);
|
||||
// Reduce motion: hold a static glow (still discoverable) instead of pulsing. (F030)
|
||||
const float pulse = s_settingsState.reduce_motion
|
||||
? 0.5f : (0.5f + 0.5f * std::sin((float)ImGui::GetTime() * 3.2f));
|
||||
for (int g = 3; g >= 1; --g) {
|
||||
const float e = (float)g * 2.2f * gdp;
|
||||
const int a = (int)((70.0f + pulse * 95.0f) / (float)g);
|
||||
@@ -2928,7 +2933,8 @@ void RenderSettingsPage(App* app) {
|
||||
const float r = 2.5f * adp;
|
||||
dl->AddCircleFilled(ImVec2(p.x + r, p.y + ImGui::GetTextLineHeight() * 0.5f), r,
|
||||
material::WithAlpha(material::Primary(), 210));
|
||||
ImGui::SetCursorScreenPos(ImVec2(p.x + r * 2.0f + 8.0f * adp, p.y));
|
||||
const float bulletGap = schema::UI().drawElement("tabs.settings", "credits-bullet-gap").sizeOr(8.0f); // (F084)
|
||||
ImGui::SetCursorScreenPos(ImVec2(p.x + r * 2.0f + bulletGap * adp, p.y));
|
||||
ImGui::TextUnformatted(c);
|
||||
if (i < std::size(kCredits) - 1) ImGui::Dummy(ImVec2(0, Layout::spacingSm()));
|
||||
}
|
||||
@@ -3009,18 +3015,47 @@ void RenderSettingsPage(App* app) {
|
||||
Type().textColored(TypeStyle::Overline, OnSurfaceMedium(), TR("stratum_host_section"));
|
||||
ImGui::Dummy(ImVec2(0, Layout::spacingXs()));
|
||||
material::GlassCardScope card(dl, availWidth, pad, bottomPad, glassSpec);
|
||||
if (ImGui::Checkbox(TR("stratum_host"), &s_settingsState.stratum_host))
|
||||
if (ImGui::Checkbox(TR("stratum_host"), &s_settingsState.stratum_host)) {
|
||||
saveSettingsPageState(app->settings());
|
||||
s_settingsState.stratum_dirty = true; // binds at next daemon start (F062)
|
||||
}
|
||||
if (ImGui::IsItemHovered()) material::Tooltip("%s", TR("tt_stratum_host"));
|
||||
if (s_settingsState.stratum_host) {
|
||||
ImGui::TextDisabled(" %s", TR("stratum_host_hint"));
|
||||
ImGui::Indent();
|
||||
ImGui::TextDisabled("%s", TR("stratum_host_hint")); // (F094)
|
||||
ImGui::Unindent();
|
||||
ImGui::SetNextItemWidth(220.0f * Layout::dpiScale());
|
||||
if (ImGui::InputTextWithHint("##stratumallowip", TR("stratum_allowip_hint"),
|
||||
s_settingsState.stratum_allowip, sizeof(s_settingsState.stratum_allowip)))
|
||||
s_settingsState.stratum_allowip, sizeof(s_settingsState.stratum_allowip))) {
|
||||
saveSettingsPageState(app->settings());
|
||||
if (s_settingsState.stratum_allowip[0] != '\0')
|
||||
ImGui::TextColored(material::WarningVec4(), " %s",
|
||||
TR("stratum_expose_warn"));
|
||||
s_settingsState.stratum_dirty = true; // (F062)
|
||||
}
|
||||
if (s_settingsState.stratum_allowip[0] != '\0') {
|
||||
ImGui::Indent();
|
||||
ImGui::TextColored(material::WarningVec4(), "%s", TR("stratum_expose_warn")); // (F094)
|
||||
ImGui::Unindent();
|
||||
}
|
||||
}
|
||||
// Stratum settings only bind at daemon startup — offer a restart, mirroring the debug-cats banner. (F062)
|
||||
if (s_settingsState.stratum_dirty && app->supportsFullNodeLifecycleActions()) {
|
||||
ImGui::Dummy(ImVec2(0, Layout::spacingXs()));
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, material::Warning());
|
||||
ImFont* iconFont = Type().iconSmall();
|
||||
if (iconFont) {
|
||||
ImGui::PushFont(iconFont);
|
||||
ImGui::AlignTextToFramePadding();
|
||||
ImGui::TextUnformatted(ICON_MD_INFO);
|
||||
ImGui::PopFont();
|
||||
ImGui::SameLine(0, Layout::spacingXs());
|
||||
}
|
||||
ImGui::AlignTextToFramePadding();
|
||||
ImGui::TextUnformatted(TR("settings_restart_to_apply"));
|
||||
ImGui::PopStyleColor();
|
||||
ImGui::SameLine();
|
||||
if (TactileButton(TrId("settings_restart_daemon", "stratum_restart").c_str(),
|
||||
ImVec2(0, 0), S.resolveFont("button")))
|
||||
s_settingsState.confirm_restart_daemon = true;
|
||||
if (ImGui::IsItemHovered()) material::Tooltip("%s", TR("tt_restart_daemon"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3564,6 +3599,7 @@ void RenderSettingsPage(App* app) {
|
||||
}
|
||||
if (doConfirm) {
|
||||
s_settingsState.debug_cats_dirty = false;
|
||||
s_settingsState.stratum_dirty = false; // (F062)
|
||||
app->restartDaemon();
|
||||
s_settingsState.confirm_restart_daemon = false;
|
||||
}
|
||||
|
||||
@@ -965,6 +965,7 @@ void I18n::loadBuiltinEnglish()
|
||||
strings_["stratum_host"] = "Host a mining pool (stratum)";
|
||||
strings_["tt_stratum_host"] = "Run a RandomX stratum pool server on this node so other RandomX miners can point at this computer. Requires a v1.3.0+ node and a daemon restart to apply.";
|
||||
strings_["stratum_host_hint"] = "Miners connect to this computer on port 22769 (RPC port + 1000) with a RandomX stratum miner. Restart the daemon to apply.";
|
||||
strings_["settings_restart_to_apply"] = "Restart the daemon to apply";
|
||||
strings_["stratum_allowip_hint"] = "Allow miners from IP or CIDR (blank = this computer only)";
|
||||
strings_["stratum_expose_warn"] = "Opens a mining port to the network you allow — only use on a trusted LAN.";
|
||||
strings_["tt_verbose"] = "Log detailed connection diagnostics,\ndaemon state, and port owner info\nto the Console tab";
|
||||
|
||||
Reference in New Issue
Block a user