@@ -87,21 +87,21 @@ export class QwcWorkspace extends observeState(QwcHotReloadElement) {
8787 .mainMenuBarButtons {
8888 display: flex;
8989 align-items: center;
90- width: 100%;
9190 }
9291
9392 .mainMenuBarTitle {
9493 font-size: large;
9594 color: var(--lumo-contrast-50pct);
9695 user-select: none;
9796 cursor: pointer;
97+ width: 100%;
98+ text-align: center;
9899 }
99100
100101 .mainMenuBarActions {
101102 display: flex;
102103 align-items: center;
103104 gap: 0.5rem;
104- width: 100%;
105105 justify-content: end;
106106 padding-right: 10px;
107107 }
@@ -325,7 +325,7 @@ export class QwcWorkspace extends observeState(QwcHotReloadElement) {
325325
326326 _renderActionResult ( ) {
327327 if ( this . _actionResult && this . _actionResult . content && this . _actionResult . displayType === "raw" ) {
328- return html `< div class ="actionResult "> ${ this . _actionResult . content } ${ this . _renderAssistantWarning ( ) } </ div > ` ;
328+ return html `< div class ="actionResult "> ${ this . _actionResult . content } </ div > ${ this . _renderAssistantWarning ( ) } ` ;
329329 } else if ( this . _actionResult && this . _actionResult . content && this . _actionResult . displayType === "code" ) {
330330 // TODO: We can not assume the mode is the same as the input
331331 // Maybe return name|content ?
@@ -360,7 +360,7 @@ export class QwcWorkspace extends observeState(QwcHotReloadElement) {
360360 _renderActions ( ) {
361361 if ( this . _filteredActions ) {
362362 if ( this . _showActionProgress ) {
363- return html `< vaadin-progress-bar indeterminate > </ vaadin-progress-bar > ` ;
363+ return html `< vaadin-progress-bar style =" width:400px; " indeterminate > </ vaadin-progress-bar > ` ;
364364 } else {
365365 return html `< div class ="actions ">
366366 < vaadin-menu-bar .items ="${ this . _filteredActions } " theme ="dropdown-indicators tertiary " @item-selected ="${ ( e ) => this . _actionSelected ( e ) } "> </ vaadin-menu-bar >
@@ -479,6 +479,21 @@ export class QwcWorkspace extends observeState(QwcHotReloadElement) {
479479 content :newWorkspaceItemValue ,
480480 type :this . _selectedWorkspaceItem . type } ) . then ( jsonRpcResponse => {
481481
482+ if ( ! ( 'content' in jsonRpcResponse . result . result ) || ! ( 'name' in jsonRpcResponse . result . result ) ) {
483+ const firstEntry = Object . entries ( jsonRpcResponse . result . result ) . find (
484+ ( [ key ] ) => key !== 'path' && key !== 'name'
485+ ) ;
486+ if ( firstEntry ) {
487+ const [ key , value ] = firstEntry ;
488+ if ( ! ( 'content' in jsonRpcResponse . result . result ) ) {
489+ jsonRpcResponse . result . result . content = value ;
490+ }
491+ if ( ! ( 'name' in jsonRpcResponse . result . result ) ) {
492+ jsonRpcResponse . result . result . name = key ;
493+ }
494+ }
495+ }
496+
482497 if ( e . detail . value . display === "notification" ) {
483498 notifier . showInfoMessage ( jsonRpcResponse . result . result ) ;
484499 } else if ( e . detail . value . display === "replace" ) {
@@ -489,7 +504,11 @@ export class QwcWorkspace extends observeState(QwcHotReloadElement) {
489504 this . _selectedWorkspaceItem . isAssistant = jsonRpcResponse . result ?. isAssistant ?? false ;
490505 } else if ( e . detail . value . display !== "nothing" ) {
491506 this . _actionResult = jsonRpcResponse . result . result ;
492- this . _actionResult . name = this . _actionResult . path ;
507+ if ( jsonRpcResponse . result . result . name ) {
508+ this . _actionResult . name = jsonRpcResponse . result . result . name ;
509+ } else {
510+ this . _actionResult . name = this . _actionResult . path ;
511+ }
493512 this . _actionResult . path = jsonRpcResponse . result . path ;
494513 this . _actionResult . display = e . detail . value . display ;
495514 this . _actionResult . isAssistant = jsonRpcResponse . result ?. isAssistant ?? false ;
0 commit comments