tdpro - remove hint after boot for non-first time flash

This commit is contained in:
pelgraine
2026-03-25 07:25:48 +11:00
parent 19efb52521
commit 60dcd6a89e
3 changed files with 48 additions and 14 deletions

View File

@@ -1739,19 +1739,6 @@ void setup() {
ui_task.gotoOnboarding();
// Show hint immediately overlaid on the onboarding screen
if (!prefs->hint_shown) ui_task.showBootHint(true);
} else if (!prefs->hint_shown) {
// Not a first-time flash (has a name), but hint never dismissed yet
// Deferred — will activate after splash screen transitions to home
ui_task.showBootHint(false);
}
}
#endif
#if defined(LilyGo_T5S3_EPaper_Pro)
{
NodePrefs* prefs = the_mesh.getNodePrefs();
if (!prefs->hint_shown) {
ui_task.showBootHint(false); // Deferred — after splash
}
}
#endif

View File

@@ -242,6 +242,9 @@ private:
// Dirty flag for radio params — prompt to apply
bool _radioChanged;
// T5S3: signal UITask to open VKB when entering text edit mode
bool _needsTextVKB;
// 4G modem state (runtime cache of config)
#ifdef HAS_4G_MODEM
bool _modemEnabled;
@@ -545,7 +548,7 @@ public:
_editMode(EDIT_NONE), _editPos(0), _editPickerIdx(0),
_editFloat(0), _editInt(0), _confirmAction(0),
_onboarding(false), _subScreen(SUB_NONE), _savedTopCursor(0),
_radioChanged(false) {
_radioChanged(false), _needsTextVKB(false) {
memset(_editBuf, 0, sizeof(_editBuf));
#ifdef MECK_OTA_UPDATE
_otaServer = nullptr;
@@ -740,6 +743,19 @@ public:
#endif
// T5S3 VKB integration for text editing (channel name, device name, freq, APN)
bool needsTextVKB() const { return _needsTextVKB; }
void clearTextNeedsVKB() { _needsTextVKB = false; }
const char* getEditBuf() const { return _editBuf; }
SettingsRowType getCurrentRowType() const { return _rows[_cursor].type; }
void submitEditText(const char* text) {
strncpy(_editBuf, text, SETTINGS_TEXT_BUF - 1);
_editBuf[SETTINGS_TEXT_BUF - 1] = '\0';
_editPos = strlen(_editBuf);
// Simulate Enter to confirm the edit through the normal path
handleInput('\r');
}
// ---------------------------------------------------------------------------
// OTA firmware update
// ---------------------------------------------------------------------------
@@ -1068,6 +1084,9 @@ public:
strncpy(_editBuf, initial, SETTINGS_TEXT_BUF - 1);
_editBuf[SETTINGS_TEXT_BUF - 1] = '\0';
_editPos = strlen(_editBuf);
#if defined(LilyGo_T5S3_EPaper_Pro)
_needsTextVKB = true; // Signal UITask to open virtual keyboard
#endif
}
void startEditPicker(int initialIdx) {

View File

@@ -1758,6 +1758,21 @@ if (curr) curr->poll();
}
#endif
// Check if settings screen needs VKB for text editing (channel name, freq, APN)
if (isOnSettingsScreen() && !_vkbActive) {
SettingsScreen* ss = (SettingsScreen*)settings_screen;
if (ss->needsTextVKB()) {
ss->clearTextNeedsVKB();
// Pick a context-appropriate label
const char* label = "Edit";
SettingsRowType rt = ss->getCurrentRowType();
if (rt == ROW_NAME) label = "Node Name";
else if (rt == ROW_ADD_CHANNEL) label = "Channel Name";
else if (rt == ROW_FREQ) label = "Frequency";
showVirtualKeyboard(VKB_SETTINGS_TEXT, label, ss->getEditBuf(), 31);
}
}
if (_hintActive && millis() < _hintExpiry) {
// Boot navigation hint overlay — multi-line, larger box
_display->setTextSize(1);
@@ -2141,6 +2156,19 @@ void UITask::onVKBSubmit() {
if (_screenBeforeVKB) setCurrScreen(_screenBeforeVKB);
break;
}
case VKB_SETTINGS_TEXT: {
// Generic settings text edit — copy text back to settings edit buffer
// and confirm via the normal Enter path (handles name/freq/channel/APN)
SettingsScreen* ss = (SettingsScreen*)settings_screen;
if (strlen(text) > 0) {
ss->submitEditText(text);
} else {
// Empty submission — cancel the edit
ss->handleInput('q');
}
if (_screenBeforeVKB) setCurrScreen(_screenBeforeVKB);
break;
}
case VKB_NOTES: {
NotesScreen* notes = (NotesScreen*)getNotesScreen();
if (notes && strlen(text) > 0) {