diff --git a/dist/think-editor.css b/dist/think-editor.css index a429b5a..2b536cd 100644 --- a/dist/think-editor.css +++ b/dist/think-editor.css @@ -174,6 +174,17 @@ input { align-items: start; } + & #jj-buttons { + display: flex; + justify-content: end; + gap: var(--spacing); + margin: 0; + + & #start-commit-button { + width: 10em; + } + } + & #make-log { & > pre { max-width: 20em; diff --git a/src/App.elm b/src/App.elm index aeb92c6..f2a9d2e 100644 --- a/src/App.elm +++ b/src/App.elm @@ -134,6 +134,7 @@ type Msg | SetCommitMessage String | JJCommit | JJCommitResponse (Result Http.Error CommandResult) + | JJPush init : JE.Value -> (Model, Cmd Msg) init flags = (load_flags flags, reload_log) @@ -301,6 +302,11 @@ update msg model = case msg of Ok (Ok res) -> { model | log = MakeResult res.stdout res.stderr } |> nocmd Ok (Err errmsg) -> { model | log = MakeError errmsg } |> nocmd Err err -> { model | log = HttpError err } |> nocmd + + JJPush -> + update + (RunCommand "jj bookmark set main -r @- && jj git push -b main --allow-new") + model NoOp -> (model, Cmd.none) @@ -493,12 +499,21 @@ main_nav model = ] else H.text "" - , H.button - [ HA.id "start-commit-button" - , HA.type_ "button" - , HE.onClick ShowCommitModal - ] - [ H.text "Commit" ] + , H.p + [ HA.id "jj-buttons" ] + [ H.button + [ HA.id "start-commit-button" + , HA.type_ "button" + , HE.onClick ShowCommitModal + ] + [ H.text "Commit" ] + , H.button + [ HA.id "jj-push-button" + , HA.type_ "button" + , HE.onClick JJPush + ] + [ H.text "Push" ] + ] ] ]