Skip to content

Conversation

@jbsession
Copy link
Owner

Part 3 of SES-4753

This PR updates how we can invite members to groups

  • Updated Batch invite from contacts screen
  • Updates the existing NewMessage composable to handle invite mode.
  • Allows invite via AccountID.
  • Adds UI for scanning QR codes to get account ID.

@jbsession jbsession self-assigned this Nov 14, 2025
inviteDialogVisible = manageGroupMembersViewModel.uiState.collectAsState().value.isInviteMemberDialogVisible
)

if (uiState.showUrlDialog) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can make this reusable by having showUrlDialog as a nullable string. If it is not null you show the dialog, and the url itself is the content of showUrlDialog. This way it can be used for more than one thing, and you don't need to have helpUrl in the state as it's not really a state element.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also there might be more dialogs in the future, so as rule we tend to encompass the content where it belongs. So maybe this dialog should exist inside InviteAccountIdScreen?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. I did move the dialog inside InviteAccountIdScreen since this screen has its own share of dialogs.

}

@Composable
fun ShowInviteContactsDialog(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think Composables should have the word 'Show' in their names since they are components.
Isn't this dialog the same as in the invite contact screen? Couldn't it be shared between them?

onHelp = { newMessageViewModel.onCommand(NewMessageViewModel.Commands.ShowUrlDialog) },
onSendInvite = {shareHistory ->
manageGroupMembersViewModel.onCommand(
ManageGroupMembersViewModel.Commands.SendInvites(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is SendInvites part of this viewmodel?
Shouldn't
val manageGroupMembersViewModel: ManageGroupMembersViewModel = hiltViewModel(parentEntry)
be removed here? And SendInvites be moved to the appropriate viewmodel?
Or is SendInvites used somewhere as well? I think the relationship between all those viewmodels need to be really clear and solid

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did it similar to how InviteContactsScreen sends the invite since it is the same with only a difference in how to get the Address. InviteContactsScreen does not use onCommand though, maybe I can update this one to make it uniform, or should I change it completely and add the same functions into InviteMembersViewModel?

) {
InviteAccountId(
state = state,
inviteState = viewModel.uiState.collectAsState().value.inviteContactsDialog,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hou shouldn't collectAsState in the declaration itself.
You should have something like:
val uiState by viewModel.uiState.collectAsState()
above, and then
inviteState = uiState.inviteContactsDialog,
to avoid unneeded calls to collectAsState

@jbsession jbsession merged commit a5434a1 into ses-4753/manage-members Dec 4, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants