mirror of
https://github.com/ItzCrazyKns/Perplexica.git
synced 2025-06-23 10:18:48 +00:00
refactor: remove unused deepseekChat.ts in favor
of reasoningChatModel.ts and messageProcessor.ts in favor of alternaitngMessageValidator.ts - Removed src/lib/deepseekChat.ts as it was duplicative - All functionality is now handled by reasoningChatModel.ts - No imports or references to deepseekChat.ts found in codebase - Removed src/utils/messageProcessor.ts as it was duplicative - All functionality is now handled by alternatingMessaageValidator.ts - No imports or references messageProcessor.ts found in codebase
This commit is contained in:
@ -16,15 +16,8 @@ const ReasoningPanel = ({ thinking, className, isExpanded: propExpanded }: Reaso
|
||||
const [isExpanded, setIsExpanded] = React.useState(true);
|
||||
const [detailsRefs, setDetailsRefs] = React.useState<HTMLDetailsElement[]>([]);
|
||||
|
||||
logger.info('ReasoningPanel rendering with:', {
|
||||
thinking: thinking,
|
||||
isExpanded: propExpanded,
|
||||
detailsRefsCount: detailsRefs.length
|
||||
});
|
||||
|
||||
React.useEffect(() => {
|
||||
if (propExpanded !== undefined) {
|
||||
logger.info('Updating expansion state:', propExpanded);
|
||||
setIsExpanded(propExpanded);
|
||||
}
|
||||
}, [propExpanded]);
|
||||
@ -33,7 +26,6 @@ const ReasoningPanel = ({ thinking, className, isExpanded: propExpanded }: Reaso
|
||||
if (element) {
|
||||
setDetailsRefs(refs => {
|
||||
if (!refs.includes(element)) {
|
||||
logger.info('Adding new details ref');
|
||||
return [...refs, element];
|
||||
}
|
||||
return refs;
|
||||
@ -42,11 +34,9 @@ const ReasoningPanel = ({ thinking, className, isExpanded: propExpanded }: Reaso
|
||||
}, []);
|
||||
|
||||
const expandAll = () => {
|
||||
logger.info('Expanding all details');
|
||||
detailsRefs.forEach(ref => ref.open = true);
|
||||
};
|
||||
const collapseAll = () => {
|
||||
logger.info('Collapsing all details');
|
||||
detailsRefs.forEach(ref => ref.open = false);
|
||||
};
|
||||
|
||||
@ -73,9 +63,7 @@ const ReasoningPanel = ({ thinking, className, isExpanded: propExpanded }: Reaso
|
||||
{thinking.split('\n\n').map((paragraph, index) => {
|
||||
if (!paragraph.trim()) return null;
|
||||
|
||||
// Extract content without the bullet prefix
|
||||
const content = paragraph.replace(/^[•\-\d.]\s*/, '');
|
||||
logger.info(`Processing paragraph ${index}:`, content);
|
||||
|
||||
return (
|
||||
<div key={index} className="mb-2 last:mb-0">
|
||||
@ -117,4 +105,4 @@ const ReasoningPanel = ({ thinking, className, isExpanded: propExpanded }: Reaso
|
||||
);
|
||||
};
|
||||
|
||||
export default ReasoningPanel;
|
||||
export default ReasoningPanel;
|
||||
|
Reference in New Issue
Block a user