Makelore 2.0 initial clean snapshot

This commit is contained in:
inman
2026-07-29 17:22:35 +08:00
commit b8ca3f8eea
694 changed files with 139782 additions and 0 deletions

28
src/pages/Chat/index.tsx Normal file
View File

@@ -0,0 +1,28 @@
import { OpencodeChatPanel } from './OpencodeChatPanel';
function getNavigationDraft(state: unknown): string | undefined {
if (!state || typeof state !== 'object') return undefined;
const draft = (state as { draft?: unknown }).draft;
return typeof draft === 'string' && draft.trim() ? draft : undefined;
}
function getNavigationDraftFromHistory(): string | undefined {
if (typeof window === 'undefined') return undefined;
const historyState = window.history.state as { usr?: unknown } | unknown;
const userState = historyState && typeof historyState === 'object' && 'usr' in historyState
? (historyState as { usr?: unknown }).usr
: historyState;
return getNavigationDraft(userState);
}
export function Chat() {
const navigationDraft = getNavigationDraftFromHistory();
return (
<div data-testid="chat-operation-page" className="flex h-[calc(100%_+_3rem)] min-h-0 -m-6 bg-background">
<OpencodeChatPanel variant="main" navigationDraft={navigationDraft} />
</div>
);
}
export default Chat;