feat: add New Goal dialog and Sub Goal button
- Added NewGoalDialog component with title, description (markdown), status, level, and parent goal selection - Integrated dialog into DialogContext with parentId defaults support - Added "+ New Goal" button on /goals page (both empty state and header) - Added "+ Sub Goal" button on goal detail sub-goals tab that pre-fills the parent goal Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,10 @@ interface NewIssueDefaults {
|
||||
assigneeAgentId?: string;
|
||||
}
|
||||
|
||||
interface NewGoalDefaults {
|
||||
parentId?: string;
|
||||
}
|
||||
|
||||
interface DialogContextValue {
|
||||
newIssueOpen: boolean;
|
||||
newIssueDefaults: NewIssueDefaults;
|
||||
@@ -15,6 +19,10 @@ interface DialogContextValue {
|
||||
newProjectOpen: boolean;
|
||||
openNewProject: () => void;
|
||||
closeNewProject: () => void;
|
||||
newGoalOpen: boolean;
|
||||
newGoalDefaults: NewGoalDefaults;
|
||||
openNewGoal: (defaults?: NewGoalDefaults) => void;
|
||||
closeNewGoal: () => void;
|
||||
newAgentOpen: boolean;
|
||||
openNewAgent: () => void;
|
||||
closeNewAgent: () => void;
|
||||
@@ -29,6 +37,8 @@ export function DialogProvider({ children }: { children: ReactNode }) {
|
||||
const [newIssueOpen, setNewIssueOpen] = useState(false);
|
||||
const [newIssueDefaults, setNewIssueDefaults] = useState<NewIssueDefaults>({});
|
||||
const [newProjectOpen, setNewProjectOpen] = useState(false);
|
||||
const [newGoalOpen, setNewGoalOpen] = useState(false);
|
||||
const [newGoalDefaults, setNewGoalDefaults] = useState<NewGoalDefaults>({});
|
||||
const [newAgentOpen, setNewAgentOpen] = useState(false);
|
||||
const [onboardingOpen, setOnboardingOpen] = useState(false);
|
||||
|
||||
@@ -50,6 +60,16 @@ export function DialogProvider({ children }: { children: ReactNode }) {
|
||||
setNewProjectOpen(false);
|
||||
}, []);
|
||||
|
||||
const openNewGoal = useCallback((defaults: NewGoalDefaults = {}) => {
|
||||
setNewGoalDefaults(defaults);
|
||||
setNewGoalOpen(true);
|
||||
}, []);
|
||||
|
||||
const closeNewGoal = useCallback(() => {
|
||||
setNewGoalOpen(false);
|
||||
setNewGoalDefaults({});
|
||||
}, []);
|
||||
|
||||
const openNewAgent = useCallback(() => {
|
||||
setNewAgentOpen(true);
|
||||
}, []);
|
||||
@@ -76,6 +96,10 @@ export function DialogProvider({ children }: { children: ReactNode }) {
|
||||
newProjectOpen,
|
||||
openNewProject,
|
||||
closeNewProject,
|
||||
newGoalOpen,
|
||||
newGoalDefaults,
|
||||
openNewGoal,
|
||||
closeNewGoal,
|
||||
newAgentOpen,
|
||||
openNewAgent,
|
||||
closeNewAgent,
|
||||
|
||||
Reference in New Issue
Block a user