Add background-hash-mark addition for region routing

Per https://buymeacoffee.com/ripplebiz/region-filtering:

> After some discussions, and that there is some confusion
around #channels and #regions, it's been decided to drop
the requirement to have the '#' prefix. So, region names
will just be plain alphanumeric (and '-'), with no # prefix.

> For backwards compatibility, the names will internally have
a '#' prepended, but for all client GUI's and command lines,
you generally won't see mention of '#' prefixes. The next
firmware release (v1.12.0) and subsequent Ripple firmware
and Liam's app will have modified UI to remove the '#' requirement.

So, silently add, but don't duplicate, for users who have already
added hashmarks.
This commit is contained in:
Jack Kingsman
2026-03-09 15:24:23 -07:00
parent e03ddcaaa7
commit b157ee14e4
13 changed files with 107 additions and 24 deletions
@@ -5,6 +5,7 @@ import { Button } from '../ui/button';
import { Separator } from '../ui/separator';
import { toast } from '../ui/sonner';
import { RADIO_PRESETS } from '../../utils/radioPresets';
import { stripRegionScopePrefix } from '../../utils/regionScope';
import type {
AppSettings,
AppSettingsUpdate,
@@ -83,7 +84,7 @@ export function SettingsRadioSection({
useEffect(() => {
setAdvertIntervalHours(String(Math.round(appSettings.advert_interval / 3600)));
setFloodScope(appSettings.flood_scope);
setFloodScope(stripRegionScopePrefix(appSettings.flood_scope));
setMaxRadioContacts(String(appSettings.max_radio_contacts));
}, [appSettings]);
@@ -256,7 +257,7 @@ export function SettingsRadioSection({
if (newAdvertInterval !== appSettings.advert_interval) {
update.advert_interval = newAdvertInterval;
}
if (floodScope !== appSettings.flood_scope) {
if (floodScope !== stripRegionScopePrefix(appSettings.flood_scope)) {
update.flood_scope = floodScope;
}
const newMaxRadioContacts = parseInt(maxRadioContacts, 10);
@@ -554,10 +555,10 @@ export function SettingsRadioSection({
id="flood-scope"
value={floodScope}
onChange={(e) => setFloodScope(e.target.value)}
placeholder="#MyRegion"
placeholder="MyRegion"
/>
<p className="text-xs text-muted-foreground">
Tag outgoing flood messages with a region name (e.g. #MyRegion). Repeaters configured for
Tag outgoing flood messages with a region name (e.g. MyRegion). Repeaters configured for
that region can forward the traffic, while repeaters configured to deny other regions may
drop it. Leave empty to disable.
</p>