mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
additional cleanup of types file
This commit is contained in:
1 parent
b8b7c13e03
commit
564285f244
5 files changed
+11
-43
No files matched your search
@@ -325,8 +325,6 @@ When creating new components or pages, follow the existing patterns in the codeb
|
||||
setInput('');
|
||||
setIsLoading(true);
|
||||
|
||||
|
||||
|
||||
try {
|
||||
const aiMessages: AIMessage[] = [...messages, userMessage];
|
||||
updateMetadata('Shakespeare', `Processing your request for ${projectName}...`);
|
||||
|
||||
@@ -18,8 +18,8 @@ describe('AssistantContent', () => {
|
||||
</TestApp>
|
||||
);
|
||||
|
||||
// Check if BuildAction component is rendered
|
||||
expect(screen.queryByText(/Project/)).toBeInTheDocument();
|
||||
// Check if BuildAction component is rendered with auto-build title
|
||||
expect(screen.getByText('Auto-Build Project')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('should render regular markdown for non-build-action string content', () => {
|
||||
|
||||
@@ -73,15 +73,15 @@ export const AssistantContent = memo(({ content, toolResults = [] }: AssistantCo
|
||||
};
|
||||
|
||||
// Helper function to determine build action type
|
||||
const getActionType = (text: string): 'BUILD' | 'DEPLOY' | 'AUTO_BUILD' => {
|
||||
const getActionType = (text: string): 'build' | 'deploy' | 'auto-build' => {
|
||||
if (text.includes('Auto-build') || text.includes('Auto-building') ||
|
||||
(text.includes('Agent completed successfully') && text.includes('built'))) {
|
||||
return 'AUTO_BUILD';
|
||||
return 'auto-build';
|
||||
}
|
||||
if (text.includes('Deploy') || text.includes('Deploying')) {
|
||||
return 'DEPLOY';
|
||||
return 'deploy';
|
||||
}
|
||||
return 'BUILD';
|
||||
return 'build';
|
||||
};
|
||||
|
||||
// Helper function to determine build action status
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
import { memo } from 'react';
|
||||
import { ActionCard } from './shared/ActionCard';
|
||||
import type { BuildActionComponentProps } from '@/types/build';
|
||||
|
||||
interface BuildActionProps extends BuildActionComponentProps {
|
||||
interface BuildActionProps {
|
||||
action: 'build' | 'deploy' | 'auto-build';
|
||||
result?: string;
|
||||
status?: 'RUNNING' | 'SUCCESS' | 'FAILED' | 'PENDING';
|
||||
isError?: boolean;
|
||||
isLoading?: boolean;
|
||||
}
|
||||
|
||||
export const BuildAction = memo(({ action, result, status, isError, isLoading }: BuildActionProps) => {
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
export const BuildActionType = {
|
||||
BUILD: 'build',
|
||||
DEPLOY: 'deploy',
|
||||
AUTO_BUILD: 'auto-build',
|
||||
} as const;
|
||||
|
||||
export type BuildActionType = keyof typeof BuildActionType;
|
||||
|
||||
export const BuildActionStatus = {
|
||||
SUCCESS: 'success',
|
||||
FAILED: 'failed',
|
||||
RUNNING: 'running',
|
||||
PENDING: 'pending',
|
||||
} as const;
|
||||
|
||||
export type BuildActionStatus = keyof typeof BuildActionStatus;
|
||||
|
||||
export interface BuildActionContent {
|
||||
type: 'build-action';
|
||||
action: BuildActionType;
|
||||
status: BuildActionStatus;
|
||||
message: string;
|
||||
timestamp: number;
|
||||
}
|
||||
|
||||
export interface BuildActionComponentProps {
|
||||
action: BuildActionType;
|
||||
result?: string;
|
||||
status?: BuildActionStatus;
|
||||
isError?: boolean;
|
||||
isLoading?: boolean;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user