-
-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Chat-NG]: Room messages UI implementation #2388
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2388 +/- ##
==========================================
- Coverage 27.42% 27.26% -0.17%
==========================================
Files 635 645 +10
Lines 43061 43480 +419
==========================================
+ Hits 11808 11853 +45
- Misses 31253 31627 +374
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
app/lib/features/chat_ng/providers/chat_room_messages_provider.dart
Outdated
Show resolved
Hide resolved
case 'm.room.message': | ||
return _buildMsgEventItem(roomId, messageId, item, isUser, showAvatar); | ||
case 'm.room.redaction': | ||
return ChatBubble( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the new UI wrapper implemented for message events inner content. Rest of the implementation is same and copied from old chat widgets.
import 'package:flutter_riverpod/flutter_riverpod.dart'; | ||
import 'package:phosphor_flutter/phosphor_flutter.dart'; | ||
|
||
class ImageMessageEvent extends ConsumerWidget { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The inner implementation is same except that we now access MsgContent
and identifiers directly instead of old types.Message
import 'package:flutter_riverpod/flutter_riverpod.dart'; | ||
import 'package:path/path.dart' as p; | ||
|
||
class FileMessageEvent extends ConsumerWidget { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as explained in ImageMessageEvent
comment.
import 'package:flutter_gen/gen_l10n/l10n.dart'; | ||
import 'package:flutter_riverpod/flutter_riverpod.dart'; | ||
|
||
class VideoMessageEvent extends ConsumerWidget { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as explained in ImageMessageEvent
file comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some minor structural things
'm.room.encrypted', | ||
'm.policy.rule.room', | ||
'm.policy.rule.server', | ||
'm.policy.rule.user', | ||
'm.room.aliases', | ||
'm.room.avatar', | ||
'm.room.canonical_alias', | ||
'm.room.create', | ||
'm.room.encryption', | ||
'm.room.guest.access', | ||
'm.room.history_visibility', | ||
'm.room.join.rules', | ||
'm.room.name', | ||
'm.room.pinned_events', | ||
'm.room.power_levels', | ||
'm.room.server_acl', | ||
'm.room.third_party_invite', | ||
'm.room.tombstone', | ||
'm.room.topic', | ||
'm.space.child', | ||
'm.space.parent', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather we don't add them here until we have a proper support. Like showing a "has changed the topic to XYZ" ... Let's not do the same mistake of just doing brush-of-a-stroke not-really-thought-through rendering please ... rather keep them off screen until we have decent support...
shouldShowAvatarProvider
and copied image message test from older chat version to chat-ng version with updated objects.Simple previews of messages list with UI:
Mobile:
Screen.Recording.2024-12-04.at.17.02.42.mov
Desktop
Screen.Recording.2024-12-04.at.17.10.07.mov