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
@@ -117,7 +117,7 @@ describe('ChatHeader key visibility', () => {
render(<ChatHeader {...baseProps} conversation={conversation} channels={[channel]} />);
expect(screen.getByText('Regional override active: #Esperance')).toBeInTheDocument();
expect(screen.getByText('Regional override active: Esperance')).toBeInTheDocument();
});
it('prompts for regional override when globe button is clicked', () => {
@@ -125,7 +125,7 @@ describe('ChatHeader key visibility', () => {
const channel = makeChannel(key, '#flightless', true);
const conversation: Conversation = { type: 'channel', id: key, name: '#flightless' };
const onSetChannelFloodScopeOverride = vi.fn();
const promptSpy = vi.spyOn(window, 'prompt').mockReturnValue('#Esperance');
const promptSpy = vi.spyOn(window, 'prompt').mockReturnValue('Esperance');
render(
<ChatHeader
@@ -139,7 +139,7 @@ describe('ChatHeader key visibility', () => {
fireEvent.click(screen.getByTitle('Set regional override'));
expect(promptSpy).toHaveBeenCalled();
expect(onSetChannelFloodScopeOverride).toHaveBeenCalledWith(key, '#Esperance');
expect(onSetChannelFloodScopeOverride).toHaveBeenCalledWith(key, 'Esperance');
promptSpy.mockRestore();
});
});