Files
redux-scraper/app/lib/bluesky/text/facet.rb
Dylan Knutson ad0675a9aa Add Bluesky post helper with facet rendering and external link support
- Add BlueskyPostHelper for rendering Bluesky post facets (mentions, links, hashtags)
- Implement facet parsing and rendering with proper styling
- Add external link partial for non-Bluesky URLs
- Update DisplayedFile and PostFiles components to handle Bluesky posts
- Add comprehensive test coverage for helper methods
- Update scan user job to handle Bluesky-specific data
2025-08-12 20:43:08 +00:00

23 lines
571 B
Ruby

# typed: strict
# frozen_string_literal: true
class Bluesky::Text::Facet < T::ImmutableStruct
extend T::Sig
const :byteStart, Integer
const :byteEnd, Integer
const :features, T::Array[Bluesky::Text::FacetFeature]
sig { params(hash: T::Hash[String, T.untyped]).returns(Bluesky::Text::Facet) }
def self.from_hash(hash)
new(
byteStart: hash["index"]["byteStart"],
byteEnd: hash["index"]["byteEnd"],
features:
hash["features"].map do |feature|
Bluesky::Text::FacetFeature.from_hash(feature)
end,
)
end
end