mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-04 09:13:08 +00:00
fix: resolve type errors after merging upstream v0.12.0rc
- Fix ThemeMode type casting in __root.tsx - Use specRegeneration.create() instead of non-existent generateAppSpec - Add missing keyboard shortcut entries for projectSettings and notifications - Fix lucide-react type casts with intermediate unknown cast - Remove unused pipelineConfig prop from ListRow component - Align SettingsProject interface with Project type - Fix defaultDeleteBranchWithWorktree property name
This commit is contained in:
@@ -448,7 +448,9 @@ export function IconPicker({ selectedIcon, onSelectIcon }: IconPickerProps) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const getIconComponent = (iconName: string) => {
|
const getIconComponent = (iconName: string) => {
|
||||||
return (LucideIcons as Record<string, React.ComponentType<{ className?: string }>>)[iconName];
|
return (LucideIcons as unknown as Record<string, React.ComponentType<{ className?: string }>>)[
|
||||||
|
iconName
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export function ProjectSwitcherItem({
|
|||||||
// Get the icon component from lucide-react
|
// Get the icon component from lucide-react
|
||||||
const getIconComponent = (): LucideIcon => {
|
const getIconComponent = (): LucideIcon => {
|
||||||
if (project.icon && project.icon in LucideIcons) {
|
if (project.icon && project.icon in LucideIcons) {
|
||||||
return (LucideIcons as Record<string, LucideIcon>)[project.icon];
|
return (LucideIcons as unknown as Record<string, LucideIcon>)[project.icon];
|
||||||
}
|
}
|
||||||
return Folder;
|
return Folder;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import { getElectronAPI } from '@/lib/electron';
|
|||||||
import { initializeProject, hasAppSpec, hasAutomakerDir } from '@/lib/project-init';
|
import { initializeProject, hasAppSpec, hasAutomakerDir } from '@/lib/project-init';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { CreateSpecDialog } from '@/components/views/spec-view/dialogs';
|
import { CreateSpecDialog } from '@/components/views/spec-view/dialogs';
|
||||||
|
import type { FeatureCount } from '@/components/views/spec-view/types';
|
||||||
|
|
||||||
function getOSAbbreviation(os: string): string {
|
function getOSAbbreviation(os: string): string {
|
||||||
switch (os) {
|
switch (os) {
|
||||||
@@ -57,7 +58,7 @@ export function ProjectSwitcher() {
|
|||||||
const [projectOverview, setProjectOverview] = useState('');
|
const [projectOverview, setProjectOverview] = useState('');
|
||||||
const [generateFeatures, setGenerateFeatures] = useState(true);
|
const [generateFeatures, setGenerateFeatures] = useState(true);
|
||||||
const [analyzeProject, setAnalyzeProject] = useState(true);
|
const [analyzeProject, setAnalyzeProject] = useState(true);
|
||||||
const [featureCount, setFeatureCount] = useState(5);
|
const [featureCount, setFeatureCount] = useState<FeatureCount>(50);
|
||||||
|
|
||||||
// Derive isCreatingSpec from store state
|
// Derive isCreatingSpec from store state
|
||||||
const isCreatingSpec = specCreatingForProject !== null;
|
const isCreatingSpec = specCreatingForProject !== null;
|
||||||
@@ -208,13 +209,18 @@ export function ProjectSwitcher() {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const api = getElectronAPI();
|
const api = getElectronAPI();
|
||||||
await api.generateAppSpec({
|
if (!api.specRegeneration) {
|
||||||
projectPath: setupProjectPath,
|
toast.error('Spec regeneration not available');
|
||||||
|
setSpecCreatingForProject(null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
await api.specRegeneration.create(
|
||||||
|
setupProjectPath,
|
||||||
projectOverview,
|
projectOverview,
|
||||||
generateFeatures,
|
generateFeatures,
|
||||||
analyzeProject,
|
analyzeProject,
|
||||||
featureCount,
|
featureCount
|
||||||
});
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to generate spec:', error);
|
console.error('Failed to generate spec:', error);
|
||||||
toast.error('Failed to generate spec', {
|
toast.error('Failed to generate spec', {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export function SidebarHeader({
|
|||||||
// Get the icon component from lucide-react
|
// Get the icon component from lucide-react
|
||||||
const getIconComponent = (): LucideIcon => {
|
const getIconComponent = (): LucideIcon => {
|
||||||
if (currentProject?.icon && currentProject.icon in LucideIcons) {
|
if (currentProject?.icon && currentProject.icon in LucideIcons) {
|
||||||
return (LucideIcons as Record<string, LucideIcon>)[currentProject.icon];
|
return (LucideIcons as unknown as Record<string, LucideIcon>)[currentProject.icon];
|
||||||
}
|
}
|
||||||
return Folder;
|
return Folder;
|
||||||
};
|
};
|
||||||
@@ -125,7 +125,7 @@ export function SidebarHeader({
|
|||||||
{projects.map((project) => {
|
{projects.map((project) => {
|
||||||
const ProjectIcon =
|
const ProjectIcon =
|
||||||
project.icon && project.icon in LucideIcons
|
project.icon && project.icon in LucideIcons
|
||||||
? (LucideIcons as Record<string, LucideIcon>)[project.icon]
|
? (LucideIcons as unknown as Record<string, LucideIcon>)[project.icon]
|
||||||
: Folder;
|
: Folder;
|
||||||
const isActive = currentProject?.id === project.id;
|
const isActive = currentProject?.id === project.id;
|
||||||
|
|
||||||
|
|||||||
@@ -90,8 +90,10 @@ const SHORTCUT_LABELS: Record<keyof KeyboardShortcuts, string> = {
|
|||||||
context: 'Context',
|
context: 'Context',
|
||||||
memory: 'Memory',
|
memory: 'Memory',
|
||||||
settings: 'Settings',
|
settings: 'Settings',
|
||||||
|
projectSettings: 'Project Settings',
|
||||||
terminal: 'Terminal',
|
terminal: 'Terminal',
|
||||||
ideation: 'Ideation',
|
ideation: 'Ideation',
|
||||||
|
notifications: 'Notifications',
|
||||||
githubIssues: 'GitHub Issues',
|
githubIssues: 'GitHub Issues',
|
||||||
githubPrs: 'Pull Requests',
|
githubPrs: 'Pull Requests',
|
||||||
toggleSidebar: 'Toggle Sidebar',
|
toggleSidebar: 'Toggle Sidebar',
|
||||||
@@ -118,8 +120,10 @@ const SHORTCUT_CATEGORIES: Record<keyof KeyboardShortcuts, 'navigation' | 'ui' |
|
|||||||
context: 'navigation',
|
context: 'navigation',
|
||||||
memory: 'navigation',
|
memory: 'navigation',
|
||||||
settings: 'navigation',
|
settings: 'navigation',
|
||||||
|
projectSettings: 'navigation',
|
||||||
terminal: 'navigation',
|
terminal: 'navigation',
|
||||||
ideation: 'navigation',
|
ideation: 'navigation',
|
||||||
|
notifications: 'navigation',
|
||||||
githubIssues: 'navigation',
|
githubIssues: 'navigation',
|
||||||
githubPrs: 'navigation',
|
githubPrs: 'navigation',
|
||||||
toggleSidebar: 'ui',
|
toggleSidebar: 'ui',
|
||||||
|
|||||||
@@ -411,7 +411,6 @@ export const ListView = memo(function ListView({
|
|||||||
feature={feature}
|
feature={feature}
|
||||||
handlers={createHandlers(feature)}
|
handlers={createHandlers(feature)}
|
||||||
isCurrentAutoTask={runningAutoTasks.includes(feature.id)}
|
isCurrentAutoTask={runningAutoTasks.includes(feature.id)}
|
||||||
pipelineConfig={pipelineConfig}
|
|
||||||
isSelected={selectedFeatureIds.has(feature.id)}
|
isSelected={selectedFeatureIds.has(feature.id)}
|
||||||
showCheckbox={isSelectionMode}
|
showCheckbox={isSelectionMode}
|
||||||
onToggleSelect={() => onToggleFeatureSelection?.(feature.id)}
|
onToggleSelect={() => onToggleFeatureSelection?.(feature.id)}
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ interface SettingsProject {
|
|||||||
name: string;
|
name: string;
|
||||||
path: string;
|
path: string;
|
||||||
theme?: string;
|
theme?: string;
|
||||||
icon?: string | null;
|
icon?: string;
|
||||||
customIconPath?: string | null;
|
customIconPath?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function ProjectSettingsView() {
|
export function ProjectSettingsView() {
|
||||||
|
|||||||
@@ -93,8 +93,11 @@ export function useProjectSettingsLoader() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Apply defaultDeleteBranch if present
|
// Apply defaultDeleteBranch if present
|
||||||
if (result.settings.defaultDeleteBranch !== undefined) {
|
if (result.settings.defaultDeleteBranchWithWorktree !== undefined) {
|
||||||
setDefaultDeleteBranch(requestedProjectPath, result.settings.defaultDeleteBranch);
|
setDefaultDeleteBranch(
|
||||||
|
requestedProjectPath,
|
||||||
|
result.settings.defaultDeleteBranchWithWorktree
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply autoDismissInitScriptIndicator if present
|
// Apply autoDismissInitScriptIndicator if present
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
useFileBrowser,
|
useFileBrowser,
|
||||||
setGlobalFileBrowser,
|
setGlobalFileBrowser,
|
||||||
} from '@/contexts/file-browser-context';
|
} from '@/contexts/file-browser-context';
|
||||||
import { useAppStore, getStoredTheme } from '@/store/app-store';
|
import { useAppStore, getStoredTheme, type ThemeMode } from '@/store/app-store';
|
||||||
import { useSetupStore } from '@/store/setup-store';
|
import { useSetupStore } from '@/store/setup-store';
|
||||||
import { useAuthStore } from '@/store/auth-store';
|
import { useAuthStore } from '@/store/auth-store';
|
||||||
import { getElectronAPI, isElectron } from '@/lib/electron';
|
import { getElectronAPI, isElectron } from '@/lib/electron';
|
||||||
@@ -681,7 +681,7 @@ function RootLayoutContent() {
|
|||||||
upsertAndSetCurrentProject(
|
upsertAndSetCurrentProject(
|
||||||
autoOpenCandidate.path,
|
autoOpenCandidate.path,
|
||||||
autoOpenCandidate.name,
|
autoOpenCandidate.name,
|
||||||
autoOpenCandidate.theme
|
autoOpenCandidate.theme as ThemeMode | undefined
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user