Skip to content

Commit

Permalink
Update branch graph to work better on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
jaclarke committed Jul 31, 2024
1 parent 65210aa commit 61c5d27
Show file tree
Hide file tree
Showing 2 changed files with 293 additions and 238 deletions.
109 changes: 73 additions & 36 deletions shared/common/branchGraph/branchGraph.module.scss
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
@import "@edgedb/common/mixins.scss";

.branchGraph {
.branchGraphOuter {
position: relative;
border-radius: 12px;
background: var(--branchGraphBg);
border: 1px solid var(--branchGraphBorder);
display: flex;
height: 220px;
min-width: 0;
display: flex;
overflow: hidden;
font-family: "Roboto Flex Variable", sans-serif;

--branchGraphBg: var(--Grey95, #f2f2f2);
Expand All @@ -22,6 +18,16 @@
}
}

.branchGraph {
position: relative;
border-radius: 12px;
background: var(--branchGraphBg);
border: 1px solid var(--branchGraphBorder);
display: flex;
flex-grow: 1;
overflow: hidden;
}

.migrationsPanelWrapper {
position: relative;
width: 0px;
Expand All @@ -35,18 +41,17 @@
width: 460px;
}

&:after {
content: "";
position: absolute;
left: 0;
right: 12px;
height: 16px;
bottom: 0;
background: linear-gradient(transparent, var(--panel_background));
}

.closePanelButton {
left: -48px;
width: auto;
right: calc(100% + 12px);
color: var(--secondary_text_color, #666);
font-weight: 500;
padding-right: 14px;
padding-left: 8px;
white-space: nowrap;
font-family: inherit;
font-size: 14px;
gap: 4px;

svg {
transform: rotate(-90deg);
Expand All @@ -55,6 +60,25 @@

@include darkTheme {
--panel_background: #363636;
--secondary_text_color: #b3b3b3;
}

@include isMobile {
position: absolute;
top: 0;
right: 0;
bottom: 0;
width: 100% !important;
transform: translateX(100%);
transition: transform 0.25s;

&.panelOpen {
transform: translateX(0);
}

.closePanelButton {
display: none;
}
}
}

Expand Down Expand Up @@ -92,15 +116,6 @@
min-width: 100%;
min-height: 100%;
align-items: center;
transition:
padding-right 0.2s linear,
padding-bottom 0.2s linear,
padding-top 0.2s 0.2s linear,
padding-left 0.2s 0.2s linear;

.migrationPopupOpen & {
transition: none;
}

.loading {
margin: auto;
Expand Down Expand Up @@ -151,14 +166,6 @@
}
}

.topButton {
transition: top 0.25s;

&.panelOpen {
top: 60px;
}
}

.bottomButton {
top: auto;
bottom: 12px;
Expand Down Expand Up @@ -572,14 +579,40 @@
width: 460px;
left: 0px;
height: 100%;
border-radius: 0px 12px 12px 0px;
display: flex;
flex-direction: column;
border-radius: 12px 0 0 12px;
background: var(--panel_background);
box-shadow:
0px 2px 8px rgba(0, 0, 0, 0.12),
0px 0px 2px rgba(0, 0, 0, 0.06);
z-index: 2;

.closeButton {
display: none;
}

@include isMobile {
width: 100%;

.closeButton {
display: flex;
align-self: flex-end;
margin: 12px;
margin-bottom: 6px;
}
}
}

.migrationsPanelInner {
overflow-y: auto;
overscroll-behavior: contain;
z-index: 2;
mask-image: linear-gradient(
transparent,
#000 16px,
#000 calc(100% - 16px),
transparent
);

.panelScrollWrapper {
display: flex;
Expand Down Expand Up @@ -769,6 +802,10 @@
background: var(--app_panel_background, #f7f7f7);
}

&:first-child {
margin-top: 12px;
}

.body {
overflow: hidden;
mask-image: linear-gradient(-90deg, transparent, #000 16px, #000);
Expand Down
Loading

0 comments on commit 61c5d27

Please sign in to comment.