From db2737d3091aaa52627dcf9cc13738d7789fee8d Mon Sep 17 00:00:00 2001 From: Tadashi Date: Mon, 18 Nov 2024 16:45:08 +0700 Subject: [PATCH] fix: relocate information panel expand button bump:patch --- libs/ktem/ktem/assets/css/main.css | 11 ++++++++--- libs/ktem/ktem/assets/js/main.js | 5 +++++ libs/ktem/ktem/pages/chat/__init__.py | 6 ++++-- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/libs/ktem/ktem/assets/css/main.css b/libs/ktem/ktem/assets/css/main.css index 97cc89057..1abf36e8b 100644 --- a/libs/ktem/ktem/assets/css/main.css +++ b/libs/ktem/ktem/assets/css/main.css @@ -95,6 +95,7 @@ button.selected { flex-wrap: unset; overflow-y: scroll !important; position: sticky; + min-width: min(305px, 100%) !important; } .setting-answer-mode-description { @@ -160,13 +161,13 @@ mark { #toggle-dark-button { position: fixed; top: 6px; - right: 60px; + right: 30px; } #info-expand-button { - position: fixed; + position: absolute; top: 6px; - right: 85px; + right: 15px; } #new-conv-button > img { @@ -175,6 +176,10 @@ mark { right: -50%; } +span.icon { + color: #cecece; +} + .upload-button { display: none; } diff --git a/libs/ktem/ktem/assets/js/main.js b/libs/ktem/ktem/assets/js/main.js index a441b8a34..4dbb36fbb 100644 --- a/libs/ktem/ktem/assets/js/main.js +++ b/libs/ktem/ktem/assets/js/main.js @@ -11,6 +11,11 @@ function run() { version_node.style = "position: fixed; top: 10px; right: 10px;"; main_parent.appendChild(version_node); + // move info-expand-button + let info_expand_button = document.getElementById("info-expand-button"); + let chat_info_panel = document.getElementById("info-expand"); + chat_info_panel.insertBefore(info_expand_button, chat_info_panel.childNodes[2]); + // clpse globalThis.clpseFn = (id) => { var obj = document.getElementById('clpse-btn-' + id); diff --git a/libs/ktem/ktem/pages/chat/__init__.py b/libs/ktem/ktem/pages/chat/__init__.py index 02b0819dc..571c8102b 100644 --- a/libs/ktem/ktem/pages/chat/__init__.py +++ b/libs/ktem/ktem/pages/chat/__init__.py @@ -29,7 +29,7 @@ from .report import ReportIssue DEFAULT_SETTING = "(default)" -INFO_PANEL_SCALES = {True: 8, False: 4} +INFO_PANEL_SCALES = {True: 8, False: 5} pdfview_js = """ @@ -169,7 +169,9 @@ def on_building_ui(self): with gr.Column( scale=INFO_PANEL_SCALES[False], elem_id="chat-info-panel" ) as self.info_column: - with gr.Accordion(label="Information panel", open=True): + with gr.Accordion( + label="Information panel", open=True, elem_id="info-expand" + ): self.modal = gr.HTML("
") self.plot_panel = gr.Plot(visible=False) self.info_panel = gr.HTML(elem_id="html-info-panel")