1- module Ucm.WorkspaceScreen exposing (..)
1+ port module Ucm.WorkspaceScreen exposing (..)
22
33import Browser
44import Code.BranchRef as BranchRef
55import Code.CodebaseTree as CodebaseTree
66import Code.Config
77import Html exposing (Html , div , text )
8- import Html.Attributes exposing (class )
8+ import Html.Attributes exposing (class , id )
9+ import Lib.Util as Util
910import RemoteData exposing (RemoteData (..) )
1011import UI.AnchoredOverlay as AnchoredOverlay
1112import UI.Button as Button
@@ -72,6 +73,7 @@ init appContext workspaceContext =
7273 , Cmd . batch
7374 [ Cmd . map CodebaseTreeMsg codebaseTreeCmd
7475 , Cmd . map WorkspacePanesMsg panesCmd
76+ , Util . delayMsg 5000 OpenTerminal
7577 ]
7678 )
7779
@@ -88,6 +90,7 @@ type Msg
8890 | ToggleSidebar
8991 | ToggleRightPane
9092 | RefreshCodebase
93+ | OpenTerminal
9194 | Keydown KeyboardEvent . KeyboardEvent
9295 | CodebaseTreeMsg CodebaseTree . Msg
9396 | WorkspacePanesMsg WorkspacePanes . Msg
@@ -104,6 +107,9 @@ type OutMsg
104107update : AppContext -> Msg -> Model -> ( Model , Cmd Msg , OutMsg )
105108update appContext msg model =
106109 case msg of
110+ OpenTerminal ->
111+ ( model, openTerminal " terminal-pane" , None )
112+
107113 CodebaseTreeMsg codebaseTreeMsg ->
108114 let
109115 ( codebaseTree, codebaseTreeCmd, outMsg ) =
@@ -388,6 +394,13 @@ update appContext msg model =
388394
389395
390396
397+ -- PORTS
398+
399+
400+ port openTerminal : String -> Cmd msg
401+
402+
403+
391404-- SUBSCRIPTIONS
392405
393406
@@ -538,7 +551,10 @@ view appContext model =
538551 window_
539552
540553 content =
541- [ Html . map WorkspacePanesMsg ( WorkspacePanes . view model. panes) ]
554+ [ Html . map WorkspacePanesMsg
555+ ( WorkspacePanes . view model. panes)
556+ , div [ id " terminal-pane" ] []
557+ ]
542558 in
543559 window__
544560 |> Window . withTitlebarLeft ( titlebarLeft model)
0 commit comments