ChatGPT icon indicating copy to clipboard operation
ChatGPT copied to clipboard

[Bug] The export button will dance 😭 (有图有真相)

Open h4rk8s opened this issue 2 years ago • 12 comments

Version

latest

Bug description

Snapshot 2023-03-03 at 16 37 33

OS

macOS 13.2.1 (22D68)

Environment

No response

h4rk8s avatar Mar 03 '23 08:03 h4rk8s

me too

akahello avatar Mar 03 '23 08:03 akahello

我也是

7rikka avatar Mar 03 '23 09:03 7rikka

me too

PengShaoLei97 avatar Mar 03 '23 09:03 PengShaoLei97

俺也一样

AjianNie avatar Mar 03 '23 10:03 AjianNie

Edition = Windows 11 Home Single Language Version = 22H2 Installed on = 16 ‎Feb ‎2023 OS build = 22621.1265 Experience = Windows Feature Experience Pack 1000.22638.1000.0 tes

jarvisab avatar Mar 03 '23 10:03 jarvisab

me too os : windows 11

ahmed951 avatar Mar 03 '23 12:03 ahmed951

If you just want to hide the other three buttons to stop the flashing open up your console and run the code below.

Keep in mind his is a super hacky way to solve this problem, but it will do until a proper fix is implemented.

// Select the buttons that you want to hide
const buttons = document.querySelectorAll('#download-markdown-button, #download-png-button, #download-pdf-button');

// Create a new MutationObserver
const observer = new MutationObserver(mutations => {
  mutations.forEach(mutation => {
    if (mutation.addedNodes) {
      mutation.addedNodes.forEach(node => {
        if (node.nodeType === Node.ELEMENT_NODE && node.matches('#download-markdown-button, #download-png-button, #download-pdf-button')) {
          node.style.display = 'none';
        }
      });
    }
  });
});

// Start observing the whole document for changes
observer.observe(document, { childList: true, subtree: true });

// Hide the buttons that are already in the document
buttons.forEach(button => button.style.display = 'none');

EDIT: Updated the code above to make the "fix" persist between change.

dimitri-vs avatar Mar 03 '23 13:03 dimitri-vs

the same bug os:win10

andyyx41 avatar Mar 03 '23 14:03 andyyx41

控制台输入[dimitri-vs]的代码,是有效的,就是每次打开都要输入一下,麻烦一点,希望作者尽快fix

46135413 avatar Mar 03 '23 14:03 46135413

same on Windows 10

biggujo avatar Mar 03 '23 14:03 biggujo

If you just want to hide the other three buttons to stop the flashing open up your console and run the code below.

Keep in mind his is a super hacky way to solve this problem, but it will do until a proper fix is implemented.

// Select the buttons that you want to hide
const buttons = document.querySelectorAll('#download-markdown-button, #download-png-button, #download-pdf-button');

// Create a new MutationObserver
const observer = new MutationObserver(mutations => {
  mutations.forEach(mutation => {
    if (mutation.addedNodes) {
      mutation.addedNodes.forEach(node => {
        if (node.nodeType === Node.ELEMENT_NODE && node.matches('#download-markdown-button, #download-png-button, #download-pdf-button')) {
          node.style.display = 'none';
        }
      });
    }
  });
});

// Start observing the whole document for changes
observer.observe(document, { childList: true, subtree: true });

// Hide the buttons that are already in the document
buttons.forEach(button => button.style.display = 'none');

EDIT: Updated the code above to make the "fix" persist between change.

This worked great as a stop-gap so I could continue using the app while we wait for a fix. Thank you!

MicrowaveJak avatar Mar 03 '23 15:03 MicrowaveJak

ref: #541

lencx avatar Mar 03 '23 15:03 lencx

https://github.com/lencx/ChatGPT/releases/tag/v0.11.1

RMatushkin avatar Mar 04 '23 08:03 RMatushkin

If you just want to hide the other three buttons to stop the flashing open up your console and run the code below. Keep in mind his is a super hacky way to solve this problem, but it will do until a proper fix is implemented.

// Select the buttons that you want to hide
const buttons = document.querySelectorAll('#download-markdown-button, #download-png-button, #download-pdf-button');

// Create a new MutationObserver
const observer = new MutationObserver(mutations => {
  mutations.forEach(mutation => {
    if (mutation.addedNodes) {
      mutation.addedNodes.forEach(node => {
        if (node.nodeType === Node.ELEMENT_NODE && node.matches('#download-markdown-button, #download-png-button, #download-pdf-button')) {
          node.style.display = 'none';
        }
      });
    }
  });
});

// Start observing the whole document for changes
observer.observe(document, { childList: true, subtree: true });

// Hide the buttons that are already in the document
buttons.forEach(button => button.style.display = 'none');

EDIT: Updated the code above to make the "fix" persist between change.

This worked great as a stop-gap so I could continue using the app while we wait for a fix. Thank you!

thanks @MicrowaveJak

h4rk8s avatar Mar 09 '23 03:03 h4rk8s