feat(BookmarkRow): show a content excerpt under each bookmark title
All checks were successful
CI / build-and-deploy (push) Successful in 30s
All checks were successful
CI / build-and-deploy (push) Successful in 30s
Surface a bit of the page content in the list without fetching/parsing pages ourselves — linkding already returns the scraped metadata in the bookmark payload. Add Bookmark.contentExcerpt (website_description, falling back to the user's note) and render it under the title: AI summary takes priority and stays italic, otherwise the scraped excerpt shows. Rows with neither degrade to the existing favicon + title layout. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -41,6 +41,17 @@ struct Bookmark: Codable, Identifiable, Sendable, Hashable {
|
||||
var domain: String {
|
||||
URL(string: url)?.host ?? url
|
||||
}
|
||||
|
||||
/// A short content snippet for list previews: the page's scraped meta
|
||||
/// description, falling back to the user's own note. nil when neither exists.
|
||||
var contentExcerpt: String? {
|
||||
for candidate in [websiteDescription, description] {
|
||||
if let c = candidate?.trimmingCharacters(in: .whitespacesAndNewlines), !c.isEmpty {
|
||||
return c
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
struct BookmarkResponse: Codable, Sendable {
|
||||
|
||||
Reference in New Issue
Block a user