Skip to content

Fix and enhance handling of Bluesky facet links - #17

Open
jekis913 wants to merge 3 commits into
masonasons:mainfrom
jekis913:codex/bluesky-links-fix
Open

Fix and enhance handling of Bluesky facet links#17
jekis913 wants to merge 3 commits into
masonasons:mainfrom
jekis913:codex/bluesky-links-fix

Conversation

@jekis913

@jekis913 jekis913 commented Sep 3, 2026

Copy link
Copy Markdown

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:// or https:// 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.

  • Preserve Bluesky link facets in the shared Status model, including their visible text and destination URI.
  • Use facet links in post_links() and post_text_link_urls() while retaining literal-URL fallback behavior and deduplicating destinations.
  • Map facets for Bluesky notification statuses as well as normal timeline posts.
  • Persist facet links in the timeline cache and bump the cache schema magic.
  • Preserve existing Mastodon behavior by treating parsed HTML anchors as authoritative.
  • Add regression coverage for descriptive facet links, mixed facet/literal URLs, duplicate destinations, notification facets, UTF-8 byte offsets, cache round trips, and Mastodon anchors whose visible text looks like a different URL.

Testing

  • Local test suite passed.
  • Manually verified the fix in FastSMRW on Windows against a real Bluesky timeline: Open Links now detects and opens Bluesky links that previously were not recognized because the destination URL was only present in a facet rather than written out in the post text.
  • The full build GitHub Actions workflow was manually run against commit 6cf0a832d89acd70dc5a06c1d75fcef1a8c4dba5 on 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.

jekis913 and others added 3 commits September 2, 2026 18:02
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]>
Copilot AI lite review requested due to automatic review settings September 3, 2026 00:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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_links to 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_links in 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.

Comment thread core/src/presentation/status_presenter.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants