Skip to content

Commit

Permalink
web: Make scrollable table more discoverable
Browse files Browse the repository at this point in the history
Relying in the Lea Verou technique described at
https://lea.verou.me/blog/2012/04/background-attachment-local. It makes
the scrollable table a bit more evident, but still feeling as a
workaround.
  • Loading branch information
dgdavid committed May 2, 2024
1 parent e77b83a commit e2ae65d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
7 changes: 5 additions & 2 deletions web/src/assets/styles/composition.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@
display: flex;
flex-direction: column;
flex: 1 1 0;
gap: 0
}

form > div:first-child {
min-block-size: 120px;
form > div:nth-child(2) {
overflow-y: auto;
min-block-size: 120px;
margin-block-end: var(--spacer-medium);
table { background: transparent; }
}

form > div:last-child {
Expand Down
12 changes: 12 additions & 0 deletions web/src/assets/styles/utilities.scss
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,18 @@
max-inline-size: calc(var(--ui-max-inline-size) + var(--spacer-large))
}

.scrollbox {
background:
linear-gradient(#fff 33%, rgb(255 255 255 / 0%)),
linear-gradient(rgb(255 255 255 / 0%), #fff 66%) 0 100%,
radial-gradient(farthest-side at 50% 0, rgb(102 102 102 / 50%), rgb(0 0 0 / 0%)),
radial-gradient(farthest-side at 50% 100%, rgba(102 102 102 / 50%), rgb(0 0 0 / 0%)) 0 100%;
background-color: #fff;
background-repeat: no-repeat;
background-attachment: local, local, scroll, scroll;
background-size: 100% 48px, 100% 48px, 100% 16px, 100% 16px;
}

.height-75 {
height: 75dvh;
}
Expand Down
6 changes: 4 additions & 2 deletions web/src/components/storage/VolumeLocationDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ export default function VolumeLocationDialog({
{...props}
>
<Form id="volume-location-form" onSubmit={onSubmit}>
<FormReadOnlyField label={_("Select in which device to allocate the file system")}>
{ /** FIXME: Rename FormReadOnlyField */}
<FormReadOnlyField label={_("Select in which device to allocate the file system")} />
<div className="scrollbox">
<VolumeLocationSelectorTable
aria-label={_("Select a location")}
devices={volumeDevices}
Expand All @@ -155,7 +157,7 @@ export default function VolumeLocationDialog({
initialExpandedKeys={volumeDevices.map(d => d.sid)}
variant="compact"
/>
</FormReadOnlyField>
</div>
<FormGroup label={_("Select how to allocate the file system")}>
<div className="stack">
<Radio
Expand Down

0 comments on commit e2ae65d

Please sign in to comment.