Fix template project creation returning to welcome screen#532
Open
vellanki-santhosh wants to merge 1 commit intoIronclad:mainfrom
Open
Fix template project creation returning to welcome screen#532vellanki-santhosh wants to merge 1 commit intoIronclad:mainfrom
vellanki-santhosh wants to merge 1 commit intoIronclad:mainfrom
Conversation
When creating a project from templates (AI Agent, MCP AI Agent, or tutorials), clicking 'Create' would close the modal but return to the welcome screen instead of opening the template project. Root cause: useNewProjectFromTemplate hook was missing updates to openedProjectsState and openedProjectsSortedIdsState. While it set the project data correctly, the app thought no projects were open (openedProjectIds.length === 0), so it continued displaying the NoProject welcome screen. Fix: Add the same opened projects state management that useNewProject has: - Import and use openedProjectsState and openedProjectsSortedIdsState - Update opened projects registry with the new template project - Append new project ID to sorted IDs list This ensures template projects are properly tracked as opened and displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When creating a new project from a template (AI Agent Template, MCP AI Agent Template, or Tutorial), clicking 'Create' caused the modal to close and return to the welcome screen instead of opening the template project.
Root Cause
The
useNewProjectFromTemplatehook was missing critical state updates that manage the list of opened projects. While it correctly set the project data, it didn't updateopenedProjectsStateandopenedProjectsSortedIdsState. This caused the app to think no projects were open (openedProjectIds.length === 0), so it continued displaying the welcome screen.Solution
Updated
useNewProjectFromTemplate.tsto match the behavior ofuseNewProjectby:openedProjectsState,openedProjectsSortedIdsState, andOpenedProjectInfotypeuseAtomValuefor reading current opened project IDsopenedProjectsStateandopenedProjectsSortedIdsStateThis ensures that when a template is loaded, the app correctly tracks it as an opened project and displays it instead of returning to the welcome screen.
Testing