feat: ai chat added, login flow still broken

This commit is contained in:
2026-02-11 18:00:37 +01:00
parent 258e313f0e
commit 870bec4dcd
21 changed files with 3174 additions and 25 deletions

View File

@@ -9,6 +9,7 @@ import { ErrorModal } from '../ErrorModal';
import { SettingsView } from '../SettingsView';
import { TagsView } from '../TagsView';
import { TagInput } from '../TagInput';
import { ChatPanel } from '../ChatPanel';
import { AutoSaveManager } from '../../utils';
import './Editor.css';
@@ -1005,6 +1006,7 @@ export const Editor: React.FC = () => {
const showMedia = activeTab?.type === 'media';
const showSettings = activeTab?.type === 'settings' || (activeView === 'settings' && !activeTab);
const showTags = activeTab?.type === 'tags' || (activeView === 'tags' && !activeTab);
const showChat = activeTab?.type === 'chat';
// Clear selectedPostId if the post doesn't exist (e.g., after project switch)
useEffect(() => {
@@ -1068,6 +1070,16 @@ export const Editor: React.FC = () => {
);
}
// Show chat if chat tab is active
if (showChat && activeTabId) {
return (
<>
<ChatPanel key={activeTabId} conversationId={activeTabId} />
{renderErrorModal()}
</>
);
}
// Show post editor if a post tab is active
if (showPost && activeTabId) {
const post = posts.find(p => p.id === activeTabId);