Skip to content

Commit c5a54dc

Browse files
wesbillmanPinky
andauthored
Rename web app to Buzz (#959)
Signed-off-by: Wes <[email protected]> Co-authored-by: Pinky <44b8e82baa6e0e254e0208d68f335c283c94e7b78dd1fa10d5a49d3f13dd0435@sprout-oss.stage.blox.sqprod.co>
1 parent 510009c commit c5a54dc

25 files changed

Lines changed: 146 additions & 95 deletions

‎AGENTS.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ or invoke with the full path.
176176

177177
### Deep Links
178178

179-
`sprout://message?channel=<uuid>&id=<hex>` links reference a specific message
179+
`buzz://message?channel=<uuid>&id=<hex>` links reference a specific message
180180
thread. To read the linked thread:
181181

182182
```bash

‎Dockerfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ FROM --platform=linux/amd64 node:24-bookworm-slim AS web-builder
1111
WORKDIR /build
1212
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
1313
COPY web/ web/
14-
RUN corepack enable && pnpm install --frozen-lockfile --filter sprout-web
14+
RUN corepack enable && pnpm install --frozen-lockfile --filter buzz-web
1515
RUN pnpm -C web build
1616

1717
# ── Runtime stage ───────────────────────────────────────────

‎desktop/src-tauri/src/lib.rs‎

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ fn shutdown_managed_agents(app: &tauri::AppHandle) -> Result<(), String> {
246246
Ok(())
247247
}
248248

249-
/// Parse the query string of a `sprout://message?…` URL into the JSON
249+
/// Parse the query string of a `buzz://message?…` URL into the JSON
250250
/// payload emitted on `deep-link-message`. Returns `None` when a required
251251
/// param (`channel`, `id`) is missing or empty — mirroring the validation
252252
/// policy of the `connect` arm so the frontend never sees a half-formed
@@ -278,10 +278,10 @@ fn parse_message_deep_link(url: &Url) -> Option<serde_json::Value> {
278278
}))
279279
}
280280

281-
/// Handle an incoming `sprout://` deep link URL.
281+
/// Handle an incoming `buzz://` deep link URL, with `sprout://` accepted as a legacy alias.
282282
///
283283
/// Currently supports:
284-
/// - `sprout://connect?relay=<ws(s)://...>` — emits `deep-link-connect` to the frontend
284+
/// - `buzz://connect?relay=<ws(s)://...>` — emits `deep-link-connect` to the frontend
285285
fn handle_deep_link_url(app: &tauri::AppHandle, url_str: &str) {
286286
let url = match Url::parse(url_str) {
287287
Ok(u) => u,
@@ -291,8 +291,8 @@ fn handle_deep_link_url(app: &tauri::AppHandle, url_str: &str) {
291291
}
292292
};
293293

294-
if url.scheme() != "sprout" {
295-
eprintln!("sprout-desktop: ignoring non-sprout deep link: {url_str}");
294+
if url.scheme() != "sprout" && url.scheme() != "buzz" {
295+
eprintln!("sprout-desktop: ignoring unsupported deep link scheme: {url_str}");
296296
return;
297297
}
298298

@@ -324,7 +324,7 @@ fn handle_deep_link_url(app: &tauri::AppHandle, url_str: &str) {
324324
let _ = app.emit("deep-link-connect", relay_url);
325325
}
326326
Some("message") => {
327-
// `sprout://message?channel=<uuid>&id=<eventId>[&thread=<rootId>]`
327+
// `buzz://message?channel=<uuid>&id=<eventId>[&thread=<rootId>]`
328328
//
329329
// Validation policy mirrors the `connect` arm: parse what we
330330
// need, refuse to emit anything if a required param is missing
@@ -373,7 +373,7 @@ pub fn run() {
373373
}
374374
// Forward any deep link URLs from the duplicate launch.
375375
for arg in &argv {
376-
if arg.starts_with("sprout://") {
376+
if arg.starts_with("sprout://") || arg.starts_with("buzz://") {
377377
handle_deep_link_url(app, arg);
378378
}
379379
}
@@ -869,6 +869,14 @@ mod tests {
869869
assert!(payload["threadRootId"].is_null());
870870
}
871871

872+
#[test]
873+
fn parse_message_deep_link_accepts_buzz_scheme() {
874+
let url = Url::parse("buzz://message?channel=abc&id=xyz").unwrap();
875+
let payload = parse_message_deep_link(&url).expect("required params present");
876+
assert_eq!(payload["channelId"], "abc");
877+
assert_eq!(payload["messageId"], "xyz");
878+
}
879+
872880
#[test]
873881
fn parse_message_deep_link_includes_thread_root() {
874882
let url = Url::parse("sprout://message?channel=abc&id=xyz&thread=root1").unwrap();

‎desktop/src-tauri/tauri.conf.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
},
4444
"deep-link": {
4545
"desktop": {
46-
"schemes": ["sprout"]
46+
"schemes": ["sprout", "buzz"]
4747
}
4848
}
4949
},

‎desktop/src/app/AppShell.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ export function AppShell() {
524524
unreadChannelIds.size,
525525
]);
526526

527-
// Dispatch `sprout://message` deep links into the router.
527+
// Dispatch `buzz://message` deep links into the router.
528528
useMessageDeepLinks();
529529

530530
React.useEffect(() => {

‎desktop/src/features/messages/lib/messageLink.test.mjs‎

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const THREAD =
1515

1616
test("buildMessageLink → parseMessageLink round-trips without thread", () => {
1717
const url = buildMessageLink({ channelId: CHANNEL, messageId: MESSAGE });
18-
assert.equal(url, `sprout://message?channel=${CHANNEL}&id=${MESSAGE}`);
18+
assert.equal(url, `buzz://message?channel=${CHANNEL}&id=${MESSAGE}`);
1919

2020
const parsed = parseMessageLink(url);
2121
assert.equal(parsed.ok, true);
@@ -52,37 +52,37 @@ test("buildMessageLink treats null/empty thread as absent", () => {
5252
messageId: MESSAGE,
5353
threadRootId: "",
5454
});
55-
assert.equal(a, `sprout://message?channel=${CHANNEL}&id=${MESSAGE}`);
56-
assert.equal(b, `sprout://message?channel=${CHANNEL}&id=${MESSAGE}`);
55+
assert.equal(a, `buzz://message?channel=${CHANNEL}&id=${MESSAGE}`);
56+
assert.equal(b, `buzz://message?channel=${CHANNEL}&id=${MESSAGE}`);
5757
});
5858

5959
test("buildMessageLink rejects missing required params", () => {
6060
assert.throws(() => buildMessageLink({ channelId: "", messageId: MESSAGE }));
6161
assert.throws(() => buildMessageLink({ channelId: CHANNEL, messageId: "" }));
6262
});
6363

64-
test("parseMessageLink rejects non-sprout schemes", () => {
64+
test("parseMessageLink rejects unsupported schemes", () => {
6565
const r = parseMessageLink(
6666
`https://example.com/?channel=${CHANNEL}&id=${MESSAGE}`,
6767
);
6868
assert.equal(r.ok, false);
6969
assert.equal(r.ok === false && r.reason, "wrong-scheme");
7070
});
7171

72-
test("parseMessageLink rejects sprout:// with wrong host", () => {
73-
const r = parseMessageLink(`sprout://connect?relay=wss://example.com`);
72+
test("parseMessageLink rejects buzz:// with wrong host", () => {
73+
const r = parseMessageLink(`buzz://connect?relay=wss://example.com`);
7474
assert.equal(r.ok, false);
7575
assert.equal(r.ok === false && r.reason, "wrong-host");
7676
});
7777

7878
test("parseMessageLink rejects missing channel", () => {
79-
const r = parseMessageLink(`sprout://message?id=${MESSAGE}`);
79+
const r = parseMessageLink(`buzz://message?id=${MESSAGE}`);
8080
assert.equal(r.ok, false);
8181
assert.equal(r.ok === false && r.reason, "missing-channel");
8282
});
8383

8484
test("parseMessageLink rejects missing id", () => {
85-
const r = parseMessageLink(`sprout://message?channel=${CHANNEL}`);
85+
const r = parseMessageLink(`buzz://message?channel=${CHANNEL}`);
8686
assert.equal(r.ok, false);
8787
assert.equal(r.ok === false && r.reason, "missing-id");
8888
});
@@ -93,11 +93,28 @@ test("parseMessageLink rejects malformed URL strings", () => {
9393
assert.equal(r.ok === false && r.reason, "invalid-url");
9494
});
9595

96-
test("isMessageLink matches only sprout://message", () => {
96+
test("parseMessageLink accepts legacy sprout://message links", () => {
97+
const r = parseMessageLink(
98+
`sprout://message?channel=${CHANNEL}&id=${MESSAGE}`,
99+
);
100+
assert.equal(r.ok, true);
101+
assert.deepEqual(r.ok && r.value, {
102+
channelId: CHANNEL,
103+
messageId: MESSAGE,
104+
threadRootId: null,
105+
});
106+
});
107+
108+
test("isMessageLink matches buzz://message and legacy sprout://message", () => {
109+
assert.equal(
110+
isMessageLink(`buzz://message?channel=${CHANNEL}&id=${MESSAGE}`),
111+
true,
112+
);
97113
assert.equal(
98114
isMessageLink(`sprout://message?channel=${CHANNEL}&id=${MESSAGE}`),
99115
true,
100116
);
117+
assert.equal(isMessageLink("buzz://connect?relay=wss://x"), false);
101118
assert.equal(isMessageLink("sprout://connect?relay=wss://x"), false);
102119
assert.equal(isMessageLink("https://example.com"), false);
103120
assert.equal(isMessageLink(undefined), false);

‎desktop/src/features/messages/lib/messageLink.ts‎

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
/**
2-
* `sprout://message` link encoding for "Copy link" / deep-link-to-message.
2+
* `buzz://message` link encoding for "Copy link" / deep-link-to-message.
33
*
4-
* Format: `sprout://message?channel=<uuid>&id=<eventId>[&thread=<rootId>]`
5-
*
6-
* Mirrors the existing `sprout://connect?relay=…` scheme already registered
7-
* in `tauri.conf.json` and handled in `desktop/src-tauri/src/lib.rs`.
4+
* Format: `buzz://message?channel=<uuid>&id=<eventId>[&thread=<rootId>]`
85
*/
96

7+
const MESSAGE_LINK_SCHEME = "buzz:";
8+
const LEGACY_MESSAGE_LINK_SCHEME = "sprout:";
109
const MESSAGE_LINK_HOST = "message";
1110

1211
export type MessageLinkInput = {
@@ -35,7 +34,7 @@ export type MessageLinkParseResult =
3534
| { ok: false; reason: string };
3635

3736
/**
38-
* Build a `sprout://message` URL for a given channel + message.
37+
* Build a `buzz://message` URL for a given channel + message.
3938
*
4039
* Empty `threadRootId` is treated as "no thread" so callers can pass through
4140
* the result of `getThreadReference(tags).rootId` without extra null checks.
@@ -54,12 +53,14 @@ export function buildMessageLink(input: MessageLinkInput): string {
5453
if (input.threadRootId) {
5554
params.set("thread", input.threadRootId);
5655
}
57-
return `sprout://${MESSAGE_LINK_HOST}?${params.toString()}`;
56+
return `${MESSAGE_LINK_SCHEME}//${MESSAGE_LINK_HOST}?${params.toString()}`;
5857
}
5958

6059
/**
61-
* Parse a `sprout://message?…` URL. Returns a discriminated result so
62-
* callers can render a fallback (e.g. a plain link) without throwing.
60+
* Parse a `buzz://message?…` URL. Legacy `sprout://message?…` links are
61+
* accepted so already-copied message links keep working during the rename.
62+
* Returns a discriminated result so callers can render a fallback (e.g. a
63+
* plain link) without throwing.
6364
*/
6465
export function parseMessageLink(url: string): MessageLinkParseResult {
6566
let parsed: URL;
@@ -69,10 +70,13 @@ export function parseMessageLink(url: string): MessageLinkParseResult {
6970
return { ok: false, reason: "invalid-url" };
7071
}
7172

72-
if (parsed.protocol !== "sprout:") {
73+
if (
74+
parsed.protocol !== MESSAGE_LINK_SCHEME &&
75+
parsed.protocol !== LEGACY_MESSAGE_LINK_SCHEME
76+
) {
7377
return { ok: false, reason: "wrong-scheme" };
7478
}
75-
// `new URL("sprout://message?…")` puts "message" in `hostname`.
79+
// `new URL("buzz://message?…")` puts "message" in `hostname`.
7680
if (parsed.hostname !== MESSAGE_LINK_HOST) {
7781
return { ok: false, reason: "wrong-host" };
7882
}
@@ -97,10 +101,15 @@ export function parseMessageLink(url: string): MessageLinkParseResult {
97101
}
98102

99103
/**
100-
* Convenience: returns true if the given href is a `sprout://message` link.
104+
* Convenience: returns true if the given href is a supported message link.
101105
* Cheap pre-check used by the markdown renderer before parsing.
102106
*/
103107
export function isMessageLink(href: string | undefined | null): boolean {
104108
if (!href) return false;
105-
return href.startsWith("sprout://message?") || href === "sprout://message";
109+
return (
110+
href.startsWith("buzz://message?") ||
111+
href === "buzz://message" ||
112+
href.startsWith("sprout://message?") ||
113+
href === "sprout://message"
114+
);
106115
}

‎desktop/src/features/messages/lib/remarkMessageLinks.ts‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
/**
2-
* Remark plugin that detects bare `sprout://message?…` URLs in text nodes and
3-
* replaces each with a custom `message-link` HAST element. The `markdown.tsx`
2+
* Remark plugin that detects bare `buzz://message?…` URLs in text nodes and
3+
* replaces each with a custom `message-link` HAST element. Legacy
4+
* `sprout://message?…` URLs are accepted during the rename. The `markdown.tsx`
45
* components map renders that as an inline pill (channel name + click-to-open)
56
* instead of the raw 100-char URL.
67
*
78
* Why this plugin exists: `remark-gfm`'s autolinker only covers `http(s)://`
8-
* and `www.`. Custom schemes like `sprout://` only reach the `<a>` component
9-
* override when the user wrote an explicit `[label](sprout://…)` link.
9+
* and `www.`. Custom schemes like `buzz://` only reach the `<a>` component
10+
* override when the user wrote an explicit `[label](buzz://…)` link.
1011
*
1112
* Mirrors `remarkChannelLinks` / `remarkMentions` — same factory, same HAST
1213
* shape — so the rendering layer treats all three uniformly. Trailing
@@ -19,7 +20,7 @@
1920
// --experimental-strip-types`. `tsconfig.json` enables `allowImportingTsExtensions`.
2021
import { createRemarkPrefixPlugin } from "../../../shared/lib/createRemarkPrefixPlugin.ts";
2122

22-
const MESSAGE_URL_PATTERN = /sprout:\/\/message\?[^\s<>"')\]]+/g;
23+
const MESSAGE_URL_PATTERN = /(?:buzz|sprout):\/\/message\?[^\s<>"')\]]+/g;
2324
const TRAILING_PUNCTUATION_PATTERN = /[.,;:!?]+$/;
2425

2526
function trimMessageLinkMatch(matchText: string) {

‎desktop/src/features/messages/lib/useRichTextEditor.ts‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,11 @@ export function useRichTextEditor({
304304
openOnClick: false,
305305
autolink: true,
306306
linkOnPaste: true,
307-
// Allow `sprout://` (used by Copy-link-to-message + sprout://connect)
308-
// through TipTap's URL sanitiser. http(s) and mailto are accepted by
309-
// default; non-listed protocols are stripped on paste/typed input.
310-
protocols: ["sprout"],
307+
// Allow Buzz message links through TipTap's URL sanitiser. Keep the
308+
// legacy Sprout protocol so already-copied links survive paste.
309+
// http(s) and mailto are accepted by default; non-listed protocols are
310+
// stripped on paste/typed input.
311+
protocols: ["buzz", "sprout"],
311312
HTMLAttributes: {
312313
class: "text-primary underline underline-offset-4 cursor-pointer",
313314
},

‎desktop/src/shared/deep-link.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export interface DeepLinkDeps {
1414
}
1515

1616
/**
17-
* Payload emitted by the Rust deep-link handler for `sprout://message?…`.
17+
* Payload emitted by the Rust deep-link handler for `buzz://message?…`.
1818
* Field names match the JSON shape produced in `desktop/src-tauri/src/lib.rs`.
1919
*/
2020
export type MessageDeepLinkPayload = {
@@ -26,11 +26,11 @@ export type MessageDeepLinkPayload = {
2626
/**
2727
* Register listeners for deep-link events emitted by the Rust backend.
2828
*
29-
* When a `sprout://connect?relay=<url>` link is opened, the handler
29+
* When a `buzz://connect?relay=<url>` link is opened, the handler
3030
* adds a workspace for the relay (deduplicating by URL) and switches
3131
* to it. Returns an unlisten function to tear down all listeners.
3232
*
33-
* `sprout://message?…` is handled separately by `listenForMessageDeepLinks`,
33+
* `buzz://message?…` is handled separately by `listenForMessageDeepLinks`,
3434
* because it needs to dispatch into the router which only exists below the
3535
* `RouterProvider` in the component tree.
3636
*/

0 commit comments

Comments
 (0)