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 fixed
right-0 right-0
z-[1000] z-[1000]
bg-background bg-background
h-screen h-screen
transition-all transition-all

View File

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

View File

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

View File

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

View File

@@ -27,7 +27,9 @@ export function MetadataBadge({
size: 12, size: 12,
className: flexNone ? "flex-none" : "mr-0.5 my-auto", 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> </div>
); );
} }

View File

@@ -44,11 +44,12 @@ export function AdminSidebar({ collections }: { collections: Collection[] }) {
show={true} show={true}
enterpriseSettings={enterpriseSettings!} enterpriseSettings={enterpriseSettings!}
backgroundToggled={false} backgroundToggled={false}
isAdmin={true}
/> />
</div> </div>
<div className="flex w-full justify-center"> <div className="flex w-full justify-center">
<Link href="/chat"> <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} /> <CgArrowsExpandUpLeft className="my-auto" size={18} />
<p className="ml-1 break-words line-clamp-2 ellipsis leading-none"> <p className="ml-1 break-words line-clamp-2 ellipsis leading-none">
Exit Admin Exit Admin

View File

@@ -109,7 +109,7 @@ export default function FunctionalHeader({
{setSharingModalVisible && ( {setSharingModalVisible && (
<div <div
onClick={() => setSharingModalVisible(true)} 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" /> <FiShare2 size="18" />
</div> </div>
@@ -121,7 +121,7 @@ export default function FunctionalHeader({
/> />
</div> </div>
<Link <Link
className="desktop:hidden my-auto" className="desktop:hidden ml-2 my-auto"
href={ href={
`/${page}` + `/${page}` +
(NEXT_PUBLIC_NEW_CHAT_DIRECTS_TO_SAME_PERSONA && (NEXT_PUBLIC_NEW_CHAT_DIRECTS_TO_SAME_PERSONA &&

View File

@@ -11,9 +11,7 @@ export function HeaderTitle({
}) { }) {
const isString = typeof children === "string"; const isString = typeof children === "string";
const textSize = const textSize =
isString && children.length > 10 isString && children.length > 10 ? "text-lg mb-[4px] " : "text-2xl";
? "text-lg pb-[4px] -mb-[4px]"
: "text-2xl";
return ( return (
<h1 <h1
@@ -21,7 +19,7 @@ export function HeaderTitle({
backgroundToggled backgroundToggled
? "text-text-sidebar-toggled-header" ? "text-text-sidebar-toggled-header"
: "text-text-sidebar-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} {children}
</h1> </h1>

View File

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