This commit is contained in:
pablonyx
2024-12-17 18:03:38 -08:00
committed by GitHub
parent 571c8ece32
commit ddc6a6d2b3
9 changed files with 30 additions and 19 deletions

View File

@@ -2168,7 +2168,6 @@ export function ChatPage({
fixed
right-0
z-[1000]
bg-background
h-screen
transition-all

View File

@@ -81,6 +81,8 @@ export function ChatDocumentDisplay({
}
};
const hasMetadata =
document.updated_at || Object.keys(document.metadata).length > 0;
return (
<div className={`opacity-100 ${modal ? "w-[90vw]" : "w-full"}`}>
<div
@@ -107,8 +109,14 @@ export function ChatDocumentDisplay({
: document.semantic_identifier || document.document_id}
</div>
</div>
<DocumentMetadataBlock modal={modal} document={document} />
<div className="line-clamp-3 pt-2 text-sm font-normal leading-snug text-gray-600">
{hasMetadata && (
<DocumentMetadataBlock modal={modal} document={document} />
)}
<div
className={`line-clamp-3 text-sm font-normal leading-snug text-gray-600 ${
hasMetadata ? "mt-2" : ""
}`}
>
{buildDocumentSummaryDisplay(
document.match_highlights,
document.blurb

View File

@@ -417,9 +417,7 @@ export function ChatInputBar({
style={{ scrollbarWidth: "thin" }}
role="textarea"
aria-multiline
placeholder={`Send a message ${
!settings?.isMobile ? "or try using @ or /" : ""
}`}
placeholder="Ask me anything.."
value={message}
onKeyDown={(event) => {
if (

View File

@@ -9,18 +9,23 @@ import { useContext } from "react";
import { FiSidebar } from "react-icons/fi";
import { LogoType } from "@/components/logo/Logo";
import { EnterpriseSettings } from "@/app/admin/settings/interfaces";
import { useRouter } from "next/navigation";
export function LogoComponent({
enterpriseSettings,
backgroundToggled,
show,
isAdmin,
}: {
enterpriseSettings: EnterpriseSettings | null;
backgroundToggled?: boolean;
show?: boolean;
isAdmin?: boolean;
}) {
const router = useRouter();
return (
<div
<button
onClick={isAdmin ? () => router.push("/chat") : () => {}}
className={`max-w-[200px] ${
!show && "mobile:hidden"
} flex items-center gap-x-1`}
@@ -35,14 +40,14 @@ export function LogoComponent({
{enterpriseSettings.application_name}
</HeaderTitle>
{!NEXT_PUBLIC_DO_NOT_USE_TOGGLE_OFF_DANSWER_POWERED && (
<p className="text-xs text-subtle">Powered by Onyx</p>
<p className="text-xs text-left text-subtle">Powered by Onyx</p>
)}
</div>
</>
) : (
<LogoType />
)}
</div>
</button>
);
}

View File

@@ -27,7 +27,9 @@ export function MetadataBadge({
size: 12,
className: flexNone ? "flex-none" : "mr-0.5 my-auto",
})}
<div className="my-auto flex">{value}</div>
<p className="max-w-[6rem] text-ellipsis overflow-hidden truncate whitespace-nowrap">
{value}lllaasfasdf
</p>
</div>
);
}

View File

@@ -44,11 +44,12 @@ export function AdminSidebar({ collections }: { collections: Collection[] }) {
show={true}
enterpriseSettings={enterpriseSettings!}
backgroundToggled={false}
isAdmin={true}
/>
</div>
<div className="flex w-full justify-center">
<Link href="/chat">
<button className="text-sm flex items-center block w-52 py-2.5 flex px-2 text-left hover:bg-opacity-80 cursor-pointer rounded">
<button className="text-sm hover:bg-background-settings-hover flex items-center block w-52 py-2.5 flex px-2 text-left hover:bg-opacity-80 cursor-pointer rounded">
<CgArrowsExpandUpLeft className="my-auto" size={18} />
<p className="ml-1 break-words line-clamp-2 ellipsis leading-none">
Exit Admin

View File

@@ -105,11 +105,11 @@ export default function FunctionalHeader({
/>
</div>
<div className="absolute right-0 mobile:top-2 desktop:top-0 flex">
<div className="absolute right-0 mobile:top-2 desktop:top-0 flex">
{setSharingModalVisible && (
<div
onClick={() => setSharingModalVisible(true)}
className="mobile:hidden ml-2 my-auto rounded cursor-pointer hover:bg-hover-light"
className="mobile:hidden mr-2 my-auto rounded cursor-pointer hover:bg-hover-light"
>
<FiShare2 size="18" />
</div>
@@ -121,7 +121,7 @@ export default function FunctionalHeader({
/>
</div>
<Link
className="desktop:hidden my-auto"
className="desktop:hidden ml-2 my-auto"
href={
`/${page}` +
(NEXT_PUBLIC_NEW_CHAT_DIRECTS_TO_SAME_PERSONA &&

View File

@@ -11,9 +11,7 @@ export function HeaderTitle({
}) {
const isString = typeof children === "string";
const textSize =
isString && children.length > 10
? "text-lg pb-[4px] -mb-[4px]"
: "text-2xl";
isString && children.length > 10 ? "text-lg mb-[4px] " : "text-2xl";
return (
<h1
@@ -21,7 +19,7 @@ export function HeaderTitle({
backgroundToggled
? "text-text-sidebar-toggled-header"
: "text-text-sidebar-header"
} break-words line-clamp-2 ellipsis text-strong overflow-hidden leading-none font-bold`}
} break-words text-left line-clamp-2 ellipsis text-strong overflow-hidden leading-none font-bold`}
>
{children}
</h1>

View File

@@ -143,7 +143,7 @@ module.exports = {
// Background for chat messages (user bubbles)
user: "var(--user-bubble)",
"userdropdown-background": "var(--background-100)",
"userdropdown-background": "var(--background-150)",
"text-mobile-sidebar-toggled": "var(--text-800)",
"text-mobile-sidebar-untoggled": "var(--text-500)",
"text-editing-message": "var(--text-800)",