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

feat: support for the new slack ui #425

Merged

Conversation

mcmxcdev
Copy link
Contributor

@mcmxcdev mcmxcdev commented Sep 23, 2023

Pre-flight Checklist

Please ensure you've completed all of the following.

Description of Change

  • update selector for team menu to work with new and old slack ui
  • bump slack recipe to v1.6.0

References ferdium/ferdium-app#1371

Screenshots

Slack service has the icon again:
Screenshot from 2023-09-23 09-29-10-obfuscated

@mcmxcdev mcmxcdev marked this pull request as ready for review September 23, 2023 15:35
@mcmxcdev mcmxcdev requested a review from a team September 23, 2023 15:35
Comment on lines +44 to +56
const oldSlackUiTeamMenu = document.querySelector(
'#team-menu-trigger, .p-ia__sidebar_header__team_name',
);
const newSlackUiTeamMenu = document.querySelector(
'.p-ia4_home_header_menu__button',
);

if (oldSlackUiTeamMenu || newSlackUiTeamMenu) {
if (oldSlackUiTeamMenu) {
oldSlackUiTeamMenu.click();
} else if (newSlackUiTeamMenu) {
newSlackUiTeamMenu.click();
}
Copy link
Member

Choose a reason for hiding this comment

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

Haven't tested it (I don't use slack). But instead of this, can't we use an array of strings on which we pass all the query selectors (old and new)? Given that the logic for both new and old just vary on the query selector?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure how that would look like, feel free to push a commit simplifying this!

I wasn't planning on keeping this code around for the long run and remove the old slack UI code in a couple of months.

Copy link
Member

Choose a reason for hiding this comment

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

Lets go with your fix and then change it in a couple of months (when the new UI sticks) 😄 Thank you!

- update selector for team menu to work with new and old slack ui
- bump slack recipe to v1.6.0
@SpecialAro SpecialAro force-pushed the feat/1371-support-for-the-new-slack-ui branch from f406bc0 to 63645c3 Compare September 25, 2023 22:29
@mcmxcdev mcmxcdev merged commit 9bfc14a into ferdium:main Sep 25, 2023
2 checks passed
@mcmxcdev mcmxcdev deleted the feat/1371-support-for-the-new-slack-ui branch September 25, 2023 22:56
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