Fix and enhance handling of Bluesky facet links - #17
Open
jekis913 wants to merge 3 commits into
Open
Conversation
Preserve rich-text link facets in the shared status model so Open Links can use descriptive linked text instead of relying on visible URLs. Persist facet links in timeline caches and cover mapping, presentation, and cache round trips with tests. Co-Authored-By: Codex <[email protected]>
Map rich-text facets on notification statuses and merge faceted links with unfaceted literal URLs without duplicate destinations. Extend coverage for notification links, UTF-8 byte offsets, mixed link sources, deduplication, and cached link labels. Co-Authored-By: Codex <[email protected]>
Only scan rendered post text for literal URLs when no openable HTML anchors were parsed, retaining Bluesky facet-plus-literal handling without inventing destinations from Mastodon anchor labels. Add the direct algorithm include, correct the cache schema comment, and cover the Mastodon regression. Co-Authored-By: Codex <[email protected]>
There was a problem hiding this comment.
🟢 Approval recommended
The change set aligns with the PR description, includes a changelog entry and targeted regression tests, and the only review note is a minor warning-cleanup suggestion.
Pull request overview
This PR fixes link discovery for Bluesky posts by preserving AT Protocol rich-text facet links in the shared Status model and using those facet destinations (with literal-URL fallback) when building the Open Links list, while keeping Mastodon HTML anchors authoritative.
Changes:
- Add
Status::text_linksto carry facet link display text + destination URL and map Bluesky link facets into it (including notification statuses). - Update link extraction (
post_links()/post_text_link_urls()) to prefer facet/anchor links, fall back to scanning literal URLs only when no anchors were present, and deduplicate destinations. - Persist
text_linksin the timeline cache (schema magic bump) and add regression tests + changelog entry.
File summaries
| File | Description |
|---|---|
| tests/test_presentation.cpp | Adds coverage for Mastodon anchor authority and Bluesky facet link discovery/dedup behavior. |
| tests/test_models.cpp | Verifies Status cache/serialization roundtrip preserves text_links. |
| tests/test_bluesky_map.cpp | Adds coverage for mapping Bluesky link facets (including UTF-8 byte offsets) and notification facet mapping. |
| docs/changelog.txt | Adds a user-facing changelog line for the Bluesky Open Links fix. |
| core/src/store/timeline_codec.cpp | Bumps cache magic and serializes/deserializes Status::text_links. |
| core/src/presentation/status_presenter.cpp | Uses Status::text_links during link extraction with correct Mastodon anchor precedence and URL deduping. |
| core/src/platform/bluesky/bluesky_map.cpp | Maps link facets into Status::text_links and includes facets for notification statuses. |
| core/include/fastsm/models/status.hpp | Introduces StatusTextLink and stores text_links on Status. |
Review details
- Files reviewed: 8/8 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Problem
FastSMRW's Open Links command did not reliably work for Bluesky posts.
Bluesky post text is plain text, with links represented separately by AT Protocol rich-text facets. The visible text for a link may be descriptive or truncated and may not contain a literal
http://orhttps://URL at all.FastSMRW previously handled Bluesky links by scanning the displayed post text for literal URLs. As a result, links such as descriptive linked text could be present and usable in Bluesky while FastSMRW reported that the post contained no links.
Summary
Fix Open Links for Bluesky posts whose links are represented by AT Protocol rich-text facets rather than literal URLs in the post text.
Statusmodel, including their visible text and destination URI.post_links()andpost_text_link_urls()while retaining literal-URL fallback behavior and deduplicating destinations.Testing
buildGitHub Actions workflow was manually run against commit6cf0a832d89acd70dc5a06c1d75fcef1a8c4dba5on the fork and completed successfully across Windows, Linux, Android, macOS, and iOS.Scope / known limitation
This fixes link discovery when Bluesky provides a rich-text link facet. It does not change how posts announce the presence of links or link-preview cards in the timeline.
Some Bluesky posts can therefore contain an external link/card without any text that makes the presence of the link obvious to a screen-reader user. Improving that discoverability would be a separate presentation/accessibility change.