Skip to content

Commit eacef0d

Browse files
committed
Ensure less jumping when changes page is loading
1 parent 40e3536 commit eacef0d

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

src/UnisonShare/Page/ProjectContributionChangesPage.elm

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -721,8 +721,8 @@ viewBranchDiff projectRef toggledChangeLines diff =
721721
]
722722

723723

724-
viewLoadingPage : PageContent Msg
725-
viewLoadingPage =
724+
viewLoadingPage : Html Msg -> PageContent Msg
725+
viewLoadingPage tabs =
726726
let
727727
shape length =
728728
Placeholder.text
@@ -733,7 +733,8 @@ viewLoadingPage =
733733
in
734734
PageContent.oneColumn
735735
[ div [ class "project-contribution-changes-page" ]
736-
[ Card.card
736+
[ tabs
737+
, Card.card
737738
[ shape Placeholder.Large
738739
, shape Placeholder.Small
739740
, shape Placeholder.Medium
@@ -744,8 +745,8 @@ viewLoadingPage =
744745
]
745746

746747

747-
viewErrorPage : AppContext -> ContributionRef -> Http.Error -> PageContent Msg
748-
viewErrorPage appContext _ err =
748+
viewErrorPage : AppContext -> ContributionRef -> Html Msg -> Http.Error -> PageContent Msg
749+
viewErrorPage appContext _ tabs err =
749750
let
750751
errorDetails =
751752
case appContext.session of
@@ -760,7 +761,8 @@ viewErrorPage appContext _ err =
760761
UI.nothing
761762
in
762763
PageContent.oneColumn
763-
[ div [ class "project-contribution-changes-page" ]
764+
[ tabs
765+
, div [ class "project-contribution-changes-page" ]
764766
[ StatusBanner.bad
765767
"Something broke on our end and we couldn't show the contribution changes. Please try again."
766768
, errorDetails
@@ -791,7 +793,7 @@ view appContext projectRef contribution model =
791793
in
792794
case model.branchDiff of
793795
BranchDiffState.Loading ->
794-
viewLoadingPage
796+
viewLoadingPage tabs
795797

796798
BranchDiffState.Computing _ ->
797799
PageContent.oneColumn
@@ -812,7 +814,7 @@ view appContext projectRef contribution model =
812814
]
813815

814816
BranchDiffState.Reloading _ ->
815-
viewLoadingPage
817+
viewLoadingPage tabs
816818

817819
BranchDiffState.Computed diff ->
818820
PageContent.oneColumn
@@ -897,4 +899,4 @@ view appContext projectRef contribution model =
897899
]
898900

899901
BranchDiffState.Failure e ->
900-
viewErrorPage appContext contribution.ref e
902+
viewErrorPage appContext contribution.ref tabs e

0 commit comments

Comments
 (0)