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

Update: Slack: Adding more info to Slack Open Channel command #13343

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

RobErskine
Copy link
Contributor

@RobErskine RobErskine commented Jul 5, 2024

Description

Hi there! I updated the Slack Search Command to pull more data from Slack, like the user's Title (if it exists), their current status in Slack, when they will be back, their timezone location, as well as their current local time.

Current Search Command UI

Arc-_2024-07-05 at 17 07@2x

New Search Command UI

Arc-_2024-07-05 at 17 12@2x

Screencast

Code-search.tsx.slack_2024-07-05.at.16.49.mp4

Bonus

Adds Emojify to Unread Messages as well to help make messages with emojis more readable:
Code-unread-messages tsx — slack_2024-07-05 at 17 20@2x

Checklist

@raycastbot
Copy link
Collaborator

raycastbot commented Jul 5, 2024

Thank you for your contribution! 🎉

🔔 @momme-rtf @Elliot67 @jfkisafk @thomaslombart you might want to have a look.

You can use this guide to learn how to check out the Pull Request locally in order to test it.

We're currently experiencing high demand and limited capacity. As a result, extension reviews might take longer than usual to get the initial review. Please expect an initial review within 5-10 business days.

@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: slack Issues related to the slack extension labels Jul 5, 2024
@momme-rtf
Copy link
Contributor

Hi @RobErskine
Thanks for your contribution! I like your change for displaying the emojis properly.
Regarding the search: I personally like to have the list more focused and less overloaded with infos. Especially when working within a small team I rather do not care about titles and locations of team members. Within a bigger company I see that it can be helpful. Maybe we could make it configurable somehow what we show. But I'd also like to hear the opinion of other contributers. What do you think?

@RobErskine
Copy link
Contributor Author

RobErskine commented Jul 6, 2024

Hi @momme-rtf, thanks for your thoughts. I can see your point about keeping it uncluttered. Personally my org on Slack is over 700 people all over the world, so looking people up and understanding where they are and what time it is for them is crazy useful for me.

I do like your suggestion of adding in a Preference for this though to keep this simple for folks that like the way it is currently. I was already thinking in the shower that I should probably add in a preference for how the time should be displayed (am/pm or 24 hour).

How about this:

  • Add in a Preference for whether to show time in am/pm or 24 hour
  • Add in a Preference on whether or not to show the Timezone / current time for that team member
  • I think it's useful to show the Slack status emoji, the message, and when the status expires. Do you think that would be a good addition to keep in, without a Preference to toggle on/off?

Copy link
Contributor

@jfkisafk jfkisafk left a comment

Choose a reason for hiding this comment

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

LGTM other than the broader conversation we are having around preferences.

extensions/slack/package.json Outdated Show resolved Hide resolved
extensions/slack/src/search.tsx Outdated Show resolved Hide resolved
extensions/slack/CHANGELOG.md Outdated Show resolved Hide resolved
extensions/slack/package.json Show resolved Hide resolved
@RobErskine
Copy link
Contributor Author

👋🏼 hey @jfkisafk @momme-rtf,

I went ahead and added two additional preferences to the extension for Time Format as well as Displaying Additional Metadata in the Search Command:
Raycast-Settings_2024-07-07 at 14 28@2x

I also added in HH:MM to the Slack Status Tooltip so if someone is grabbing lunch, or at a doctor's appt on the same day, the return time will be displayed. This screenshot also has the "Show Extra Metadata" option turned off (which is the default).
Raycast-Settings_2024-07-07 at 14 29@2x

Here is what it looks like with the extra metadata turned on, as well as the 24 hour time format.
Arc-_2024-07-07 at 14 43@2x

Let me know if you have any other feedback!

@momme-rtf
Copy link
Contributor

Awesome @RobErskine
The preferences that you've added look good to me :)

Copy link
Contributor

@jfkisafk jfkisafk left a comment

Choose a reason for hiding this comment

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

Minor comments but lgtm 🚀

extensions/slack/src/shared/client/WebClient.ts Outdated Show resolved Hide resolved
extensions/slack/package.json Outdated Show resolved Hide resolved
extensions/slack/src/search.tsx Outdated Show resolved Hide resolved
extensions/slack/src/search.tsx Outdated Show resolved Hide resolved
RobErskine and others added 2 commits July 7, 2024 20:31
Co-authored-by: stelo <42366677+jfkisafk@users.noreply.github.com>
Copy link
Contributor

@jfkisafk jfkisafk left a comment

Choose a reason for hiding this comment

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

Minor suggested changes for type casting the preferences from raycast-env.d.ts, but not required. Ty for this awsum addition 🫶


const { displayExtraMetadata } = getPreferenceValues<Preferences>();
const { displayExtraMetadata } = getPreferenceValues();
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const { displayExtraMetadata } = getPreferenceValues();
const { displayExtraMetadata } = getPreferenceValues<Preferences.Search>();


function getTimeLocale(): string {
const timeFormat = getPreferenceValues<Preferences>().timeFormat;
const timeFormat = getPreferenceValues().timeFormat;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const timeFormat = getPreferenceValues().timeFormat;
const timeFormat = getPreferenceValues<Preferences>().timeFormat;

@jfkisafk
Copy link
Contributor

jfkisafk commented Jul 8, 2024

Please rebase on top of #13039 and see if everything works as before? This will add a new command and the previous Search command name has changed.

…aycast-extensions into feature/slack-search-update

# Conflicts:
#	extensions/slack/CHANGELOG.md
#	extensions/slack/package.json
#	extensions/slack/src/search.tsx
#	extensions/slack/src/shared/client/SlackClient.ts
#	extensions/slack/src/shared/utils.ts
#	extensions/slack/src/unread-messages.tsx
@RobErskine
Copy link
Contributor Author

RobErskine commented Jul 8, 2024

👋🏼 hi there.

This is pretty poor (or good?) timing on my end but I was working on an update to the Search Open Channel command just as @thomaslombart published the latest Slack extension updates.

This PR adds Metadata to the Open Channel command to show Slack member's job title, current status, timezone, as well as their current time. Also added in the option to display time in AM/PM or 24 hour time.

With the Metadata set to false (this is the default to keep functionality as close to what it is now):
Arc-_2024-07-08 at 12 34@2x

With the Metadata turned on (with 24 hour time):
Arc-_2024-07-07 at 14 43@2x

@RobErskine RobErskine changed the title Update: Slack: Adding more info to Slack Search Update: Slack: Adding more info to Slack Open Channel command Jul 8, 2024
@thomaslombart thomaslombart self-assigned this Jul 11, 2024
@thomaslombart
Copy link
Collaborator

Hey Rob, I'll review the PR next week 🙂

@thomaslombart
Copy link
Collaborator

It seems other extension changes have slipped in while merging/rebasing. Could you fix it before I review your PR? 🙂

@RobErskine
Copy link
Contributor Author

@thomaslombart sorry about that; not sure how that happened while I was rebasing. I have merged main back in and all looks correct now. Mind giving it a look now?

extensions/slack/src/shared/utils.ts Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension fix / improvement Label for PRs with extension's fix improvements extension: slack Issues related to the slack extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants