Repository navigation
Avoid rewriting localhost links on Connect hosts - #4096
Merged
ymichael merged 3 commits intoSep 22, 2026
Merged
Conversation
ymichael
force-pushed
the
bb/explain-localhost-link-rewriting-thr_evnwdy48ra
branch
from
September 22, 2026 22:24
ae08ce2 to
e2c107c
Compare
ymichael
deleted the
bb/explain-localhost-link-rewriting-thr_evnwdy48ra
branch
September 22, 2026 23:25
danielbachhuber
added a commit
to danielbachhuber/bb
that referenced
this pull request
Sep 23, 2026
- markdown-preview.test.tsx: this branch's footnote-scroll test and main's "keeps a rewritten link mounted across unrelated preview rerenders" test (get-bb#4096) were both appended after the same test, which is what conflicted. Both are kept. - markdown-preview.tsx merged cleanly. Main's only change there is a Prettier reformat of MarkdownImageProps; the fragment handling already routes through rewrittenHref, so localhost rewriting does not affect footnotes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human comments
What was wrong
The localhost-link rewrite replaced
localhostwith the current page hostname even when bb was opened through Connect. That produced URLs such ashttp://asdf.getbb.app:5173/app, which are not Connect share URLs and do not work. The setting's description also hid the exact destination at the current app address.What changed
The rewrite now skips page hostnames matching a code-defined list of patterns for
getbb.appand its subdomains. The Links setting shows an example using the current app address when rewriting applies. It is hidden where rewriting has no effect, includinggetbb.apphosts and the exactlocalhosthostname. Added regression coverage forgetbb.apppage hostnames, existing Connect share links, unrelated.localhosthostnames, rewritten-link DOM stability, and setting visibility. No wire, CLI, or configuration changes.How you verified
pnpm exec turbo run test typecheck --filter=@bb/app --filter=@bb/client-core(5,087 app tests passed, 5 skipped; 309 client-core tests passed)127.0.0.1and.localhosthosts (row with example) andgetbb.apphosts (row hidden)pnpm start:worktreeserved the final PR head;/settingsverified at127.0.0.1:20300; the current host rules are covered by focused testsgit diff --checkReviewer handoff and before/after screenshots are stored in BB thread storage under
thr_evnwdy48ra/localhost-link-rewrite, outside this PR. Live build through BB ConnectThe reported cursor flicker was not reproduced; the DOM stability test covers one plausible remount path.