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

Fix Menu Button Visibility #252

Closed

Conversation

danielhamelberg
Copy link

@danielhamelberg danielhamelberg commented Sep 2, 2024

This pull request fixes the issue of the main menu button disappearing since ChatGPT moved the profile button to a new location. This PR implements a robust solution for relocating the menu button to the profile button div.

Changes Made:

  • Main Menu Button Placement: The export menu button now resides as the first child of the profile button div. This visually groups it with the profile button.
  • Optimized Injection: The injectMenu() function utilizes setInterval to actively check if the menu button already exists in the profile button div. If not, it injects it. The setInterval loop is immediately stopped after successful injection to minimize unnecessary checks and improve performance.
  • Minor Aesthetic Optimizations: Since the menu button now shares a container with the profile button, the extra border and divider line have been removed for a cleaner look.

Testing:

  1. Tested these changes in MS Edge by updating the userscript manually.
  2. Performed a hard refresh (Ctrl+Shift+R or Cmd+Shift+R) on ChatGPT to clear the cache and ensure a clean reload.
  3. Confirmed the export menu button consistently appears next to the share chat and profile button in the header.

Benefits:

  • Improved Visibility: The menu button is visible again after ChatGPT moved the profile button.
  • Improved Performance: The optimized injection logic, including the setInterval termination, reduces unnecessary DOM manipulation for better performance.

Screenshot:
image

Closing Issues
This PR closes issue #251.

@pionxzh
Copy link
Owner

pionxzh commented Sep 2, 2024

Do you still have the team workspace button on the left side? If so, I would still prefer to put the menu there.

@SzVLsY
Copy link

SzVLsY commented Sep 3, 2024

Do you still have the team workspace button on the left side? If so, I would still prefer to put the menu there.

the team workspace button is still on the left side. The improvement moves the export button to the top right, alongside the profile and share buttons. This does solve the issue of the menu disappearing caused by some extensions. I noticed that enabling certain scripts can still cause the menu to disappear, but it’s not a major problem.

@pionxzh
Copy link
Owner

pionxzh commented Sep 3, 2024

Thanks for the contribution. But I still want to keep it in the same place. We can work on fixing the disappearing issue. I will merge the PR if we can't find or fix the problem.

@SzVLsY
Copy link

SzVLsY commented Sep 5, 2024

Thanks for the contribution. But I still want to keep it in the same place. We can work on fixing the disappearing issue. I will merge the PR if we can't find or fix the problem.

Update:
The menu disappeared again today. I’m not sure what happened, but the only thing I’m certain of is that it conflicts with some scripts or extensions—sometimes with extensions, sometimes with scripts. The most challenging part is that it doesn’t conflict with any specific extension or script.

@danielhamelberg
Copy link
Author

danielhamelberg commented Sep 8, 2024 via email

@danielhamelberg
Copy link
Author

Latest version restores the menu button visibillity provided that another user script doesn't break it.

@danielhamelberg danielhamelberg deleted the menu-button-visibility branch September 8, 2024 17:22
@pionxzh pionxzh mentioned this pull request Sep 8, 2024
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