Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -777,9 +777,20 @@ body, .gradio-container {
|
|
| 777 |
background: var(--sand);
|
| 778 |
}
|
| 779 |
|
| 780 |
-
/* Kill Gradio chrome */
|
| 781 |
-
|
| 782 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 783 |
.gr-chatbot, [data-testid="chatbot"] {
|
| 784 |
flex: 1 !important; height: 100% !important;
|
| 785 |
border: none !important; border-radius: 0 !important; background: transparent !important;
|
|
@@ -801,34 +812,59 @@ footer { display: none !important; }
|
|
| 801 |
box-shadow: var(--sh) !important; color: var(--ink) !important;
|
| 802 |
}
|
| 803 |
|
| 804 |
-
/*
|
|
|
|
| 805 |
.chat-input-container {
|
| 806 |
-
background: var(--cream) !important;
|
| 807 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 808 |
}
|
| 809 |
.chat-input-container textarea {
|
| 810 |
-
background: var(--sand) !important;
|
| 811 |
-
border
|
|
|
|
|
|
|
| 812 |
font-size: .88rem !important; color: var(--ink) !important;
|
| 813 |
-
resize: none !important;
|
| 814 |
}
|
| 815 |
.chat-input-container textarea:focus {
|
| 816 |
-
|
| 817 |
-
box-shadow:
|
| 818 |
}
|
| 819 |
.chat-input-container textarea::placeholder { color: var(--muted2) !important; }
|
| 820 |
.chat-input-container button[aria-label="Send"] {
|
| 821 |
background: var(--sage) !important; color: #fff !important; border: none !important;
|
| 822 |
border-radius: 9px !important; padding: 0 13px !important; height: 36px !important;
|
| 823 |
-
font-weight: 600 !important; transition: background .15s !important;
|
|
|
|
| 824 |
}
|
| 825 |
.chat-input-container button[aria-label="Send"]:hover { background: var(--sage-d) !important; }
|
| 826 |
|
| 827 |
-
/*
|
| 828 |
.tb-bar {
|
| 829 |
display: flex; align-items: center; gap: 2px;
|
| 830 |
-
padding: 4px
|
| 831 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 832 |
}
|
| 833 |
.tb-btn {
|
| 834 |
width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
|
|
@@ -1016,6 +1052,26 @@ function showToast(msg) {
|
|
| 1016 |
setTimeout(tryInject, 600);
|
| 1017 |
}
|
| 1018 |
})();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1019 |
/* toolbar helpers */
|
| 1020 |
function tbWrap(tag1, tag2) {
|
| 1021 |
var t = document.querySelector('.chat-input-container textarea');
|
|
|
|
| 777 |
background: var(--sand);
|
| 778 |
}
|
| 779 |
|
| 780 |
+
/* Kill ALL Gradio chrome β chatbot label, panel borders, etc. */
|
| 781 |
+
/* Svelte hashes change between Gradio versions; target structurally instead */
|
| 782 |
+
[data-testid="chatbot"] > .label-wrap,
|
| 783 |
+
[data-testid="chatbot"] > div > .label-wrap,
|
| 784 |
+
[data-testid="chatbot"] label,
|
| 785 |
+
[data-testid="chatbot"] .label-wrap,
|
| 786 |
+
.chatbot-label,
|
| 787 |
+
.label-wrap span, /* hide text but let icon survive if any */
|
| 788 |
+
.gr-chatbot-container .label-wrap,
|
| 789 |
+
/* catch the actual rendered element seen in screenshot (β° Chatbot) */
|
| 790 |
+
.chatbot > .panel > .label,
|
| 791 |
+
div[class*="label"] > span:only-child,
|
| 792 |
+
.block > .label-wrap { display: none !important; }
|
| 793 |
+
/* Belt-and-braces: hide via JS after render too (see script below) */
|
| 794 |
.gr-chatbot, [data-testid="chatbot"] {
|
| 795 |
flex: 1 !important; height: 100% !important;
|
| 796 |
border: none !important; border-radius: 0 !important; background: transparent !important;
|
|
|
|
| 812 |
box-shadow: var(--sh) !important; color: var(--ink) !important;
|
| 813 |
}
|
| 814 |
|
| 815 |
+
/* ββ Merged input + toolbar box ββββββββββββββββββββββββββββββββ */
|
| 816 |
+
/* Wrap the Gradio input area + our toolbar inside one rounded border */
|
| 817 |
.chat-input-container {
|
| 818 |
+
background: var(--cream) !important;
|
| 819 |
+
border-top: 1px solid var(--stone) !important;
|
| 820 |
+
padding: 10px 12px 4px !important;
|
| 821 |
+
flex-shrink: 0;
|
| 822 |
+
}
|
| 823 |
+
/* The inner row Gradio renders: give it a rounded bordered card look */
|
| 824 |
+
.chat-input-container > .wrap,
|
| 825 |
+
.chat-input-container > div:first-child {
|
| 826 |
+
border: 1.5px solid var(--stone) !important;
|
| 827 |
+
border-radius: 12px 12px 0 0 !important;
|
| 828 |
+
overflow: hidden !important;
|
| 829 |
+
background: var(--sand) !important;
|
| 830 |
+
transition: border-color .18s, box-shadow .18s !important;
|
| 831 |
+
}
|
| 832 |
+
.chat-input-container > .wrap:focus-within,
|
| 833 |
+
.chat-input-container > div:first-child:focus-within {
|
| 834 |
+
border-color: var(--sage) !important;
|
| 835 |
+
box-shadow: 0 0 0 3px rgba(107,143,113,.14) !important;
|
| 836 |
}
|
| 837 |
.chat-input-container textarea {
|
| 838 |
+
background: var(--sand) !important;
|
| 839 |
+
border: none !important; /* border lives on parent now */
|
| 840 |
+
border-radius: 0 !important;
|
| 841 |
+
padding: 10px 13px !important;
|
| 842 |
font-size: .88rem !important; color: var(--ink) !important;
|
| 843 |
+
resize: none !important;
|
| 844 |
}
|
| 845 |
.chat-input-container textarea:focus {
|
| 846 |
+
outline: none !important;
|
| 847 |
+
box-shadow: none !important; /* parent handles focus ring */
|
| 848 |
}
|
| 849 |
.chat-input-container textarea::placeholder { color: var(--muted2) !important; }
|
| 850 |
.chat-input-container button[aria-label="Send"] {
|
| 851 |
background: var(--sage) !important; color: #fff !important; border: none !important;
|
| 852 |
border-radius: 9px !important; padding: 0 13px !important; height: 36px !important;
|
| 853 |
+
font-weight: 600 !important; transition: background .15s !important; margin: 0 6px 0 0 !important;
|
| 854 |
+
align-self: flex-end !important; margin-bottom: 6px !important;
|
| 855 |
}
|
| 856 |
.chat-input-container button[aria-label="Send"]:hover { background: var(--sage-d) !important; }
|
| 857 |
|
| 858 |
+
/* ββ Toolbar β sits flush below textarea, inside same border βββ */
|
| 859 |
.tb-bar {
|
| 860 |
display: flex; align-items: center; gap: 2px;
|
| 861 |
+
padding: 4px 10px 6px;
|
| 862 |
+
/* no border-top β it's inside the same card */
|
| 863 |
+
background: var(--sand);
|
| 864 |
+
border-top: 1px solid var(--stone);
|
| 865 |
+
border-radius: 0 0 12px 12px;
|
| 866 |
+
/* merge with the parent card */
|
| 867 |
+
margin: 0 -1px -1px -1px; /* bleed to parent border edges */
|
| 868 |
}
|
| 869 |
.tb-btn {
|
| 870 |
width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
|
|
|
|
| 1052 |
setTimeout(tryInject, 600);
|
| 1053 |
}
|
| 1054 |
})();
|
| 1055 |
+
/* Kill "Chatbot" label β JS fallback for Svelte-hashed classnames */
|
| 1056 |
+
function killChatbotLabel() {
|
| 1057 |
+
/* Find all elements whose visible text is exactly "Chatbot" and hide them */
|
| 1058 |
+
document.querySelectorAll('label, span, div').forEach(function(el) {
|
| 1059 |
+
if (el.children.length === 0 && el.textContent.trim() === 'Chatbot') {
|
| 1060 |
+
el.style.display = 'none';
|
| 1061 |
+
var wrap = el.closest('[class*="label"]');
|
| 1062 |
+
if (wrap) wrap.style.display = 'none';
|
| 1063 |
+
}
|
| 1064 |
+
});
|
| 1065 |
+
}
|
| 1066 |
+
/* Run on load + after any Gradio re-render */
|
| 1067 |
+
if (document.readyState === 'loading') {
|
| 1068 |
+
document.addEventListener('DOMContentLoaded', function(){ setTimeout(killChatbotLabel, 600); });
|
| 1069 |
+
} else {
|
| 1070 |
+
setTimeout(killChatbotLabel, 600);
|
| 1071 |
+
}
|
| 1072 |
+
var _kbLabelObserver = new MutationObserver(function(){ killChatbotLabel(); });
|
| 1073 |
+
_kbLabelObserver.observe(document.body, { childList: true, subtree: true });
|
| 1074 |
+
|
| 1075 |
/* toolbar helpers */
|
| 1076 |
function tbWrap(tag1, tag2) {
|
| 1077 |
var t = document.querySelector('.chat-input-container textarea');
|