mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-07-26 14:58:12 +00:00
fix(ui): bot screen tab order starts on Channel
Reordered BotScreen's carousel to Channel / Room / Direct / Other and made Channel the default opening tab, per feedback that the screen should start from the first tab shown. Docs updated to match. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -368,29 +368,19 @@ Melodies can be assigned in **Settings › Sound** (global default) or overridde
|
||||
|
||||
Automatically replies to incoming messages that contain a configured trigger word (case-insensitive, contains match). The bot has three independent targets — **DM**, a monitored **Channel**, and a monitored **Room** — each with its own trigger/reply pair.
|
||||
|
||||
The screen is a **circular tab carousel**, the same style as Tools › Nearby Nodes' filter tabs: **LEFT/RIGHT** switches between the **Direct** / **Channel** / **Room** / **Other** tabs, **UP/DOWN** moves between the rows within the active tab, and **Enter** acts on the selected row (LEFT/RIGHT is reserved entirely for tab-switching, so every row's value is changed via Enter, not by cycling it in place).
|
||||
The screen is a **circular tab carousel**, the same style as Tools › Nearby Nodes' filter tabs: **LEFT/RIGHT** switches between the **Channel** / **Room** / **Direct** / **Other** tabs (opens on Channel), **UP/DOWN** moves between the rows within the active tab, and **Enter** acts on the selected row (LEFT/RIGHT is reserved entirely for tab-switching, so every row's value is changed via Enter, not by cycling it in place).
|
||||
|
||||
Each target has its own **Enable** toggle on its own tab, and they're fully independent — you can run only a channel bot, only a room bot, only DM, or any combination, with no need to also switch on the others.
|
||||
|
||||
Each target also has its own **Commands** toggle (see below) — DM, channel and room can each independently answer `!` queries or stay quiet, same as Enable.
|
||||
|
||||
#### Direct tab
|
||||
|
||||
| Setting | Description |
|
||||
| ---------- | -------------------------------------------------------------------------------- |
|
||||
| Enable | ON / OFF — **Enter** toggles. Enables DM listening. |
|
||||
| DM allow | **All** / **Fav** — **Enter** toggles. Who the DM bot (trigger-reply and commands) responds to. All (default): any DM sender. Fav: only contacts you've starred (the same star Settings › Contacts filters on) — use this to keep a public bot from being spammed by strangers while it still answers people you trust. |
|
||||
| Commands | ON / OFF — **Enter** toggles. Answer `!` query commands (see below) in DMs. |
|
||||
| Trigger | Word or phrase that activates the DM reply (case-insensitive). A lone `*` means **reply to every DM** (away mode) and is shown as `(any msg)`. **Enter** opens the keyboard. |
|
||||
| Reply | Reply text for DMs; supports `{time}`, `{loc}`, `{name}`, `{hops}` and sensor placeholders. **Enter** opens the keyboard. |
|
||||
|
||||
#### Channel tab
|
||||
|
||||
| Setting | Description |
|
||||
| ------- | --------------------------------------------------------------------------------- |
|
||||
| Enable | ON / OFF — **Enter** toggles. Independent of which channel is picked below, so switching it off and back on remembers the last channel. |
|
||||
| Channel | Which channel the bot monitors — always shows the last-picked channel (or `(none)` if none exist yet), regardless of Enable. **Enter** opens the full channel picker (the same one Live Share's **To** row uses). |
|
||||
| Commands | ON / OFF — **Enter** toggles. Answer `!` query commands on the monitored channel, independent of the DM tab's Commands setting. |
|
||||
| Commands | ON / OFF — **Enter** toggles. Answer `!` query commands on the monitored channel, independent of the other two tabs' Commands settings. |
|
||||
| Trigger | Independent trigger for the monitored channel. `*` means **reply to every channel message** — bounded by the per-channel cooldown, but use sparingly on a busy channel. |
|
||||
| Reply | Reply text for channel messages; supports the same placeholders as Direct's Reply. |
|
||||
|
||||
@@ -404,6 +394,16 @@ Each target also has its own **Commands** toggle (see below) — DM, channel and
|
||||
| Trigger | Independent trigger for the monitored room. `*` means **reply to every post in the room**. |
|
||||
| Reply | Reply text for room posts; supports the same placeholders as Direct's Reply. |
|
||||
|
||||
#### Direct tab
|
||||
|
||||
| Setting | Description |
|
||||
| ---------- | -------------------------------------------------------------------------------- |
|
||||
| Enable | ON / OFF — **Enter** toggles. Enables DM listening. |
|
||||
| DM allow | **All** / **Fav** — **Enter** toggles. Who the DM bot (trigger-reply and commands) responds to. All (default): any DM sender. Fav: only contacts you've starred (the same star Settings › Contacts filters on) — use this to keep a public bot from being spammed by strangers while it still answers people you trust. |
|
||||
| Commands | ON / OFF — **Enter** toggles. Answer `!` query commands (see below) in DMs. |
|
||||
| Trigger | Word or phrase that activates the DM reply (case-insensitive). A lone `*` means **reply to every DM** (away mode) and is shown as `(any msg)`. **Enter** opens the keyboard. |
|
||||
| Reply | Reply text for DMs; supports `{time}`, `{loc}`, `{name}`, `{hops}` and sensor placeholders. **Enter** opens the keyboard. |
|
||||
|
||||
#### Other tab
|
||||
|
||||
| Setting | Description |
|
||||
|
||||
@@ -12,7 +12,7 @@ class BotScreen : public UIScreen {
|
||||
// UP/DOWN moves within the active tab's rows. Because LEFT/RIGHT is fully
|
||||
// owned by tab-switching, every row's value is edited via Enter only — no
|
||||
// more inline LEFT/RIGHT cycling.
|
||||
enum Tab : uint8_t { TAB_DIRECT, TAB_CHANNEL, TAB_ROOM, TAB_OTHER, TAB_COUNT };
|
||||
enum Tab : uint8_t { TAB_CHANNEL, TAB_ROOM, TAB_DIRECT, TAB_OTHER, TAB_COUNT };
|
||||
static const char* TAB_LABELS[TAB_COUNT];
|
||||
|
||||
enum Kind : uint8_t { ENABLE_DM, DM_SCOPE, COMMANDS_DM, TRIGGER_DM, REPLY_DM,
|
||||
@@ -54,9 +54,9 @@ class BotScreen : public UIScreen {
|
||||
{ QUIET_TO, "Quiet to" },
|
||||
};
|
||||
switch (tab) {
|
||||
case TAB_DIRECT: return DIRECT[idx];
|
||||
case TAB_CHANNEL: return CHANNEL_ROWS[idx];
|
||||
case TAB_ROOM: return ROOM_ROWS[idx];
|
||||
case TAB_DIRECT: return DIRECT[idx];
|
||||
default: return OTHER[idx];
|
||||
}
|
||||
}
|
||||
@@ -150,7 +150,7 @@ class BotScreen : public UIScreen {
|
||||
|
||||
public:
|
||||
BotScreen(UITask* task, NodePrefs* prefs, KeyboardWidget* kb)
|
||||
: _task(task), _prefs(prefs), _tab(TAB_DIRECT), _kb(kb) {}
|
||||
: _task(task), _prefs(prefs), _tab(TAB_CHANNEL), _kb(kb) {}
|
||||
|
||||
void onShow() override {
|
||||
// _tab persists across visits (like NearbyScreen's _filter) — only reset
|
||||
@@ -412,5 +412,5 @@ private:
|
||||
}
|
||||
};
|
||||
|
||||
const char* BotScreen::TAB_LABELS[BotScreen::TAB_COUNT] = { "Direct", "Channel", "Room", "Other" };
|
||||
const char* BotScreen::TAB_LABELS[BotScreen::TAB_COUNT] = { "Channel", "Room", "Direct", "Other" };
|
||||
const int BotScreen::ROWS_PER_TAB[BotScreen::TAB_COUNT] = { 5, 5, 5, 2 };
|
||||
|
||||
Reference in New Issue
Block a user