Update layout and rendering of share page for hidden agent

This commit is contained in:
sabaimran
2025-01-20 12:02:07 -08:00
parent 000580cb8a
commit 0c29c7a5bf
3 changed files with 46 additions and 31 deletions

View File

@@ -79,7 +79,8 @@ function ChatBodyData(props: ChatBodyDataProps) {
} }
return ( return (
<> <div className="flex flex-row h-full w-full">
<div className="flex flex-col h-full w-full">
<div className={false ? styles.chatBody : styles.chatBodyFull}> <div className={false ? styles.chatBody : styles.chatBodyFull}>
<ChatHistory <ChatHistory
publicConversationSlug={props.publicConversationSlug} publicConversationSlug={props.publicConversationSlug}
@@ -92,7 +93,7 @@ function ChatBodyData(props: ChatBodyDataProps) {
/> />
</div> </div>
<div <div
className={`${styles.inputBox} p-1 md:px-2 shadow-md bg-background align-middle items-center justify-center dark:bg-neutral-700 dark:border-0 dark:shadow-sm rounded-2xl md:rounded-xl h-fit ${chatHistoryCustomClassName} mr-auto ml-auto`} className={`${styles.inputBox} p-1 md:px-2 shadow-md bg-background align-middle items-center justify-center dark:bg-neutral-700 dark:border-0 dark:shadow-sm rounded-2xl md:rounded-xl h-fit ${chatHistoryCustomClassName} mr-auto ml-auto mt-auto`}
> >
<ChatInputArea <ChatInputArea
isLoggedIn={props.isLoggedIn} isLoggedIn={props.isLoggedIn}
@@ -104,11 +105,12 @@ function ChatBodyData(props: ChatBodyDataProps) {
agentColor={agentMetadata?.color} agentColor={agentMetadata?.color}
isMobileWidth={props.isMobileWidth} isMobileWidth={props.isMobileWidth}
setUploadedFiles={props.setUploadedFiles} setUploadedFiles={props.setUploadedFiles}
setTriggeredAbort={() => {}} setTriggeredAbort={() => { }}
ref={chatInputRef} ref={chatInputRef}
/> />
</div> </div>
</> </div>
</div>
); );
} }

View File

@@ -35,6 +35,7 @@ div.inputBox:focus {
div.chatBodyFull { div.chatBodyFull {
display: grid; display: grid;
grid-template-columns: 1fr; grid-template-columns: 1fr;
height: auto;
} }
button.inputBox { button.inputBox {

View File

@@ -280,7 +280,19 @@ def get_shared_chat(
agent_metadata = None agent_metadata = None
if conversation.agent: if conversation.agent:
if conversation.agent.privacy_level == Agent.PrivacyLevel.PRIVATE: if conversation.agent.privacy_level == Agent.PrivacyLevel.PRIVATE and conversation.agent.creator != user:
if conversation.agent.is_hidden:
default_agent = AgentAdapters.get_default_agent()
agent_metadata = {
"slug": default_agent.slug,
"name": default_agent.name,
"is_creator": False,
"color": default_agent.style_color,
"icon": default_agent.style_icon,
"persona": default_agent.personality,
"is_hidden": default_agent.is_hidden,
}
else:
conversation.agent = None conversation.agent = None
else: else:
agent_metadata = { agent_metadata = {