Skip to content
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

group previews: fix go to groups button #4206

Merged

Conversation

patosullivan
Copy link
Member

@patosullivan patosullivan commented Nov 20, 2024

fixes TLON-3007

This was happening because weren't passing an onGroupAction function to the GroupPreviewSheet from the user profile. onGroupAction was set as an optional prop, which seems like a mistake, so I made it not optional.

After setting it as not optional, I found that we were pulling the GroupPreviewSheet into ContentReference unnecessarily (rather than using some local state for control and rendering the sheet there, we can just use the GroupPreviewSheet that's already rendered in the Channel view and PostScreenView and use the existing onPressGroupRef method in the navigation context).

I also noticed that we were navigating users directly to the lastChannel of a group when going to a group, which seems like it might not be what users expect here, so instead I've got the goTo action setup to reset the navigation stack to the GroupChannelsScreen for that particular group.

I also added a new eslint rule to catch any instance where we're accidentally importing from packages/* and some lint scripts to the app package.

Copilot description:
This pull request includes several changes to enhance group action handling and improve code quality in the project. The most important changes include adding group action handling in ChatListScreen and UserProfileScreen, updating the group navigation logic, and introducing new linting scripts.

Enhancements to group action handling:

Updates to group navigation logic:

Code quality improvements:

These changes collectively improve the handling of group actions and ensure better code quality and maintainability.

Copy link

linear bot commented Nov 20, 2024

@patosullivan patosullivan force-pushed the po/tlon-3007-fix-go-to-group-button-in-preview-sheet branch from 7997f81 to a8fc485 Compare November 20, 2024 15:20
Copy link
Member

@latter-bolden latter-bolden left a comment

Choose a reason for hiding this comment

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

This is awesome!

I bumped into this on my contacts branch as well and implemented something similar. I think what you have here is more elegant, let's get it in.

@latter-bolden latter-bolden merged commit 77bc0fc into develop Nov 20, 2024
1 check passed
@latter-bolden latter-bolden deleted the po/tlon-3007-fix-go-to-group-button-in-preview-sheet branch November 20, 2024 15:34
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.

2 participants