mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-03 13:19:16 +00:00
Automatically carry over research mode from home page to chat
- Improve mobile friendliness with new research mode toggle, since chat input area is now taking up more space - Remove clunky title from the suggestion card - Fix fk lookup error for agent.creator
This commit is contained in:
@@ -42,6 +42,7 @@ function ChatBodyData(props: ChatBodyDataProps) {
|
||||
const [images, setImages] = useState<string[]>([]);
|
||||
const [processingMessage, setProcessingMessage] = useState(false);
|
||||
const [agentMetadata, setAgentMetadata] = useState<AgentData | null>(null);
|
||||
const [isInResearchMode, setIsInResearchMode] = useState(false);
|
||||
const chatInputRef = useRef<HTMLTextAreaElement>(null);
|
||||
|
||||
const setQueryToProcess = props.setQueryToProcess;
|
||||
@@ -70,6 +71,10 @@ function ChatBodyData(props: ChatBodyDataProps) {
|
||||
if (storedMessage) {
|
||||
setProcessingMessage(true);
|
||||
setQueryToProcess(storedMessage);
|
||||
|
||||
if (storedMessage.trim().startsWith("/research")) {
|
||||
setIsInResearchMode(true);
|
||||
}
|
||||
}
|
||||
}, [setQueryToProcess, props.setImages]);
|
||||
|
||||
@@ -130,6 +135,7 @@ function ChatBodyData(props: ChatBodyDataProps) {
|
||||
isMobileWidth={props.isMobileWidth}
|
||||
setUploadedFiles={props.setUploadedFiles}
|
||||
ref={chatInputRef}
|
||||
isResearchModeEnabled={isInResearchMode}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user