feat(sources): Simplify source display text logic for URLs
This commit is contained in:
@@ -196,19 +196,12 @@ class _OpenWebUISourcesWidgetState extends State<OpenWebUISourcesWidget> {
|
|||||||
|
|
||||||
// Debug: debugPrint('Building source item $index: $displayText');
|
// Debug: debugPrint('Building source item $index: $displayText');
|
||||||
|
|
||||||
// Determine display text
|
// Determine display text - for URL sources, show just the URL
|
||||||
String displayText;
|
String displayText;
|
||||||
String? title = source.title;
|
if (isUrl) {
|
||||||
|
displayText = url;
|
||||||
// If no direct title, check metadata
|
} else if (source.title != null && source.title!.isNotEmpty) {
|
||||||
if ((title == null || title.isEmpty) && source.metadata != null) {
|
displayText = source.title!;
|
||||||
title = source.metadata!['title']?.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (title != null && title.isNotEmpty) {
|
|
||||||
displayText = title;
|
|
||||||
} else if (isUrl) {
|
|
||||||
displayText = _extractDomain(url);
|
|
||||||
} else if (source.id != null && source.id!.isNotEmpty) {
|
} else if (source.id != null && source.id!.isNotEmpty) {
|
||||||
displayText = source.id!;
|
displayText = source.id!;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user