fix: auto-favorite role filter, MQTT notification dot, message text readability#3789
fix: auto-favorite role filter, MQTT notification dot, message text readability#3789Yeraze wants to merge 2 commits into
Conversation
… message text readability **#3774 — Auto-favorite now applies relay-role filter to all eligible local roles** Remove the CLIENT_BASE exception in `isAutoFavoriteEligible`: ZERO_HOP_RELAY_ROLES (ROUTER, ROUTER_LATE, CLIENT_BASE) is now enforced regardless of the local node's role, so CLIENT and CLIENT_MUTE nodes are never auto-favorited. Adds CLIENT_MUTE regression test; updates the CLIENT test from true → false. **#3787 Bug 1 — MQTT notification dot respects "Show MQTT/Bridge Messages" pref** The unread-counts query now supports excludeMqtt, threaded through all layers: - `NotificationsRepository.getUnreadCountsByChannelAsync` — adds Drizzle OR filter - `DatabaseService.getUnreadCountsByChannel/Async` — passes through for both SQLite (raw SQL `m.viaMqtt IS NULL OR m.viaMqtt = 0`) and ORM paths - `/api/messages/unread-counts` endpoint — reads `?excludeMqtt=1` query param - `useUnreadCounts` hook — accepts `excludeMqtt` option, includes in URL + query key - `MessagingContext` — reads `showMqttMessages` from UIContext (required swapping UIProvider/MessagingProvider nesting in App.tsx so MessagingContext has access) and passes `excludeMqtt: !showMqttMessages` **#3787 Bug 2 — Message time/hop text is now readable** - Raises `.message-time` opacity from 0.7 → 0.9 - Changes `.theirs .message-time` colour from low-contrast `--ctp-subtext0` to `--ctp-text` (primary text colour) - Raises HopCountDisplay signal and hop-count span opacity from 0.7 → 0.9/1.0 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TTF1xow6PNNMeVHHbdvKUR
|
Claude finished @Yeraze's task —— View job PR Review — fix: auto-favorite role filter, MQTT notification dot, message text readabilityOverall: Clean, well-scoped fixes. The changes are coherent with the codebase conventions and the explanations in the PR description are thorough. A few observations below. Fix 1 — Auto-favorite role filter (
|
| Area | Status |
|---|---|
| Auto-favorite logic | ✅ Correct |
| Auto-favorite tests | ✅ Adequate (minor: doc-only tests in favoriteLocked matrix) |
| MQTT notification dot — DB/ORM | ✅ Correct; mqttClause string injection is safe but worth a note |
| MQTT notification dot — DM counts not filtered | |
| MQTT notification dot — query key cache invalidation | ✅ Correct |
| Message readability | ✅ Correct |
The DM-count gap is the only item worth a follow-up check. Everything else looks solid.
Adds the lxc/ directory to sparse-cone.txt so LXC template builds include build-lxc-template.sh and sparse-cone.txt itself (required at build time). Also converts CRLF → LF and adds missing trailing newline. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TTF1xow6PNNMeVHHbdvKUR
|
Closing as redundant after untangling overlapping PRs on #3774/#3787/#3782:
No unique work is lost — both underlying issues are covered by #3786 and #3790. Closing to keep one focused PR per issue. |
Summary
Three bug fixes across two issues.
#3774 — Auto-favorite no longer favorites CLIENT/CLIENT_MUTE on any local role
isAutoFavoriteEligiblepreviously applied theZERO_HOP_RELAY_ROLEScheck (ROUTER, ROUTER_LATE, CLIENT_BASE) only when the local node was ROUTER or ROUTER_LATE. For CLIENT_BASE locals, execution fell through to an unconditionalreturn true, auto-favoriting CLIENT_MUTE and CLIENT nodes.Following the Discord discussion and the official request in the issue, the fix removes the local-role guard —
ZERO_HOP_RELAY_ROLESis now enforced for all eligible local roles. This matches the Meshtastic zero-cost hop spec and keeps CLIENT_BASE's selectivity under operator control.Changed files:
src/server/constants/autoFavorite.ts— removedlocalRole === ROUTER || ROUTER_LATEguard; updated JSDocsrc/server/meshtasticManager.autoFavorite.test.ts— correctedCLIENT_BASE + CLIENT → truetest tofalse; addedCLIENT_BASE + CLIENT_MUTE → falseregression test (28 → 29 tests, all pass)#3787 Bug 1 — MQTT notification dot now respects "Show MQTT/Bridge Messages"
The unread-counts query counted all messages regardless of
viaMqtt. The user's preference was frontend-only and never reached the database.Fix:
excludeMqttis now threaded through the full stack:NotificationsRepository.getUnreadCountsByChannelAsyncexcludeMqtt?: boolean; adds DrizzleOR(isNull(viaMqtt), eq(viaMqtt, false))conditionDatabaseService.getUnreadCountsByChannel(SQLite raw SQL)mqttClause—AND (m.viaMqtt IS NULL OR m.viaMqtt = 0)DatabaseService.getUnreadCountsByChannelAsyncexcludeMqttto both SQLite sync and ORM paths/api/messages/unread-countsendpoint?excludeMqtt=1query paramuseUnreadCountshookexcludeMqttoption; includes in URL and TanStack Query keyMessagingContextshowMqttMessagesfromUIContext; passesexcludeMqtt: !showMqttMessagesApp.tsxUIProvider/MessagingProvidernesting so MessagingContext can access UIContext (no circular dependency — UIContext has no dependency on MessagingContext)#3787 Bug 2 — Message time and hop count text is now readable
The time/hop metadata on message bubbles was hard to read due to stacked contrast reductions.
Root cause:
.message-timehadopacity: 0.7.theirs .message-timeusedvar(--ctp-subtext0)(secondary colour) instead of primary textHopCountDisplaysignal and hop-count spans also hadopacity: 0.7Fix:
src/styles/messages.css— raised.message-timeopacity0.7 → 0.9; changed.theirscolour tovar(--ctp-text); raised.mineopacity0.7 → 0.9src/components/HopCountDisplay.tsx— signal span0.7 → 0.9; hop span0.7 → 1.0Test plan
npm run test src/server/meshtasticManager.autoFavorite.test.ts)🤖 Generated with Claude Code
https://claude.ai/code/session_01TTF1xow6PNNMeVHHbdvKUR
Generated by Claude Code