File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
frontend/src/features/editor/services Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -18,12 +18,20 @@ export async function openFile(filepath: string) {
1818 const id = `file:${ filepath } ` ;
1919 const filename = filepath . split ( "/" ) . pop ( ) ;
2020
21- if ( ! untrack ( dockview ) . getPanel ( id ) ) {
22- untrack ( dockview ) . addPanel ( {
21+ const dockview_ = untrack ( dockview ) ;
22+ if ( ! dockview_ . getPanel ( id ) ) {
23+ const nearestPanel = dockview_ . panels . find ( ( p ) => p . id != "output" ) ??
24+ dockview_ . activePanel ;
25+ const isNearestPanelOutput = dockview_ . activePanel . id == "output" ;
26+
27+ dockview_ . addPanel ( {
2328 id,
2429 component : "code" ,
2530 title : filename ,
26- position : { direction : "above" , referencePanel : "output" } ,
31+ position : {
32+ direction : isNearestPanelOutput ? "above" : "within" ,
33+ referencePanel : nearestPanel ,
34+ } ,
2735 } ) ;
2836 }
2937}
You can’t perform that action at this time.
0 commit comments