@@ -489,6 +489,7 @@ export async function runCp(commandName = 'desktop') {
489489 { id : 'docs' , label : 'Open documentation' , key : 'i' } ,
490490 { id : 'settings' , label : 'Settings' , key : 'g' } ,
491491 { id : 'build' , label : 'Build (pnpm generate)' , key : 'b' } ,
492+ { id : 'create' , label : 'Create new app or module' , key : 'n' } ,
492493 { id : 'quit' , label : 'Quit control panel' , key : 'q' } ,
493494 ]
494495
@@ -1389,7 +1390,7 @@ export async function runCp(commandName = 'desktop') {
13891390 [
13901391 msgLine ,
13911392 ` Legend: {${ C . add } -fg}[+]{/} add {${ C . remove } -fg}[-]{/} remove {${ C . accent } -fg}[*]{/} on desktop | {${ C . npm } -fg}NPM{/} registry {${ C . git } -fg}GIT{/} repo {${ C . local } -fg}LOC{/} workspace | {${ C . warn } -fg}WRN{/} untrusted` ,
1392- ` Shortcuts: ↑↓ Space toggle ${ keyHint ( '1' ) } ${ keyHint ( '2' ) } ${ keyHint ( '3' ) } tabs ${ saveShortcut } ${ keyHint ( 'd' ) } server ${ keyHint ( 'O' ) } sort ${ keyHint ( 'm' ) } menu ${ keyHint ( 'u' ) } updates ${ keyHint ( 'r' ) } refresh ${ keyHint ( 'q' ) } quit` ,
1393+ ` Shortcuts: ↑↓ Space toggle ${ keyHint ( '1' ) } ${ keyHint ( '2' ) } ${ keyHint ( '3' ) } tabs ${ saveShortcut } ${ keyHint ( 'd' ) } server ${ keyHint ( 'O' ) } sort ${ keyHint ( 'm' ) } menu ${ keyHint ( 'u' ) } updates ${ keyHint ( 'r' ) } refresh ${ keyHint ( 'n' ) } new ${ keyHint ( ' q') } quit` ,
13931394 ] . join ( '\n' ) ,
13941395 )
13951396 }
@@ -2037,6 +2038,9 @@ export async function runCp(commandName = 'desktop') {
20372038 refreshTerminalUi ( )
20382039 }
20392040 break
2041+ case 'create' :
2042+ process . exit ( 10 )
2043+ break
20402044 case 'quit' :
20412045 process . exit ( 0 )
20422046 break
@@ -2724,30 +2728,35 @@ export async function runCp(commandName = 'desktop') {
27242728 installWizardList . setItems (
27252729 installWizardOptions . map ( ( opt ) => {
27262730 const prefix =
2727- opt . kind === 'npm' ? `{${ C . npm } -fg}NPM{/}` : `{${ C . git } -fg}GIT{/}`
2731+ opt . kind === 'npm' ? `{${ C . npm } -fg}NPM{/}` : opt . kind === 'local' ? `{ ${ C . local } -fg}LOC{/}` : `{${ C . git } -fg}GIT{/}`
27282732 return `${ prefix } ${ opt . label } `
27292733 } ) ,
27302734 )
27312735 let defaultIdx = 0
2732- const lastId = settings . lastInstallChoiceId
2733- if ( lastId ) {
2734- let found = installWizardOptions . findIndex ( ( opt ) => opt . id === lastId )
2735- if ( found >= 0 ) {
2736- defaultIdx = found
2737- } else {
2738- const isSsh = lastId . includes ( 'ssh' )
2739- const isHttps = lastId . includes ( 'https' )
2740- const isNpm = lastId === 'npm'
2741- if ( isNpm ) {
2742- found = installWizardOptions . findIndex ( ( opt ) => opt . id === 'npm' )
2743- if ( found >= 0 ) defaultIdx = found
2736+ const isLocalAvailable = installWizardOptions . some ( ( opt ) => opt . id === 'local' )
2737+ if ( isLocalAvailable ) {
2738+ defaultIdx = installWizardOptions . findIndex ( ( opt ) => opt . id === 'local' )
2739+ } else {
2740+ const lastId = settings . lastInstallChoiceId
2741+ if ( lastId ) {
2742+ let found = installWizardOptions . findIndex ( ( opt ) => opt . id === lastId )
2743+ if ( found >= 0 ) {
2744+ defaultIdx = found
27442745 } else {
2745- found = installWizardOptions . findIndex ( ( opt ) => {
2746- if ( isSsh && opt . protocol === 'ssh' ) return true
2747- if ( isHttps && opt . protocol === 'https' ) return true
2748- return false
2749- } )
2750- if ( found >= 0 ) defaultIdx = found
2746+ const isSsh = lastId . includes ( 'ssh' )
2747+ const isHttps = lastId . includes ( 'https' )
2748+ const isNpm = lastId === 'npm'
2749+ if ( isNpm ) {
2750+ found = installWizardOptions . findIndex ( ( opt ) => opt . id === 'npm' )
2751+ if ( found >= 0 ) defaultIdx = found
2752+ } else {
2753+ found = installWizardOptions . findIndex ( ( opt ) => {
2754+ if ( isSsh && opt . protocol === 'ssh' ) return true
2755+ if ( isHttps && opt . protocol === 'https' ) return true
2756+ return false
2757+ } )
2758+ if ( found >= 0 ) defaultIdx = found
2759+ }
27512760 }
27522761 }
27532762 }
@@ -3217,6 +3226,10 @@ export async function runCp(commandName = 'desktop') {
32173226 if ( menuOpen ) closeMenu ( )
32183227 else openMenu ( )
32193228 } )
3229+ screen . key ( [ 'n' , 'N' ] , ( ) => {
3230+ if ( settingsOpen || installWizardOpen || sortPickerOpen || menuOpen || confirmDialogOpen ) return
3231+ process . exit ( 10 )
3232+ } )
32203233 screen . key ( [ 'd' , 'D' ] , ( ) => {
32213234 if ( ! overlayBlocksKeys ( ) ) {
32223235 if ( isDevServerUp ( ) ) stopDevServer ( )
0 commit comments