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

Updates group functions to work better for small sizes #41

Merged
merged 8 commits into from
Jul 3, 2024

Conversation

jbeker
Copy link
Contributor

@jbeker jbeker commented Jul 3, 2024

I updated group_members and balance_groups to work better when there are less than 2 * MAX_GROUP_SIZE members.

I also updated the message for group invites to not say "both" which implies a pair of people.

@@ -76,7 +76,7 @@ def group_message(group:)
block_id: "group_introduction",
text: {
type: "mrkdwn",
text: ":wave: Hi #{group_usernames}! You've both been grouped up for a coffee chat from <##{ENV["GROUPS_CHANNEL"]}>! Find a time to meet and have fun!"
text: ":wave: Hi #{group_usernames}! You've been grouped up for a coffee chat from <##{ENV["GROUPS_CHANNEL"]}>! Find a time to meet and have fun!"
Copy link
Owner

Choose a reason for hiding this comment

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

good catch!

@jmkoni
Copy link
Owner

jmkoni commented Jul 3, 2024

Well at least I wrote some tests... but they are a bit brittle!

       Diff:
       @@ -1,7 +1,7 @@
       [{:block_id=>"group_introduction",
         :text=>
           {:text=>
       -     ":wave: Hi <@123>, <@456>, and <@789>! You've both been grouped up for a coffee chat from <#C123>! Find a time to meet and have fun!",
       +     ":wave: Hi <@123>, <@456>, and <@789>! You've been grouped up for a coffee chat from <#C123>! Find a time to meet and have fun!",
           :type=>"mrkdwn"},
          :type=>"section"}]
# ./spec/models/slack_message_spec.rb:35:in `block (2 levels) in <top (required)>'
     ```

@jmkoni jmkoni merged commit 31fb575 into jmkoni:main Jul 3, 2024
2 of 3 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.

None yet

2 participants