Deployment details page is not mobile friendly
Description
Deployment Details page for the environment does not render well on mobile screens:
Steps to reproduce
-
Create a project and add the following
.gitlab-ci.yamlfilestages: - deploy image: alpine:latest deploy-prod: stage: deploy script: - sleep 10 - echo "deploying prod" environment: name: production url: postgres://example.com when: manual deploy-staging: stage: deploy script: - echo "deploying staging" environment: name: staging url: https://example.com when: manual -
Run the pipeline to create an environment and deployments.
-
Enable the feature flag
deployment_details_page -
Locate your deployment on Operate -> Environments -> Production
-
Click on the status badge to open the Deployment details page
-
Resize browser window to small size or turn on mobile emulation in the browser's dev tools
Proposal
See the UX Proposal in the designs section.
Implementation guide
There's a deployment_aside component that is working well on the desktops. We are going to update this component to act as a collapsible sidebar on mobiles and tablets.
To fix the layout for smaller screens:
- Update
show_deploymentcomponent.
Currently, the main content hasgl-w-9/10class to separate the content from the sidebar on the desktop. We can simplify this by removing thegl-w-9/10class and addinglg:gl-pr-5to the container instead. - Fix
deployment_headercomponent by addinggl-flex-wrapto the content container.
To create a collapsible sidebar:
Work with deployment_aside component.
Important: the component will serve both collapsible sidebar for mobiles and static sidebar for desktops. Make sure to check it still works as expected on both and handles the resize.
Example of a similar implementation for reference: issuable_sidebar_root
-
Add a toggle button similar to the
issuable_sidebar_root- the button should have
tertiarycategory when the sidebar is expanded andsecondarycategory when the sidebar is collapsed. Use computed for this. - the button should be hidden on desktops. Use
lg:gl-hiddenclass for this. - the button should be left-aligned. We can use a combination of
gl-flexandgl-ml-autoclasses for this. - the icon, title, and aria-label should be updated accordingly to the sidebar state. This logic is similar to the reference.
- the button should have
-
Add styles to the
asideelement (this is suggestion, there might be better options):- we can have
gl-p-4by default - no extra styles for the desktop
-
gl-shadow-md right-sidebar right-sidebar-expandedfor sidebar expanded -
gl-fixed gl-right-0for sidebar collapsed
- we can have
-
When the sidebar is expanded, the content should be separated into 3 sections. Use proper padding and border for this (
gl-border-b-solid gl-border-b-1 gl-border-gray-100). Make sure to remove the borders for desktop. -
Handle resizes similar to how it's done in the reference:
-
window.addEventListener('resize', this.handleWindowResize);on mount -
window.removeEventListener('resize', this.handleWindowResize);before destroy
-
-
Update the related tests.
