I hope you make the horizontal size of code box answer in Chat GPT more bigger.
Hi and welcome to the community!
Take a look at the suggested solutions in this thread:
I think it’s like that so you can have have VSCode open on one side of the screen with the side menu folded in and ChatGPT on the other side with the history folded in and you can browse/scroll both code windows on one 1080p screen.
On a 1440p ultra-wide display, it is pitifully small even with 2 windows side by side. I don’t care about margins for the grey background. Give me more code block. Even if the window is the only thing open on my ultra-wide, the code block is absolutely tiny (requiring the scroll bar) which should not be a thing with auto detecting window sizes in HTML and CSS. The code block just needs a little bit of extra code to make it conform to window sizes instead of however they are doing it now. No reason to have margins or padding on it.
I run a pair of LG UW’s and I do exactly that, I fold in both sets of side panels and it’s perfect for my use case, however, I agree that perhaps a more reactive layout for those with wider displays would be a good idea.
I think this is what you are looking for:
TamperMonkey script
// ==UserScript==
// @name ChatGPT width
// @namespace http://tampermonkey.net/
// @version 0.5
// @description increase chat gpt box width
// @author bitmunja
// @license MIT
// @match https://chat.openai.com/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// ==/UserScript==
(function() {
'use strict';
// Convenience function to execute your callback only after an element matching readySelector has been added to the page.
// Example: runWhenReady('.search-result', augmentSearchResults);
// Gives up after 1 minute.
function runWhenReady(readySelector, callback) {
var numAttempts = 0;
var tryNow = function() {
var elem = document.querySelector(readySelector);
if (elem) {
callback(elem);
} else {
numAttempts++;
if (numAttempts >= 34) {
console.warn(`ChatGPT-width: giving up after 34 attempts. Could not find: ${readySelector}`);
} else {
setTimeout(tryNow, 250 * Math.pow(1.1, numAttempts));
}
}
};
tryNow();
}
function applyElementWidth() {
// console.debug(`ChatGPT-width: ready to process after content loaded...`);
function doWork() {
const elements = document.querySelectorAll('.text-base');
// console.debug(`ChatGPT-width: have ${elements.length} elements to process...`);
for (let i = 0; i < elements.length; i++) {
// console.debug(`ChatGPT-width: processing element: ${elements[i]}`);
elements[i].style.setProperty('max-width', '98%', 'important');
}
}
doWork();
const observer = new MutationObserver(function(mutations) {
let eventRegistrationCount = 0;
mutations.forEach(function(mutation) {
if (mutation.type === 'childList') {
eventRegistrationCount++;
}
});
if(eventRegistrationCount > 0) {
// console.debug('ChatGPT-width: mutation event, applying width adjustments...');
doWork();
}
});
// console.debug('ChatGPT-width: ready to observe mutations...');
observer.observe(document.documentElement, { childList: true, subtree: true });
};
// dynamic page events
runWhenReady('.text-base', applyElementWidth, false);
})();
Updated URL and works great. Thanks!