1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-19 13:19:39 +02:00

Fix AI sidebar overflow when user hasn't enabled or created a chat yet (#2044)
Some checks failed
Publish Docker image / ci (push) Has been cancelled
Publish Docker image / Build docker image (push) Has been cancelled

This commit is contained in:
Zach Gollwitzer 2025-04-01 14:36:34 -04:00 committed by GitHub
parent f2020a816a
commit 02bfa9f251
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 12 additions and 2 deletions

View file

@ -190,7 +190,8 @@ module ApplicationHelper
is_open: right_sidebar_showing, is_open: right_sidebar_showing,
initial_width: right_panel_width, initial_width: right_panel_width,
min_width: right_panel_min_width, min_width: right_panel_min_width,
max_width: right_panel_max_width max_width: right_panel_max_width,
overflow: right_sidebar_showing ? "auto" : "hidden"
}, },
content_max_width: content_max_width content_max_width: content_max_width
} }

View file

@ -30,6 +30,7 @@ export default class extends Controller {
this.contentTarget.style.maxWidth = `${this.#contentMaxWidth()}px`; this.contentTarget.style.maxWidth = `${this.#contentMaxWidth()}px`;
this.leftPanelTarget.style.width = `${this.#leftPanelWidth()}px`; this.leftPanelTarget.style.width = `${this.#leftPanelWidth()}px`;
this.rightPanelTarget.style.width = `${this.#rightPanelWidth()}px`; this.rightPanelTarget.style.width = `${this.#rightPanelWidth()}px`;
this.rightPanelTarget.style.overflow = this.#rightPanelOverflow();
} }
#leftPanelWidth() { #leftPanelWidth() {
@ -52,6 +53,14 @@ export default class extends Controller {
return 0; return 0;
} }
#rightPanelOverflow() {
if (this.rightPanelOpen) {
return "auto";
}
return "hidden";
}
#contentMaxWidth() { #contentMaxWidth() {
if (!this.leftPanelOpen && !this.rightPanelOpen) { if (!this.leftPanelOpen && !this.rightPanelOpen) {
return 1024; return 1024;

View file

@ -67,7 +67,7 @@
<%# AI chat sidebar %> <%# AI chat sidebar %>
<%= tag.div id: "chat-container", <%= tag.div id: "chat-container",
style: "width: #{sidebar_config.dig(:right_panel, :initial_width)}px", style: "width: #{sidebar_config.dig(:right_panel, :initial_width)}px; overflow: #{sidebar_config.dig(:right_panel, :overflow)}",
class: class_names("flex flex-col justify-between shrink-0 transition-all duration-300"), class: class_names("flex flex-col justify-between shrink-0 transition-all duration-300"),
data: { controller: "chat hotkey", sidebar_target: "rightPanel", turbo_permanent: true } do %> data: { controller: "chat hotkey", sidebar_target: "rightPanel", turbo_permanent: true } do %>