mirror of
https://github.com/ALLFATHER-BV/wadamesh.git
synced 2026-09-01 20:08:44 +00:00
ui: remove the chat-store chip from the home screen
It reads "Save FAIL" permanently on the Tanmatsu, so on that board the one indicator meant to make a sick store impossible to miss was instead crying wolf at every user on every boot. An indicator that is wrong on a whole board is worse than no indicator: it trains people to ignore it, and it is the first thing they ask about. Removed rather than board-gated. Everything it showed, and more, already lives on Settings > About > Chat store: the backend in use, the segment count and byte total, when history last saved, and the exact stage plus errno of a failing save. The chip was a shortcut to a question most people never need to ask. Also removes the now-unreachable homeStoreChipText() and the per-tick refresh that ran on every home-screen frame. Docs updated in the same commit: the user guide had a whole section explaining how to read the chip, which would otherwise describe something nobody can see. Replaced with a pointer to the About panel that holds the real answer. All 8 S3 boards build. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
77aef76c90
commit
b3d2cea55b
+2
-10
@@ -171,16 +171,8 @@
|
||||
<li><b>Settings</b>, <b>Terminal</b> (MeshCore CLI), <b>Files</b> (microSD).</li>
|
||||
</ul>
|
||||
<p>The bar along the bottom is always there — it switches the five main tabs (Chat, Contacts, Home, Map, Settings) from anywhere. The top bar shows unread count, time, signal and battery.</p>
|
||||
<h3>The save chip <span class="tag">Cmdr</span></h3>
|
||||
<p>On the command centre, the TX/RX traffic chart has a legend row underneath it: packet totals on the left, and on the right a small chip reading <b>Saved</b> and a time. That chip is not about the radio — it is about your <b>chat history</b>, and it answers one question: are your messages actually reaching storage?</p>
|
||||
<ul>
|
||||
<li><code>Saved 14:32</code> — the moment history last saved successfully, in 12- or 24-hour form to match your clock setting. It is a timestamp, not a running clock, so it only moves when a save happens.</li>
|
||||
<li><code>Saved 14:32-2D</code> — that last successful save was <b>two days ago</b>. Saving has quietly stopped; the suffix exists so a stale store cannot pass for a fresh one at a glance.</li>
|
||||
<li><code>Saved --:--</code> — nothing has saved yet, or the save happened before the clock was set, so there is no meaningful time to show.</li>
|
||||
<li><code>Save FAIL x3</code>, in red — writes are failing right now, with a count. Recent messages are at risk of being lost on reboot.</li>
|
||||
<li><code>Save migrating</code>, in amber — an older history file is still being converted to the current segmented format. This is normal after an update and clears itself.</li>
|
||||
</ul>
|
||||
<p>A time that keeps pace with your conversations means history is safe. Red, amber, or a time that has stopped moving is worth a look at <b>Settings → About → Chat store</b>, which names the storage backend in use and the exact stage and error a failing save is hitting.</p>
|
||||
<h3>Is my history actually saving? <span class="tag">Cmdr</span></h3>
|
||||
<p><b>Settings → About → Chat store</b> is the answer: it names the storage backend in use, when history last saved successfully, and the exact stage and error a failing save is hitting. Worth a look if messages seem to vanish across a reboot.</p>
|
||||
</div>
|
||||
<div class="shot"><div class="device"><img class="screen" src="docs-img/home.png" alt="Home app launcher"></div><div class="cap">Home — app launcher</div></div>
|
||||
</div>
|
||||
|
||||
@@ -17838,7 +17838,6 @@ static lv_obj_t* s_home_adv_btn = nullptr;
|
||||
#endif
|
||||
// Compact legend label above the chart showing live TX/RX totals.
|
||||
static lv_obj_t* s_home_chart_legend = nullptr;
|
||||
static lv_obj_t* s_home_store = nullptr; // chat-store chip, right half of the legend row
|
||||
static lv_obj_t* s_home_chart_sig = nullptr; // live signal chip drawn inside the graph box
|
||||
#if CAP_LARGE_SCREEN
|
||||
static lv_obj_t* s_home_info = nullptr; // Commander info-panel values column (big screen) — refreshed live
|
||||
@@ -23477,32 +23476,6 @@ static void homeControlPanelCb(lv_event_t* e) { // "Control panel" launcher ->
|
||||
if (lv_event_get_code(e) == LV_EVENT_CLICKED) toggleControlCenter();
|
||||
}
|
||||
|
||||
// Chat-store chip for the Commander legend row (right of the TX/RX totals).
|
||||
// Deliberately terse — it shares one line with the traffic counts and must fit
|
||||
// half the chart width at g_font_12. The full story (backend, failure stage +
|
||||
// errno) stays on the About page's "Chat store" panel; this chip only has to
|
||||
// make a sick store impossible to miss from the home screen. Returns the text
|
||||
// colour to use.
|
||||
static uint32_t homeStoreChipText(char* out, size_t cap) {
|
||||
if (s_msgs_write_fails) { // saves are failing right now
|
||||
snprintf(out, cap, TR("Save FAIL x%u"), (unsigned)s_msgs_write_fails);
|
||||
return 0xE05252; // red — history is NOT landing
|
||||
}
|
||||
if (!s_seg_store_ready) { // old-format file not converted yet
|
||||
snprintf(out, cap, "%s", TR("Save migrating"));
|
||||
return 0xF5A623; // amber
|
||||
}
|
||||
// Healthy: WHEN the store last saved. A clock time answers "is my history
|
||||
// safe right now?" directly, where a size doesn't — and the segment count /
|
||||
// byte total (plus the failure stage + errno) stay one tap away on the About
|
||||
// page. Older than a day carries a "-<N>D" suffix so a store that quietly
|
||||
// stopped saving yesterday can't read as fresh.
|
||||
char when[16];
|
||||
chatSaveStamp(when, sizeof when, s_msgs_write_ok_epoch);
|
||||
snprintf(out, cap, TR("Saved %s"), when);
|
||||
return COLOR_SUB;
|
||||
}
|
||||
|
||||
static void makeHome(lv_obj_t* tab) {
|
||||
// Layout (240 wide × 282 tall): title + heartbeat + battery at top, status
|
||||
// lines, TX/RX chart in the middle, Send Advert button at the bottom.
|
||||
@@ -23558,7 +23531,6 @@ static void makeHome(lv_obj_t* tab) {
|
||||
s_home_batt_pct = nullptr;
|
||||
s_home_batt_icon = nullptr;
|
||||
s_home_chart_sig = nullptr;
|
||||
s_home_store = nullptr; // created with the legend row below
|
||||
g_lv.home_apps = nullptr; // set below iff the right-hand launcher column is built (landscape)
|
||||
#if defined(HAS_EXPANSION_KIT)
|
||||
s_home_env_chart = nullptr;
|
||||
@@ -23693,23 +23665,6 @@ static void makeHome(lv_obj_t* tab) {
|
||||
#else
|
||||
const int chart_w = cw;
|
||||
#endif
|
||||
// Chat-store chip: shares the legend row with the TX/RX totals, parked on the
|
||||
// RIGHT HALF of the chart width (fixed width + right-aligned + CLIP, so it can
|
||||
// never grow into the traffic counts on the left, at any UI scale). Not
|
||||
// clickable — the legend owns this row's taps (signal/traffic popup).
|
||||
s_home_store = lv_label_create(tab);
|
||||
lv_label_set_long_mode(s_home_store, LV_LABEL_LONG_CLIP);
|
||||
lv_obj_set_width(s_home_store, chart_w / 2);
|
||||
lv_obj_set_style_text_align(s_home_store, LV_TEXT_ALIGN_RIGHT, LV_PART_MAIN);
|
||||
lv_obj_set_style_text_font(s_home_store, &g_font_12, LV_PART_MAIN);
|
||||
{
|
||||
char chip[24];
|
||||
const uint32_t col = homeStoreChipText(chip, sizeof chip);
|
||||
lv_label_set_text(s_home_store, chip);
|
||||
lv_obj_set_style_text_color(s_home_store, lv_color_hex(col), LV_PART_MAIN);
|
||||
}
|
||||
lv_obj_align(s_home_store, LV_ALIGN_TOP_LEFT, chart_w - chart_w / 2, chart_y);
|
||||
|
||||
// Fit the chart in the remaining vertical space: content height minus the
|
||||
// tab padding, the chart's top offset, and the Send-advert button + gaps.
|
||||
// Portrait keeps the full 96 px; landscape (short screen) shrinks it so the
|
||||
@@ -42170,10 +42125,6 @@ static void relayoutHomeCharts() {
|
||||
|
||||
const int legend_y = env_chart_y + SC(34) + SC(12);
|
||||
lv_obj_set_pos(s_home_chart_legend, 0, legend_y);
|
||||
if (s_home_store) { // chat-store chip rides the same row
|
||||
lv_obj_set_width(s_home_store, chart_w / 2);
|
||||
lv_obj_set_pos(s_home_store, chart_w - chart_w / 2, legend_y);
|
||||
}
|
||||
|
||||
const int home_avail = tabContentH() - 20;
|
||||
int chart_h = home_avail - (legend_y + 16) - 4 - (home_land ? 0 : (8 + 36));
|
||||
@@ -42230,19 +42181,6 @@ static void refreshStatusLabels() {
|
||||
if (g_lv.tabview) active_tab = lv_tabview_get_tab_act(g_lv.tabview);
|
||||
const bool home_active = (active_tab == HOME_TAB_INDEX);
|
||||
if (home_active) refreshHomeBattery();
|
||||
// Chat-store chip (legend row). Updated independently of the TX/RX chart —
|
||||
// the big-screen scaled layout drops the chart entirely, and the store state
|
||||
// still has to be visible there.
|
||||
if (home_active && s_home_store) {
|
||||
char chip[24];
|
||||
const uint32_t col = homeStoreChipText(chip, sizeof chip);
|
||||
setLabelIfChanged(s_home_store, chip);
|
||||
static uint32_t s_home_store_col = 0; // avoid re-styling (and invalidating) every tick
|
||||
if (col != s_home_store_col) {
|
||||
s_home_store_col = col;
|
||||
lv_obj_set_style_text_color(s_home_store, lv_color_hex(col), LV_PART_MAIN);
|
||||
}
|
||||
}
|
||||
// Push a TX/RX sample onto the home chart: delta packets since last tick.
|
||||
if (home_active && s_home_chart && s_home_chart_tx && s_home_chart_rx) {
|
||||
static uint32_t last_tx = 0;
|
||||
|
||||
Reference in New Issue
Block a user