Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Space policy UI #883

Merged
merged 31 commits into from
Nov 30, 2023
Merged

Space policy UI #883

merged 31 commits into from
Nov 30, 2023

Conversation

jreidinger
Copy link
Contributor

@jreidinger jreidinger commented Nov 21, 2023

Problem

There is already support in backend for space policy for storage proposal, but UI is missing.

Solution

Implement UI.

What is missing:

  • Good representation of the affected devices at the form (including some code refactoring at device-utils.jsx)
  • Better font layout and style
  • Improve wording
  • Support for singular / plural (number of affected devices)

Testing

What is missing:

  • Manual tests of a full installation (maybe better done after merging, together with other stuff currently at integration phase)
  • Unit tests

Screenshots

space

police

@dgdavid

This comment was marked as outdated.

Copy link
Contributor

@mvidner mvidner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only adjusting the user visible texts, and proposing explanations for them, to be shown optionally, somehow

web/src/components/storage/ProposalSettingsSection.jsx Outdated Show resolved Hide resolved
onClick={selectResize}
/>
<ToggleGroupItem
text={_("Keep Existing")}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
text={_("Keep Existing")}
text={_("Keep Everything")}

Help text

Existing partitions and their data* will not be touched. There needs to be enough unpartitioned space on the target disk already.

*: If there is an EFI boot partition, its contents will be modified to allow booting the system being installed.

am I correct in this?

web/src/components/storage/ProposalSettingsSection.jsx Outdated Show resolved Hide resolved
const SpacePolicySettingsButton = () => {
return (
<Tooltip
content={_("Configure the Space Policy")}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go! For!! Mars!!! (SCNR)

Maybe use Storage Space (Policy) instead of just Space (Policy)? Everywhere?

web/src/components/storage/ProposalSettingsSection.jsx Outdated Show resolved Hide resolved
web/src/components/storage/ProposalSettingsSection.jsx Outdated Show resolved Hide resolved
);
};

if (isLoading) return <Skeleton width="25%" />;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it could be moved to the top of SpacePolicyField, an early return

@coveralls
Copy link

coveralls commented Nov 24, 2023

Coverage Status

coverage: 75.62% (+0.05%) from 75.573%
when pulling 34b8d49 on space_policy_ui
into 888aa22 on master.

@dgdavid

This comment was marked as outdated.

@dgdavid

This comment was marked as outdated.

@dgdavid

This comment was marked as outdated.

@dgdavid

This comment was marked as outdated.

web/src/client/storage.js Show resolved Hide resolved
web/src/components/storage/device-utils.jsx Show resolved Hide resolved
web/src/client/storage.js Outdated Show resolved Hide resolved
joseivanlopez and others added 5 commits November 29, 2023 12:41
To make it possible reusing the same code for rendering either, a list
or a selector. There is room for improvements yet, but it should be
enough for now to avoid having list marked as "listbox" with elements
set as "role=option".

This change also proposes a different way to style them, avoiding
setting a grid by default for each type of selector since it's not
always the case. E.g., the space policy selector has a so simple layout.
In any case, this is a subject for changes in the short term since
selectors must be reworked ASAP.
@dgdavid
Copy link
Contributor

dgdavid commented Nov 29, 2023

@ancorgs, @mvidner, @joseivanlopez,

I've sent a few commits. I think the space policy dialog looks better now, let me know if there is something you believe should be changed for accepting this PR from the UI perspective.

Remember that in general selectors need more love, but it deserves a separated PR.

BTW, I did a last change but didn't send it because it's something I'd do once #881 and this PR are merged. It's about making selectors more compact by dropping the space between their options. If you are curious, see below the diff and a few screenshots

Click to show/hide the screenshots

Screenshot from 2023-11-29 20-22-00
Screenshot from 2023-11-29 20-21-42
Screenshot from 2023-11-29 20-21-37

Click to show/hide the (NOT SENT) diff
diff --git a/web/src/assets/styles/blocks.scss b/web/src/assets/styles/blocks.scss
index 30ac1f73..7218d7ce 100644
--- a/web/src/assets/styles/blocks.scss
+++ b/web/src/assets/styles/blocks.scss
@@ -267,11 +267,21 @@ span.notification-mark[data-variant="sidebar"] {
 ul[data-type="agama/list"] {
   li {
     border: 2px solid var(--color-gray-dark);
-    border-radius: 5px;
     padding: var(--spacer-normal);
     text-align: start;
     background: var(--color-gray-light);
-    margin-block-end: var(--spacer-small);
+
+    &:first-child {
+      border-radius: 5px 5px 0 0;
+    }
+
+    &:last-child {
+      border-radius: 0 0 5px 5px;
+    }
+
+    &:nth-child(n+2) {
+      border-top: 0;
+    }
   }

@ancorgs ancorgs marked this pull request as ready for review November 30, 2023 12:22
web/src/client/storage.js Outdated Show resolved Hide resolved
</Popup>
</div>
);
};
Copy link
Contributor Author

@jreidinger jreidinger Nov 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NP: btw when I touched it I already have feeling that maybe it should be split to own component file.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would evaluate it later if this section continues growing. Right now all its *Field components are defined there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know that is why I in the end decide to keep it there as it is consistent, but start to be quite big.

They were used for styling some elements that can be styled in a
different way. In any case, we still needing something to make these div
nodes accessible since now we (sigth people) figure out what they are
because we're able to see them well distributed in the UI. But I'm not
sure what a mess it can be if something read all these information
aloud.
At this time they are not needed for placing the selectors content
properly.
Copy link
Contributor Author

@jreidinger jreidinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for me ( cannot approved as I am original author )

@joseivanlopez joseivanlopez merged commit bb1c038 into master Nov 30, 2023
2 checks passed
@joseivanlopez joseivanlopez deleted the space_policy_ui branch November 30, 2023 16:40
@imobachgs imobachgs mentioned this pull request Dec 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants