Qwen Chat: Wide Layout + Wider Scrollbar + Sticky Code Buttons

Removes max-width, stretches the chat, increases the scrollbar width, and makes the code copy buttons sticky.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

You will need to install an extension such as Tampermonkey to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         Qwen Chat: Wide Layout + Wider Scrollbar + Sticky Code Buttons
// @name:ru      Qwen Chat: Широкий макет + толстая прокрутка + липкие кнопки кода
// @namespace    http://tampermonkey.net/
// @version      1.0
// @author       a114_you
// @description     Removes max-width, stretches the chat, increases the scrollbar width, and makes the code copy buttons sticky.
// @description:ru  Убирает max-width, растягивает чат, увеличивает ширину полосы прокрутки и делает кнопки копирования кода липкими
// @match        https://chat.qwen.ai/*
// @grant        none
// @run-at       document-start
// @license MIT
// ==/UserScript==

(function(){
  'use strict';
  const css = `
    /* === 1. Убираем ограничения по ширине всей страницы === */
    html, body {
      width: 100vw !important;
      max-width: 100vw !important;
      overflow-x: hidden !important;
    }

    /* === 2. Отключаем автоматическое центрирование (mx-auto) === */
    .mx-auto {
      margin-left: 0 !important;
      margin-right: 0 !important;
    }

    /* === 3. Основная область чата: увеличиваем на всю ширину === */
    #chat-message-container,
    #chat-message-container > div,
    #messages-container {
      width: 100% !important;
      max-width: none !important; /* ← поставьте здесь нужное ограничение, например max-width:1400px */
    }

    /* === 4. Убираем боковые отступы у pane-контейнера === */
    [data-pane] {
      padding-left: 0 !important;
      padding-right: 0 !important;
    }

    /* === 5. «Прилипание» панели копирования/загрузки кода === */
    .copy.top-8 {
      position: sticky !important;
      top: 0 !important;
      background: inherit !important; /* не перекрывать фон */
      z-index: 10 !important;          /* поверх кода */
    }

    /* === 6. Скроллбар: Firefox === */
    #messages-container {
      scrollbar-width: auto !important; /* thin | auto | none */
      scrollbar-color: rgba(150,150,150,0.5) transparent !important;
    }
        /* === 7. Растягиваем поле ввода по всей ширине === */
//     .chat-message-input-textarea-container-pc,
//     .chat-message-input-container-inner,
//     #chat-input {
//       width: 100% !important;
//       max-width: none !important;
//     }

  `;
  const style = document.createElement('style');
  style.textContent = css;
  document.documentElement.appendChild(style);
})();