Skip to content

Agent Zero AI framework

chat-width settings in prefs

3clyp508d01a9c58d5f
diff --git a/webui/components/messages/process-group/process-group.css b/webui/components/messages/process-group/process-group.css
index bf305bf42..ca8e27a1a 100644
--- a/webui/components/messages/process-group/process-group.css
+++ b/webui/components/messages/process-group/process-group.css
@@ -358,10 +358,6 @@
transition: background-color 0.15s ease;
}
-.step-expanded {
- padding: var(--spacing-xs) 0;
-}
-
/* Utility/Info/Hint steps have subtle background tint */
.process-step[data-type="util"],
.process-step[data-type="info"],
diff --git a/webui/components/sidebar/bottom/preferences/preferences-panel.html b/webui/components/sidebar/bottom/preferences/preferences-panel.html
index 4e98370d2..f54626c28 100644
--- a/webui/components/sidebar/bottom/preferences/preferences-panel.html
+++ b/webui/components/sidebar/bottom/preferences/preferences-panel.html
@@ -41,6 +41,21 @@
<span class="slider"></span>
</label>
</li>
+ <li x-data class="chat-width-setting">
+ <span class="width-label">Width</span>
+ <div class="width-buttons">
+ <template x-for="(opt, idx) in $store.preferences.chatWidthOptions" :key="opt.value">
+ <span class="width-btn-wrapper">
+ <button type="button"
+ class="width-btn"
+ :class="{ 'active': $store.preferences.chatWidth === opt.value }"
+ @click="$store.preferences.chatWidth = opt.value"
+ x-text="opt.label"></button>
+ <span class="width-sep" x-show="idx < $store.preferences.chatWidthOptions.length - 1">·</span>
+ </span>
+ </template>
+ </div>
+ </li>
</ul>
</span>
</div>
@@ -87,6 +102,48 @@
margin-left: auto;
}
.pref-section li { display: flex; align-items: center; }
+
+ /* Chat width button bar */
+ .chat-width-setting {
+ gap: 0.25rem;
+ }
+ .chat-width-setting .width-label {
+ flex: 1;
+ }
+ .width-buttons {
+ display: flex;
+ align-items: center;
+ gap: 0;
+ }
+ .width-btn-wrapper {
+ display: flex;
+ align-items: center;
+ }
+ .width-btn {
+ background: none;
+ border: none;
+ color: var(--color-primary);
+ font-size: 0.7rem;
+ font-weight: 500;
+ letter-spacing: 0.02em;
+ padding: 0.15rem 0.25rem;
+ cursor: pointer;
+ opacity: 0.7;
+ transition: opacity 0.15s ease, color 0.15s ease;
+ }
+ .width-btn:hover {
+ opacity: 0.85;
+ }
+ .width-btn.active {
+ opacity: 1;
+ color: var(--color-text);
+ }
+ .width-sep {
+ color: var(--color-text-secondary, #666);
+ font-size: 0.6rem;
+ margin: 0 0.1rem;
+ opacity: 0.5;
+ }
</style>
</body>
</html>
diff --git a/webui/components/sidebar/bottom/preferences/preferences-store.js b/webui/components/sidebar/bottom/preferences/preferences-store.js
index e75e43e16..a11d7269a 100644
--- a/webui/components/sidebar/bottom/preferences/preferences-store.js
+++ b/webui/components/sidebar/bottom/preferences/preferences-store.js
@@ -51,6 +51,23 @@ const model = {
},
_collapseProcessGroups: true, // Default to collapsed
+ // Chat container width preference for HiDPI/large screens
+ get chatWidth() {
+ return this._chatWidth;
+ },
+ set chatWidth(value) {
+ this._chatWidth = value;
+ this._applyChatWidth(value);
+ },
+ _chatWidth: "55", // Default width in em (standard)
+
+ // Width presets: { label, value in em }
+ chatWidthOptions: [
+ { label: "STD", value: "55" },
+ { label: "X-WIDE", value: "90" },
+ { label: "FULL", value: "full" },
+ ],
+
// Initialize preferences and apply current state
init() {
try {
@@ -77,12 +94,23 @@ const model = {
this._collapseProcessGroups = true;
}
+ // Load chat width preference
+ try {
+ const storedChatWidth = localStorage.getItem("chatWidth");
+ if (storedChatWidth && this.chatWidthOptions.some(opt => opt.value === storedChatWidth)) {
+ this._chatWidth = storedChatWidth;
+ }
+ } catch {
+ this._chatWidth = "55"; // Default to standard
+ }
+
// Apply all preferences
this._applyDarkMode(this._darkMode);
this._applyAutoScroll(this._autoScroll);
this._applySpeech(this._speech);
this._applyShowUtils(this._showUtils);
this._applyCollapseProcessGroups(this._collapseProcessGroups);
+ this._applyChatWidth(this._chatWidth);
} catch (e) {
console.error("Failed to initialize preferences store", e);
}
@@ -134,6 +162,17 @@ const model = {
// Store may not be initialized yet
}
},
+
+ _applyChatWidth(value) {
+ localStorage.setItem("chatWidth", value);
+ // Set CSS custom property for chat max-width
+ const root = document.documentElement;
+ if (value === "full") {
+ root.style.setProperty("--chat-max-width", "100%");
+ } else {
+ root.style.setProperty("--chat-max-width", `${value}em`);
+ }
+ },
};
export const store = createStore("preferences", model);
diff --git a/webui/css/messages.css b/webui/css/messages.css
index 21ef80afd..3ea402995 100644
--- a/webui/css/messages.css
+++ b/webui/css/messages.css
@@ -449,17 +449,11 @@
}
/* Media Queries */
-@media (min-width: 55em) {
+/* Chat width controlled by --chat-max-width CSS variable (set via preferences, default 55em) */
+@media (min-width: 1025px) {
#chat-history {
- padding-left: max(var(--spacing-sm), calc((100% - 55em) / 2)) !important;
- padding-right: max(var(--spacing-sm), calc((100% - 55em) / 2)) !important;
- }
-}
-
-@media (min-width: 1025px) and (max-width: 55em) {
- #chat-history {
- padding-left: var(--spacing-sm) !important;
- padding-right: var(--spacing-sm) !important;
+ padding-left: max(var(--spacing-sm), calc((100% - var(--chat-max-width, 55em)) / 2)) !important;
+ padding-right: max(var(--spacing-sm), calc((100% - var(--chat-max-width, 55em)) / 2)) !important;
}
}