You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 90ce5e3
Browse filesBrowse the repository at this point in the historyBrowse files
fix(notes): open buzz:// links in shared notes in the app (#2115)
## Problem
The shared Notes reader (`src/bundled/relay-notes`) passed every link
through `safeLinkUrl`, which keeps only http(s). Agents write notes that
cite Buzz conversations, and those links were dead:
- `[the blockers thread](buzz://message?…)` rendered as plain text.
- A `<buzz://channel/…>` autolink rendered as the raw URL string.
- The reader body had no link style, so even the web links that survived
looked like body text.

## What changes
Note bodies now use the message link component (`MessageLink`) but not
the rest of `MessageMarkdown`, so long-form notes keep their own
Markdown rendering.
1. **`a522ba059`: open `buzz://` links in the app.**
- `urlTransform` keeps URLs that `parseBuzzLink` accepts and sends
everything else through `safeLinkUrl`. `javascript:`, `mailto:` and
relative links still render without an `href`.
- The `a` renderer uses `MessageLink` with the relay session. A message
link shows its hover preview, and a raw channel autolink reads
`#<name>`.
- A new `openLink` resolves the URL with `buzzLinkTarget` and opens it
with `navigator.open`. The scope it needs is the one `NotesPage` already
derived for page requests, now moved into a memo and passed down. For
web links `openLink` returns `false`, so they still open in a new tab
with `rel="noopener noreferrer"`.
2. **`530ee8376`: keep formatted labels.** react-markdown passes a
formatted label, such as `[the **release** room](buzz://channel/…)`, as
an array rather than a string. The first commit therefore treated these
links as raw autolinks: a visible channel was announced as `#Release`
while showing the authored text, and for a channel the reader can't see,
the authored text was replaced with "Private channel". The renderer now
flattens the label with `labelText`, as `MessageMarkdown` does.
`labelText` moves unchanged to `src/features/messages/label-text.ts`, so
the plugin doesn't import `MessageMarkdown`.
3. **`8d08da0d6`: underline links.** `NotesPage.module.css` gets one
rule: `.markdown a:not([data-solo-link])` sets `color: var(--text-link)`
and `text-decoration: underline`. As in messages, solo-chat chips are
excluded and keep their `LinkPreview` treatment.
Web links in notes now behave as they do in messages. They get the link
menu ("Open in browser", "Copy link"), and the tooltip shows the URL
instead of an authored Markdown link title.
## Why the links are neutral `text-link`, not the message blue
`DESIGN.md` § Link contrast: "General inline links use the neutral
`text-link` and a persistent underline. … Bubble links use the family’s
readable `text-message-link` … never pick a link color per component."
The notes reader isn't a message bubble, so it uses the general role, as
the plugin README (`PluginReadme.module.css`) and diff notices
(`Diffs.module.css`) already do. `--text-link` resolves to
`--text-standard` in both themes, so the underline is what marks a link.
Using `text-message-link` here would need a change to the design guide,
not a local override.
## Before and after
https://github.com/user-attachments/assets/ebb4f2fa-5fdc-4bcb-9827-44c3354e7b85
Before is left (`main` at `af6e8993d`); After is right (this branch at
`8d08da0d6`).
The recording steps through four links in one note: a message link, a
raw channel autolink, a formatted label, and a web link. Each step
starts at the same moment in both halves.
## Tests
`src/bundled/relay-notes/NotesPage.test.tsx` (Vitest and React Testing
Library) gains three cases:
- **Opens Buzz message and channel links in the app, naming a raw
channel link.** The message link is a link and shows "Message preview"
on hover. The raw channel autolink reads `#Release`. Each click calls
`navigator.open` with the expected target.
- **Keeps a formatted label on a Buzz channel link.** The link keeps the
text "the release room" and its `<strong>`. This case fails without
`530ee8376`.
- **Explains that a Buzz link can't be opened without a scope or
navigator.** Clicking shows "This Buzz link couldn’t be opened here."
The existing "renders note content as Markdown without executable HTML
or unsafe links" case still covers `javascript:`, `mailto:`, relative
links and images. No browser journeys were added or removed.
No test asserts link styling. I checked it in the recording: at
`8d08da0d6`, both a `buzz://` link and an https link compute
`text-decoration-line: underline`; at the base, both compute `none`.
## Validation
- Before the push, these passed locally on the branch: the `NotesPage`
and `MessageMarkdown` test files, `tsc --noEmit`, `biome check`,
`design:check`, and the commit hooks. The push skipped the pre-push hook
(`--no-verify`) because the local machine was too loaded to run it, so
CI is the broad check.
- An agent exercised the flow in the browser build, in the light theme,
in a wide window, using the pointer only (the recording above).
- Not yet exercised: the dark theme, narrow widths, enlarged text,
keyboard activation, and the desktop app. A human hasn't tested this
yet, so the PR stays in draft.
## Follow-ups (not in this PR)
- **Bare `buzz://…` text without angle brackets stays plain text.**
remark-gfm autolinks only http(s), `www.` and email addresses. Messages
catch bare `buzz://` text with `messageLinkParts`.
- **Note links have no hover treatment.** The shared hover fill in
`InlineReference.module.css` reaches links only through the links
plugin, which notes don't use. Adding it would also bring that plugin's
icons and chips into notes.
- **Out of scope:** `nostr:` profile links, and the raw-Markdown summary
on note cards (visible in the screenshot above).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Signed-off-by: Matt Toohey <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
0 commit comments