Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion web/src/app/chat/ChatPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2512,7 +2512,10 @@ export function ChatPage({
)}
</div>
</div>
<FixedLogo chat />
<FixedLogo
chat
backgroundToggled={toggledSidebar || showDocSidebar}
/>
</div>
</div>
<DocumentSidebar
Expand Down
2 changes: 1 addition & 1 deletion web/src/app/chat/sessionSidebar/ChatSessionDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export function ChatSessionDisplay({
${
isSelected
? "to-background-chat-hover"
: " to-background-chat-selected group-hover:to-background-chat-hover"
: " to-background-chat-hover group-hover:to-background-chat-selected"
} `}
/>
</p>
Expand Down
14 changes: 11 additions & 3 deletions web/src/app/chat/shared_chat_search/FixedLogo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ import Link from "next/link";
import { useContext } from "react";
import { FiSidebar } from "react-icons/fi";

export default function FixedLogo({ chat }: { chat?: boolean }) {
export default function FixedLogo({
chat,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: improve naming

backgroundToggled,
}: {
chat?: boolean;
backgroundToggled?: boolean;
}) {
const combinedSettings = useContext(SettingsContext);
const settings = combinedSettings?.settings;
const enterpriseSettings = combinedSettings?.enterpriseSettings;
Expand All @@ -28,15 +34,17 @@ export default function FixedLogo({ chat }: { chat?: boolean }) {
<div className="w-full">
{enterpriseSettings && enterpriseSettings.application_name ? (
<div>
<HeaderTitle chat={chat}>
<HeaderTitle backgroundToggled={backgroundToggled} chat={chat}>
{enterpriseSettings.application_name}
</HeaderTitle>
{!NEXT_PUBLIC_DO_NOT_USE_TOGGLE_OFF_DANSWER_POWERED && (
<p className="text-xs text-subtle">Powered by Danswer</p>
)}
</div>
) : (
<HeaderTitle chat={chat}>Danswer</HeaderTitle>
<HeaderTitle backgroundToggled={backgroundToggled} chat={chat}>
Danswer
</HeaderTitle>
)}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/BasicClickable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export function BasicSelectable({
? "bg-background-chat-selected"
: "bg-hover"
: chat
? "bg-background-chat-hover"
? "hover:bg-background-chat-hover"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a comment on what chat means?

: "hover:bg-hover"
}
${fullWidth ? "w-full" : ""}`}
Expand Down
8 changes: 7 additions & 1 deletion web/src/components/header/HeaderTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,23 @@ import React from "react";
export function HeaderTitle({
children,
chat,
backgroundToggled,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment here

}: {
children: JSX.Element | string;
chat?: boolean;
backgroundToggled?: boolean;
}) {
const isString = typeof children === "string";
const textSize = isString && children.length > 10 ? "text-xl" : "text-2xl";

return (
<h1
className={`${textSize} ${
chat ? "text-text-sidebar-header" : "text-text-header"
chat
? backgroundToggled
? "text-text-sidebar-toggled-header"
: "text-text-sidebar-header"
: "text-text-header"
} break-words line-clamp-2 ellipsis text-strong leading-none font-bold`}
>
{children}
Expand Down
12 changes: 8 additions & 4 deletions web/src/components/header/LogoType.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ export default function LogoType({

return (
<div
className={`${hideOnMobile && "mobile:hidden"} z-[100] mb-auto shrink-0 flex items-center text-xl font-bold`}
className={`${
hideOnMobile && "mobile:hidden"
} z-[100] mb-auto shrink-0 flex items-center text-xl font-bold`}
>
{toggleSidebar && page == "chat" ? (
<button
Expand All @@ -55,7 +57,9 @@ export default function LogoType({
</div>
)}
<div
className={`cursor-pointer ${showArrow ? "desktop:invisible" : "invisible"} break-words inline-block w-fit ml-2 text-text-700 text-xl`}
className={`cursor-pointer ${
showArrow ? "desktop:invisible" : "invisible"
} break-words inline-block w-fit ml-2 text-text-700 text-xl`}
>
<div className="max-w-[175px]">
{enterpriseSettings && enterpriseSettings.application_name ? (
Expand Down Expand Up @@ -111,9 +115,9 @@ export default function LogoType({
}}
>
{!toggled && !combinedSettings?.isMobile ? (
<RightToLineIcon />
<RightToLineIcon className="text-sidebar-toggle" />
) : (
<LeftToLineIcon />
<LeftToLineIcon className="text-sidebar-toggle" />
)}
</button>
</Tooltip>
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/search/SearchSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ export const SearchSection = ({
</div>
</div>
</div>
<FixedLogo chat />
<FixedLogo chat backgroundToggled={toggledSidebar || showDocSidebar} />
</>
);
};
Loading