💄 Optimize fediverse mention rendering, etc
This commit is contained in:
@@ -584,6 +584,10 @@ class _WebSocketIndicator extends HookConsumerWidget {
|
||||
isInteractive = false;
|
||||
}
|
||||
|
||||
if (user.value == null) {
|
||||
opacity = 0.0;
|
||||
}
|
||||
|
||||
return Positioned(
|
||||
top: devicePadding.top + (isDesktop ? 27.5 : 25),
|
||||
left: 0,
|
||||
|
||||
@@ -39,6 +39,7 @@ class MarkdownTextContent extends HookConsumerWidget {
|
||||
final List<markdown.InlineSyntax> extraInlineSyntaxList;
|
||||
final List<markdown.BlockSyntax> extraBlockSyntaxList;
|
||||
final List<dynamic> extraGenerators;
|
||||
final bool noMentionChip;
|
||||
|
||||
const MarkdownTextContent({
|
||||
super.key,
|
||||
@@ -53,6 +54,7 @@ class MarkdownTextContent extends HookConsumerWidget {
|
||||
this.extraInlineSyntaxList = const [],
|
||||
this.extraBlockSyntaxList = const [],
|
||||
this.extraGenerators = const [],
|
||||
this.noMentionChip = false,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -224,7 +226,7 @@ class MarkdownTextContent extends HookConsumerWidget {
|
||||
isDark: isDark,
|
||||
linesMargin: linesMargin,
|
||||
generators: [
|
||||
mentionGenerator,
|
||||
if (!noMentionChip) mentionGenerator,
|
||||
highlightGenerator,
|
||||
spoilerGenerator,
|
||||
stickerGenerator,
|
||||
@@ -431,11 +433,13 @@ class MentionChipSpanNode extends SpanNode {
|
||||
fallbackIcon: Symbols.person_rounded,
|
||||
radius: 9,
|
||||
),
|
||||
error: (_, _) => const Icon(Symbols.close),
|
||||
error: (_, _) => const Icon(Symbols.close, size: 20),
|
||||
loading: () => const SizedBox(
|
||||
width: 9,
|
||||
height: 9,
|
||||
child: CircularProgressIndicator(),
|
||||
width: 20,
|
||||
height: 20,
|
||||
child: CircularProgressIndicator(
|
||||
padding: EdgeInsets.zero,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
@@ -449,11 +453,13 @@ class MentionChipSpanNode extends SpanNode {
|
||||
fallbackIcon: Symbols.design_services_rounded,
|
||||
radius: 9,
|
||||
),
|
||||
error: (_, _) => const Icon(Symbols.close),
|
||||
error: (_, _) => const Icon(Symbols.close, size: 20),
|
||||
loading: () => const SizedBox(
|
||||
width: 9,
|
||||
height: 9,
|
||||
child: CircularProgressIndicator(),
|
||||
width: 20,
|
||||
height: 20,
|
||||
child: CircularProgressIndicator(
|
||||
padding: EdgeInsets.zero,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
@@ -425,6 +425,7 @@ class PostItem extends HookConsumerWidget {
|
||||
content: translatedText.value!,
|
||||
isSelectable: isTextSelectable,
|
||||
attachments: item.attachments,
|
||||
noMentionChip: item.fediverseUri != null,
|
||||
),
|
||||
],
|
||||
)
|
||||
|
||||
@@ -205,6 +205,7 @@ class PostItemScreenshot extends ConsumerWidget {
|
||||
child: MarkdownTextContent(
|
||||
content: post.content!,
|
||||
attachments: post.attachments,
|
||||
noMentionChip: item.fediverseUri != null,
|
||||
).padding(top: 2),
|
||||
)
|
||||
else
|
||||
|
||||
@@ -199,6 +199,7 @@ class PostReplyPreview extends HookConsumerWidget {
|
||||
child: MarkdownTextContent(
|
||||
content: _convertContentToMarkdown(post),
|
||||
attachments: post.attachments,
|
||||
noMentionChip: post.fediverseUri != null,
|
||||
).padding(top: 2),
|
||||
)
|
||||
else
|
||||
@@ -607,6 +608,7 @@ class ReferencedPostWidget extends StatelessWidget {
|
||||
? const EdgeInsets.only(bottom: 4)
|
||||
: null,
|
||||
attachments: item.attachments,
|
||||
noMentionChip: item.fediverseUri != null,
|
||||
).padding(bottom: 4),
|
||||
if (referencePost.isTruncated)
|
||||
const PostTruncateHint(
|
||||
@@ -1070,6 +1072,7 @@ class PostBody extends ConsumerWidget {
|
||||
MarkdownTextContent(
|
||||
content: '${_convertContentToMarkdown(item)}...',
|
||||
attachments: item.attachments,
|
||||
noMentionChip: item.fediverseUri != null,
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -1109,6 +1112,7 @@ class PostBody extends ConsumerWidget {
|
||||
: _convertContentToMarkdown(item),
|
||||
isSelectable: isTextSelectable,
|
||||
attachments: item.attachments,
|
||||
noMentionChip: item.fediverseUri != null,
|
||||
),
|
||||
if (translationSection != null) translationSection!,
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user