Skip to content

Commit 75dd103

Browse files
authored
add additional configuration options (#2980)
1 parent aafcf7a commit 75dd103

File tree

10 files changed

+63
-21
lines changed

10 files changed

+63
-21
lines changed

web/src/app/chat/ChatPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2512,7 +2512,7 @@ export function ChatPage({
25122512
)}
25132513
</div>
25142514
</div>
2515-
<FixedLogo />
2515+
<FixedLogo chat />
25162516
</div>
25172517
</div>
25182518
<DocumentSidebar

web/src/app/chat/sessionSidebar/ChatSessionDisplay.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export function ChatSessionDisplay({
122122
);
123123
}}
124124
>
125-
<BasicSelectable padding="extra" fullWidth selected={isSelected}>
125+
<BasicSelectable chat padding="extra" fullWidth selected={isSelected}>
126126
<>
127127
<div className="flex relative">
128128
{isRenamingChat ? (
@@ -142,7 +142,11 @@ export function ChatSessionDisplay({
142142
{chatName || `Chat ${chatSession.id}`}
143143
<span
144144
className={`absolute right-0 top-0 h-full w-8 bg-gradient-to-r from-transparent
145-
${isSelected ? "to-background-200" : " to-background-100 group-hover:to-background-200"} `}
145+
${
146+
isSelected
147+
? "to-background-chat-hover"
148+
: " to-background-chat-selected group-hover:to-background-chat-hover"
149+
} `}
146150
/>
147151
</p>
148152
)}
@@ -176,7 +180,9 @@ export function ChatSessionDisplay({
176180
This chat will expire{" "}
177181
{daysUntilExpiration < 1
178182
? "today"
179-
: `in ${daysUntilExpiration} day${daysUntilExpiration !== 1 ? "s" : ""}`}
183+
: `in ${daysUntilExpiration} day${
184+
daysUntilExpiration !== 1 ? "s" : ""
185+
}`}
180186
</p>
181187
}
182188
>

web/src/app/chat/sessionSidebar/HistorySidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export const HistorySidebar = forwardRef<HTMLDivElement, HistorySidebarProps>(
9494
bg-background-sidebar
9595
w-full
9696
border-r
97-
border-border
97+
border-sidebar-border
9898
flex
9999
flex-col relative
100100
h-screen

web/src/app/chat/shared_chat_search/FixedLogo.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Link from "next/link";
88
import { useContext } from "react";
99
import { FiSidebar } from "react-icons/fi";
1010

11-
export default function FixedLogo() {
11+
export default function FixedLogo({ chat }: { chat?: boolean }) {
1212
const combinedSettings = useContext(SettingsContext);
1313
const settings = combinedSettings?.settings;
1414
const enterpriseSettings = combinedSettings?.enterpriseSettings;
@@ -28,13 +28,15 @@ export default function FixedLogo() {
2828
<div className="w-full">
2929
{enterpriseSettings && enterpriseSettings.application_name ? (
3030
<div>
31-
<HeaderTitle>{enterpriseSettings.application_name}</HeaderTitle>
31+
<HeaderTitle chat={chat}>
32+
{enterpriseSettings.application_name}
33+
</HeaderTitle>
3234
{!NEXT_PUBLIC_DO_NOT_USE_TOGGLE_OFF_DANSWER_POWERED && (
3335
<p className="text-xs text-subtle">Powered by Danswer</p>
3436
)}
3537
</div>
3638
) : (
37-
<HeaderTitle>Danswer</HeaderTitle>
39+
<HeaderTitle chat={chat}>Danswer</HeaderTitle>
3840
)}
3941
</div>
4042
</div>

web/src/app/chat/shared_chat_search/FunctionalWrapper.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const ToggleSwitch = () => {
3636
};
3737

3838
return (
39-
<div className="bg-gray-100 mobile:mt-8 flex rounded-full p-1">
39+
<div className="bg-background-toggle mobile:mt-8 flex rounded-full p-1">
4040
<div
4141
className={`absolute mobile:mt-8 top-1 bottom-1 ${
4242
activeTab === "chat" ? "w-[45%]" : "w-[50%]"
@@ -148,7 +148,9 @@ export default function FunctionalWrapper({
148148
{(!settings ||
149149
(settings.search_page_enabled && settings.chat_page_enabled)) && (
150150
<div
151-
className={`mobile:hidden z-30 flex fixed ${chatBannerPresent ? (twoLines ? "top-20" : "top-14") : "top-4"} left-1/2 transform -translate-x-1/2`}
151+
className={`mobile:hidden z-30 flex fixed ${
152+
chatBannerPresent ? (twoLines ? "top-20" : "top-14") : "top-4"
153+
} left-1/2 transform -translate-x-1/2`}
152154
>
153155
<div
154156
style={{ transition: "width 0.30s ease-out" }}

web/src/components/BasicClickable.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,14 @@ export function BasicSelectable({
8181
children,
8282
selected,
8383
hasBorder,
84+
chat,
8485
fullWidth = false,
8586
padding = "normal",
8687
}: {
8788
children: string | JSX.Element;
8889
selected: boolean;
8990
hasBorder?: boolean;
91+
chat?: boolean;
9092
fullWidth?: boolean;
9193
padding?: "none" | "normal" | "extra";
9294
}) {
@@ -100,7 +102,15 @@ export function BasicSelectable({
100102
${padding == "extra" && "p-1.5"}
101103
select-none
102104
${hasBorder ? "border border-border" : ""}
103-
${selected ? "bg-hover" : "hover:bg-hover"}
105+
${
106+
selected
107+
? chat
108+
? "bg-background-chat-selected"
109+
: "bg-hover"
110+
: chat
111+
? "bg-background-chat-hover"
112+
: "hover:bg-hover"
113+
}
104114
${fullWidth ? "w-full" : ""}`}
105115
>
106116
{children}

web/src/components/header/HeaderTitle.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,21 @@
22

33
import React from "react";
44

5-
export function HeaderTitle({ children }: { children: JSX.Element | string }) {
5+
export function HeaderTitle({
6+
children,
7+
chat,
8+
}: {
9+
children: JSX.Element | string;
10+
chat?: boolean;
11+
}) {
612
const isString = typeof children === "string";
713
const textSize = isString && children.length > 10 ? "text-xl" : "text-2xl";
814

915
return (
1016
<h1
11-
className={`${textSize} break-words line-clamp-2 ellipsis text-strong leading-none font-bold`}
17+
className={`${textSize} ${
18+
chat ? "text-text-sidebar-header" : "text-text-header"
19+
} break-words line-clamp-2 ellipsis text-strong leading-none font-bold`}
1220
>
1321
{children}
1422
</h1>

web/src/components/search/SearchAnswer.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ export default function SearchAnswer({
7070
return (
7171
<div
7272
ref={answerContainerRef}
73-
className={`my-4 ${searchAnswerExpanded ? "min-h-[16rem]" : "h-[16rem]"} ${!searchAnswerExpanded && searchAnswerOverflowing && "overflow-y-hidden"} p-4 border-2 border-border rounded-lg relative`}
73+
className={`my-4 ${
74+
searchAnswerExpanded ? "min-h-[16rem]" : "h-[16rem]"
75+
} ${
76+
!searchAnswerExpanded && searchAnswerOverflowing && "overflow-y-hidden"
77+
} p-4 border-2 border-search-answer-border rounded-lg relative`}
7478
>
7579
<div>
7680
<div className="flex gap-x-2">

web/src/components/search/SearchBar.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ export const AnimatedToggle = ({
6868
{/* Toggle switch */}
6969
<div
7070
className={`
71-
w-10 h-6 flex items-center rounded-full p-1 transition-all duration-300 ease-in-out
72-
${isOn ? "bg-background-400" : "bg-background-200"}
71+
w-10 h-6 flex items-center rounded-full p-1 transition-all duration-300 ease-in-out
72+
${isOn ? "bg-toggled-background" : "bg-untoggled-background"}
7373
`}
7474
>
7575
<div
@@ -178,10 +178,14 @@ export const FullSearchBar = ({
178178
suppressContentEditableWarning={true}
179179
/>
180180
<div
181-
className={`flex flex-nowrap ${showingSidebar ? " 2xl:justify-between" : "2xl:justify-end"} justify-between 4xl:justify-end w-full max-w-full items-center space-x-3 py-3 px-4`}
181+
className={`flex flex-nowrap ${
182+
showingSidebar ? " 2xl:justify-between" : "2xl:justify-end"
183+
} justify-between 4xl:justify-end w-full max-w-full items-center space-x-3 py-3 px-4`}
182184
>
183185
<div
184-
className={`-my-1 flex-grow 4xl:hidden ${!showingSidebar && "2xl:hidden"}`}
186+
className={`-my-1 flex-grow 4xl:hidden ${
187+
!showingSidebar && "2xl:hidden"
188+
}`}
185189
>
186190
{(ccPairs.length > 0 || documentSets.length > 0) && (
187191
<HorizontalSourceSelector
@@ -208,7 +212,11 @@ export const FullSearchBar = ({
208212
>
209213
<SendIcon
210214
size={28}
211-
className={`text-emphasis ${disabled || !query ? "bg-disabled-submit-background" : "bg-submit-background"} text-white p-1 rounded-full`}
215+
className={`text-emphasis ${
216+
disabled || !query
217+
? "bg-disabled-submit-background"
218+
: "bg-submit-background"
219+
} text-white p-1 rounded-full`}
212220
/>
213221
</button>
214222
</div>

web/src/components/search/SearchSection.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,9 @@ export const SearchSection = ({
724724

725725
{
726726
<div
727-
className={`desktop:px-24 w-full ${chatBannerPresent && "mt-10"} pt-10 relative max-w-[2000px] xl:max-w-[1430px] mx-auto`}
727+
className={`desktop:px-24 w-full ${
728+
chatBannerPresent && "mt-10"
729+
} pt-10 relative max-w-[2000px] xl:max-w-[1430px] mx-auto`}
728730
>
729731
<div className="absolute z-10 mobile:px-4 mobile:max-w-searchbar-max mobile:w-[90%] top-12 desktop:left-4 hidden 2xl:block mobile:left-1/2 mobile:transform mobile:-translate-x-1/2 desktop:w-52 3xl:w-64">
730732
{!settings?.isMobile &&
@@ -849,7 +851,7 @@ export const SearchSection = ({
849851
</div>
850852
</div>
851853
</div>
852-
<FixedLogo />
854+
<FixedLogo chat />
853855
</>
854856
);
855857
};

0 commit comments

Comments
 (0)