Skip to content

Alert menu redesign, LOG_WIDTH everywhere, button code consolidated - #47

Merged
robdevops merged 19 commits into
mainfrom
claude/envirobot-next
Oct 18, 2026
Merged

robdevops merged 19 commits into
mainfrom
claude/envirobot-next

Conversation

@robdevops

Copy link
Copy Markdown
Owner

Alerts

  • /alerts has two buttons, 🔔 Alerts and (private chats) 🔊 Sound. Each opens a list of alert types as toggles, with its own button kept above the list (press it to close) and the other hidden. Sound lists only the types that are on.
  • Under each alert, one 🔔 button opens up to two toggles: Alert, and (while it is on, private chats) Sound.
  • Every toggle (these, and the irrigation Alerts options) is a green button while on and has its name struck through, uncoloured, while off.
  • Sub / Unsub / Settings, the Back button, the "Other" lists and the "all" buttons are gone.

Logs

  • LOG_WIDTH applies to every log line, whatever its level (a WARN or ERROR is cut too).
  • The startup Keeping warm: and Alerts: lists are one line each, no wrapping.

Cleanup

  • Shared button helpers in lib/buttons.py (button, opener, toggle_button); alert callback data is built and read in one place (Press, parse in lib/alerts/menu.py); keyboard() is only /alerts, alert_keyboard() only the bell. Every keyboard (407 states) renders as before.
  • Legacy handling is dropped: buttons on alert and /alerts messages sent before these menus stop working (the stale-button toast).

Checks

python -m pytest -q and python scripts/eval_prompts.py (87 of 87). Two Ecowitt tests fail around local midnight (they fail on main too at that hour).


Generated by Claude Code

claude added 18 commits October 18, 2026 09:23
…ngs are just their emojis

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WBwHofjb1g9onaYRdLZMbf
Settings stays the gear alone.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WBwHofjb1g9onaYRdLZMbf
…e and all

The crossed-out bell under an alert lists just that type and "Unsubscribe from all" (no Other menu). The gear stays. The /alerts message keeps both menus.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WBwHofjb1g9onaYRdLZMbf
A WARN or an ERROR is cut too, and so are the startup "Keeping warm:" and "Alerts:" lists (the WHOLE marker is gone).

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WBwHofjb1g9onaYRdLZMbf
…ll menus

Under an alert (private chats) a 🔊 / 🔇 button turns that type's notification sound on or off. The gear and its sound menus are only in /alerts.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WBwHofjb1g9onaYRdLZMbf
…nd toggle

Under an alert, a single ⚙️ opens 🔔 Alert and, while the alert is on and in a private chat, 🔊 Sound. Each is struck through while off, and the menu stays open after a toggle. /alerts keeps its full menus; the Other lists are gone.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WBwHofjb1g9onaYRdLZMbf
…rough toggles with Back

Each opens the full list of alert types (alerts on or off in the chat; notification sound on or off, private chats only) with a Back button, and the other is hidden meanwhile. The strikethrough toggles, here and in the individual alert's gear menu, no longer carry emojis. Sub, Unsub and Settings are gone.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WBwHofjb1g9onaYRdLZMbf
With every alert off there is no Sound button.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WBwHofjb1g9onaYRdLZMbf
…tton stays

Each list shows its own button (open) above it, with the other hidden; a green tick marks what is on, a red cross what is off. An alert that is off is not in the Sound list at all. The individual alert's gear menu keeps its strikethrough toggles.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WBwHofjb1g9onaYRdLZMbf
… red one

The tick and the cross stay for a client that doesn't draw button colours.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WBwHofjb1g9onaYRdLZMbf
The individual alert's Alert and Sound toggles and the irrigation Alerts menu's battery and pause toggles now show their state as /alerts does (a shared toggle_button): ✅ on a green button while on, ❌ on a red one while off.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WBwHofjb1g9onaYRdLZMbf
…d red when off

No green anywhere: a toggle that is on is an ordinary button, one that is off is red with its name struck through. This covers /alerts, the individual alert's menu and the irrigation Alerts options.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WBwHofjb1g9onaYRdLZMbf
…, no legacy

lib/buttons.py is the one home for button(), opener() (the ▸/▾ menu button) and toggle_button() (its data is a function of what a press sets), used by the alert, irrigation, period and report menus. In lib/alerts/menu.py the callback data is built and read in one place (Press, parse), keyboard() is only /alerts and alert_keyboard() only the bell under an alert (internal name "bell", was "gear"), and Bot.on_alert_button reads a Press instead of splitting the data. Dropped: the legacy sections of earlier menus, al:noop, the al:on|off:all branch and the Notifier's unused kinds. Every keyboard in a 407-state matrix is identical to before (apart from gear -> bell in the data).

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WBwHofjb1g9onaYRdLZMbf

Copy link
Copy Markdown
Owner Author

test is red on this PR for two Ecowitt tests that this PR doesn't touch: test_a_question_the_cache_and_memory_can_answer_does_not_wait_for_a_refresh_that_is_fetching and test_the_wind_rose_reads_its_5_minute_readings_in_runs_of_days_not_a_day_at_a_time. They fail the same way locally on the previous commit, and only between about 13:00 and 24:00 UTC, when the Melbourne date is already a day ahead of the UTC date (the runs at 02:46 and 06:18 UTC today passed). The suspect is the test fixtures mixing UTC and local dates; no fix exists yet. Not merging while it is red: it should pass again after 00:00 UTC, when I will re-run the check.


Generated by Claude Code

Yesterday's last readings are settled only some hours after local midnight (store.horizon), so the wind rose reads two ranges, not one, between 00:00 and then; and a window of the last 3 hours reaches back into yesterday, which memory does not hold. The tests now allow two ranges and ask for the readings since local midnight when it is earlier than 3 hours ago. The bot's code was right.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WBwHofjb1g9onaYRdLZMbf
@robdevops
robdevops merged commit 72cda0b into main Oct 18, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants