ChatGPT icon indicating copy to clipboard operation
ChatGPT copied to clipboard

[Bug] Zoom In and Out no longer works.

Open adriandelgg opened this issue 9 months ago • 7 comments

Non-ChatGPT bug

  • [X] This issue does not occur on chat.openai.com and only occurs on this app.

Version

v1.1.0

Bug description

ChatGPT app works fine, but it no longer allows me to Zoom in and out. This is extremely annoying since the text is too small in it's default state.

I've tried removing every single file related to this application and reinstalling both the .deb and AppImage versions, and it still doesn't work. I even tried downloading v1.0.0 and it also doesn't work.

PLEASE FIX

OS

Debian 12

Environment

No response

adriandelgg avatar May 07 '24 13:05 adriandelgg

Same here.

zeroarst avatar May 11 '24 02:05 zeroarst

I have the same bug, i was wondering if it was only me or the app. Nothing works to zoom in.

einsof-creator avatar May 12 '24 00:05 einsof-creator

Hey @einsof-creator @zeroarst, I actually created a small fix to set the default zoom to any value you want!

Here are the instructions:

  1. Go to "Control Center"
  2. Click on "Scripts"
  3. Edit main.js
  4. Insert this code at the bottom of the main.js file (set the zoom amount to whatever value you want. Note that it has to be enclosed in single '' or double "" quotes). Make sure that it goes inside the last line, so you're going to be replacing the '150%' with a percentage value you want. If you want 150%, leave it as is.:
// zoomAmount must be a string percentage, e.g '150%'
function setDefaultZoom(zoomAmount) {
  const html = document.getElementsByTagName('html')[0];
  html.style.zoom = zoomAmount;
  window.localStorage.setItem('htmlZoom', zoomAmount);
}

setDefaultZoom('150%'); // <- Add your zoom amount in this line!
  1. Hit save and restart the app.

adriandelgg avatar May 12 '24 17:05 adriandelgg

Awesome, thank you. That worked.

einsof-creator avatar May 15 '24 14:05 einsof-creator

Potentially related to this bug - my slash commands (/) stopped working altogether.

Previously they would only work on a new chat after I refreshed the app. Now they don't work at all. Anyone have any idea how to fix this?

Culpable avatar May 17 '24 04:05 Culpable

In addition to https://github.com/lencx/ChatGPT/issues/1254#issuecomment-2106324256

I recommend the following, -- to widen the dialog -- remove the "left right padding" to give you more horizontal space.

setDefaultZoom('73%'); // <- Add your zoom amount in this line!

// document.addEventListener('DOMContentLoaded', function () {
setTimeout(function () {

  const style = document.createElement('style');
  // style.innerText = 'div.mx-auto.text-base.md\\:max-w-3xl { max-width: initial !important; }';
  document.head.appendChild(style);
  //   If the sheet property of a newly created style element is null, it's likely because the style element hasn't been added to the document yet.
  style.sheet.insertRule('div.mx-auto.text-base.md\\:max-w-3xl { max-width: initial !important; }', 0);

  // @: idk why need such long time wait, so that this can actualy be inserted // maybe author used .innerHtml to overwrite sth ...
}, 4000);

Norlandz avatar Jun 07 '24 16:06 Norlandz

Nice @Norlandz, that worked! I cleaned it up a bit with this code and it works still:

function expandChatWidth() {
  const styleElement = document.createElement('style');
  styleElement.textContent = `
    div.mx-auto.text-base.md\\:max-w-3xl {
      max-width: initial !important;
      padding: 0 1em;
    }
  `;
  document.head.appendChild(styleElement);
}

expandChatWidth();

adriandelgg avatar Jun 10 '24 02:06 adriandelgg