MCPcopy Create free account
hub / github.com/abi/screenshot-to-code / importFromCode

Function importFromCode

frontend/src/App.tsx:719–738  ·  view source on GitHub ↗
(code: string, stack: Stack)

Source from the content-addressed store, hash-verified

717 }
718
719 function importFromCode(code: string, stack: Stack) {
720 // Reset any existing state
721 reset();
722
723 // Set up this project
724 setStack(stack);
725
726 // Create a new commit and set it as the head
727 const commit = createCommit({
728 type: "code_create",
729 parentHash: null,
730 variants: [{ code, history: [] }],
731 inputs: null,
732 });
733 addCommit(commit);
734 setHead(commit.hash);
735
736 // Set the app state
737 setAppState(AppState.CODE_READY);
738 }
739
740 const showContentPanel =
741 appState === AppState.CODING ||

Callers 2

doImportFunction · 0.85
doImportFunction · 0.85

Calls 3

createCommitFunction · 0.90
resetFunction · 0.85
setStackFunction · 0.70

Tested by

no test coverage detected