From d69180aeb83e97ed9905b98b776009faf80cd82f Mon Sep 17 00:00:00 2001 From: pablodanswer Date: Mon, 18 Nov 2024 14:56:48 -0800 Subject: [PATCH] add additional theming options (#3155) * add additional theming options * nit * Update Filters.tsx --- web/src/app/chat/ChatPage.tsx | 1 + .../chat/sessionSidebar/HistorySidebar.tsx | 22 ++++++++++--------- .../app/chat/shared_chat_search/FixedLogo.tsx | 2 +- .../shared_chat_search/FunctionalWrapper.tsx | 8 +++---- web/src/components/Dropdown.tsx | 4 ++-- .../components/assistants/StarterMessage.tsx | 2 +- web/src/components/header/LogoType.tsx | 8 ++++--- .../components/search/DateRangeSelector.tsx | 19 ++++++---------- .../search/filtering/FilterDropdown.tsx | 10 +++++++-- .../components/search/filtering/Filters.tsx | 9 +++++++- web/tailwind-themes/tailwind.config.js | 16 ++++++++++++++ 11 files changed, 65 insertions(+), 36 deletions(-) diff --git a/web/src/app/chat/ChatPage.tsx b/web/src/app/chat/ChatPage.tsx index 3e4354a8ce6..2876775bce1 100644 --- a/web/src/app/chat/ChatPage.tsx +++ b/web/src/app/chat/ChatPage.tsx @@ -1942,6 +1942,7 @@ export function ChatPage({ ref={innerSidebarElementRef} toggleSidebar={toggleSidebar} toggled={toggledSidebar && !settings?.isMobile} + backgroundToggled={toggledSidebar || showDocSidebar} existingChats={chatSessions} currentChatSession={selectedChatSession} folders={folders} diff --git a/web/src/app/chat/sessionSidebar/HistorySidebar.tsx b/web/src/app/chat/sessionSidebar/HistorySidebar.tsx index 9dad5c05079..d2ebf1c07e2 100644 --- a/web/src/app/chat/sessionSidebar/HistorySidebar.tsx +++ b/web/src/app/chat/sessionSidebar/HistorySidebar.tsx @@ -33,6 +33,7 @@ interface HistorySidebarProps { showDeleteModal?: (chatSession: ChatSession) => void; stopGenerating?: () => void; explicitlyUntoggle: () => void; + backgroundToggled?: boolean; } export const HistorySidebar = forwardRef( @@ -51,6 +52,7 @@ export const HistorySidebar = forwardRef( stopGenerating = () => null, showShareModal, showDeleteModal, + backgroundToggled, }, ref: ForwardedRef ) => { @@ -109,7 +111,7 @@ export const HistorySidebar = forwardRef( explicitlyUntoggle={explicitlyUntoggle} /> {page == "chat" && ( -
+
( } }} > - +

New Chat

- +

Manage Assistants

- -

+ +

Manage Prompts

)} -
+
- +
); diff --git a/web/src/app/chat/shared_chat_search/FunctionalWrapper.tsx b/web/src/app/chat/shared_chat_search/FunctionalWrapper.tsx index bfa8ef934f3..e8c377dc57f 100644 --- a/web/src/app/chat/shared_chat_search/FunctionalWrapper.tsx +++ b/web/src/app/chat/shared_chat_search/FunctionalWrapper.tsx @@ -47,8 +47,8 @@ const ToggleSwitch = () => {
diff --git a/web/src/components/search/DateRangeSelector.tsx b/web/src/components/search/DateRangeSelector.tsx index 0a1368199a3..75f6de2c579 100644 --- a/web/src/components/search/DateRangeSelector.tsx +++ b/web/src/components/search/DateRangeSelector.tsx @@ -3,15 +3,18 @@ import { FiCalendar, FiChevronDown, FiXCircle } from "react-icons/fi"; import { CustomDropdown } from "../Dropdown"; import { timeRangeValues } from "@/app/config/timeRange"; import { TimeRangeSelector } from "@/components/filters/TimeRangeSelector"; +import { cn } from "@/lib/utils"; export function DateRangeSelector({ value, onValueChange, isHorizontal, + className, }: { value: DateRangePickerValue | null; onValueChange: (value: DateRangePickerValue | null) => void; isHorizontal?: boolean; + className?: string; }) { return (
@@ -19,18 +22,10 @@ export function DateRangeSelector({ dropdown={ diff --git a/web/src/components/search/filtering/FilterDropdown.tsx b/web/src/components/search/filtering/FilterDropdown.tsx index 57c60f836c7..431c92fbb72 100644 --- a/web/src/components/search/filtering/FilterDropdown.tsx +++ b/web/src/components/search/filtering/FilterDropdown.tsx @@ -16,6 +16,8 @@ export function FilterDropdown({ dropdownWidth, optionClassName, resetValues, + backgroundColor, + dropdownColor, }: { options: Option[]; selected: string[]; @@ -26,6 +28,8 @@ export function FilterDropdown({ dropdownWidth?: string; optionClassName?: string; resetValues?: () => void; + backgroundColor?: string; + dropdownColor?: string; }) { return (
@@ -36,7 +40,7 @@ export function FilterDropdown({ border border-border rounded-lg - bg-background + ${backgroundColor || "bg-background"} flex flex-col ${dropdownWidth || width} @@ -62,7 +66,8 @@ export function FilterDropdown({ w-fit text-emphasis gap-x-1 - hover:bg-hover-light + ${dropdownColor || "bg-background"} + hover:bg-hover ${ ind === options.length - 1 ? "" @@ -99,6 +104,7 @@ export function FilterDropdown({ gap-x-2 border-border cursor-pointer + ${backgroundColor || "bg-background"} hover:bg-hover-light`} >
{icon}
diff --git a/web/src/components/search/filtering/Filters.tsx b/web/src/components/search/filtering/Filters.tsx index 8f17a00f5ef..545f5eb18d9 100644 --- a/web/src/components/search/filtering/Filters.tsx +++ b/web/src/components/search/filtering/Filters.tsx @@ -429,11 +429,13 @@ export function HorizontalSourceSelector({ isHorizontal value={timeRange} onValueChange={setTimeRange} + className="bg-background-search-filter" />
{existingSources.length > 0 && ( existingSources.includes(source.internalName)) .map((source) => ({ @@ -453,6 +455,7 @@ export function HorizontalSourceSelector({ } icon={} defaultDisplay="Sources" + dropdownColor="bg-background-search-filter-dropdown" width="w-fit ellipsis truncate" resetValues={resetSources} dropdownWidth="w-40" @@ -462,6 +465,7 @@ export function HorizontalSourceSelector({ {availableDocumentSets.length > 0 && ( ({ key: documentSet.name, display: <>{documentSet.name}, @@ -471,7 +475,8 @@ export function HorizontalSourceSelector({ icon={} defaultDisplay="Sets" resetValues={resetDocuments} - width="w-fit max-w-24 etext-llipsis truncate" + width="w-fit max-w-24 text-ellipsis truncate" + dropdownColor="bg-background-search-filter-dropdown" dropdownWidth="max-w-36 w-fit" optionClassName="truncate w-full break-all" /> @@ -479,6 +484,7 @@ export function HorizontalSourceSelector({ {availableTags.length > 0 && ( ({ key: `${tag.tag_key}=${tag.tag_value}`, display: ( @@ -504,6 +510,7 @@ export function HorizontalSourceSelector({ icon={} defaultDisplay="Tags" resetValues={resetTags} + dropdownColor="bg-background-search-filter-dropdown" width="w-fit max-w-24 ellipsis truncate" dropdownWidth="max-w-80 w-fit" optionClassName="truncate w-full break-all ellipsis" diff --git a/web/tailwind-themes/tailwind.config.js b/web/tailwind-themes/tailwind.config.js index c50d77f7073..4f33de65946 100644 --- a/web/tailwind-themes/tailwind.config.js +++ b/web/tailwind-themes/tailwind.config.js @@ -101,6 +101,13 @@ module.exports = { "background-strong": "var(--background-strong)", "background-search": "var(--white)", + "background-history-sidebar-button-hover": "var(--background-200)", + "text-history-sidebar-button": "var(--text-800)", + "divider-history-sidebar-bar": "var(--border)", + "text-mobile-sidebar": "var(--text-800)", + "background-search-filter": "var(--background-100)", + "background-search-filter-dropdown": "var(--background-100)", + // colors for sidebar in chat, search, and manage settings "background-sidebar": "var(--background-100)", "background-chatbar": "var(--background-100)", @@ -108,6 +115,11 @@ module.exports = { "toggled-background": "var(--background-400)", "untoggled-background": "var(--background-200)", + "background-starter-message": "var(--background)", + "background-starter-message-hover": "var(--background-100)", + + "text-sidebar-toggled-header": "var(--text-800)", + "text-sidebar-header": "var(--text-800)", "background-back-button": "var(--background-200)", "text-back-button": "var(--text-800)", @@ -119,6 +131,10 @@ module.exports = { "text-settings-sidebar-strong": "var(--text-900)", "background-settings-hover": "var(--background-200)", + "text-application-toggled": "var(--text-800)", + "text-application-untoggled": "var(--text-500)", + "text-application-untoggled-hover": "var(--text-700)", + "background-chat-hover": "var(--background-200)", "background-chat-selected": "var(--background-200)",