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

feat: display session details in session page Renku 2.0 #3258

Merged
merged 3 commits into from
Aug 26, 2024

Conversation

andre-code
Copy link
Contributor

@andre-code andre-code commented Jul 29, 2024

PR to address small issues in Renku v2

Issues:

  • Display Launcher names in session page
  • When I go to Resources in a Renku 2.0 session, I see the cheat sheet for the Renku CLI (this should be removed)

What is included in this PR:

  • Show the project name and launcher name in the session view navbar title.
  • Open a modal with project name and session details when the title in the navbar is clicked.
  • Remove the Resources Modal, so only session log modal is displayed on the session page.

session view changes

/deploy

@RenkuBot
Copy link
Contributor

You can access the deployment of this PR at https://renku-ci-ui-3258.dev.renku.ch

@andre-code andre-code changed the base branch from main to lorenzo/bootstrap-design July 29, 2024 12:43
Base automatically changed from lorenzo/bootstrap-design to main July 30, 2024 09:05
@andre-code andre-code force-pushed the andrea/issues-renku-2.0 branch 2 times, most recently from 5e10098 to 2f82d5c Compare July 30, 2024 10:27
@andre-code andre-code changed the title [WIP] feat: fix small issues v2 feat: display session details in session page Renku 2.0 Jul 30, 2024
@andre-code andre-code marked this pull request as ready for review July 30, 2024 15:08
@andre-code andre-code requested a review from a team as a code owner July 30, 2024 15:08
Copy link
Member

@lorenzo-cavazzi lorenzo-cavazzi left a comment

Choose a reason for hiding this comment

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

Nice changes!

The code looks overall good, but there are a few details that require adjustments before merging -- see inline comments.

)}
>
<div className={cx("px-3", "text-white")}>{sessionName}</div>
<div className={cx("px-3", "text-truncate")}>
Copy link
Member

Choose a reason for hiding this comment

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

This is to adjust the vertical alignment -- the difference is subtle

Suggested change
<div className={cx("px-3", "text-truncate")}>
<div className={cx("d-flex", "px-3", "text-truncate")}>

@@ -220,10 +232,17 @@ export default function ShowSessionPage() {
"d-flex",
"flex-grow-1",
"justify-content-between",
"py-2"
"py-2",
"text-truncate"
Copy link
Member

Choose a reason for hiding this comment

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

text-truncate is actually a good idea here 👍

I suggest adjusting this and the two children components to improve the UX. I see the following 2 problems:

  • With the vertical padding here and no padding in the button for opening the modal, the vertical clickable area is reduced.
    image
    Removing the padding here and leaving the button padding would be better. You can adjust the icon position by playing with align-items-center.

  • (nitpick) There is a bigger gap between the text and the logo when the space is tight
    image
    After addressing the previous point, you might need to change the padding in the icon. You probably need only the right padding (pe-3, depending on the other code changes).

slug: project?.slug,
});

if (isLoadingLaunchers || isLoadingProject) return <Loader />;
Copy link
Member

Choose a reason for hiding this comment

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

The big bouncing dots here aren't ideal. They also show up in a dark color (see video).
Peek 2024-08-13 10-36
A small white loader would probably be enough. But feel free to change it further if you feel you can make it better (perhaps a short text, something like Checking session details?)

>
<Journals className="bi" />
<span className="visually-hidden">Resources</span>
<FileEarmarkText className={cx("bi", "me-1")} />
Copy link
Member

Choose a reason for hiding this comment

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

The me-1 class adds an unnecessary black space on the right

Suggested change
<FileEarmarkText className={cx("bi", "me-1")} />
<FileEarmarkText className="bi" />

image

});

if (isLoadingLaunchers || isLoadingProject) return <Loader />;
if (launchersError || !launcher) return <i>Session not accessible</i>;
Copy link
Member

Choose a reason for hiding this comment

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

This can also be improved
image

I suggest putting it into a text element (like a <p>) styling it to have no bottom margin, white text color, and italics. Optional: add a warning icon at the beginning of the text.

const detailsModal = project && session && projectUrl && (
<Modal backdrop="static" centered isOpen={isOpen} size="lg" toggle={toggle}>
<ModalHeader toggle={toggle}>Session details {launcher.name}</ModalHeader>
<ModalBody>
Copy link
Member

Choose a reason for hiding this comment

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

The spacing is a little messed up here: you always add the class mb-2 to the divs, but sometimes they contain a single p child with a bigger bottom margin (equivalent to mb-3) making the class useless, while in other cases the margin is applied but other components add additional vertical margins (see CommandCopy).

I suggest:

  • Remove the margins within the child components. Depending on the case, you might drop the div entirely leaving a p className="mb-0", or drop the mb-2 on the div, or use properties to remove the margins like in <CommandCopy noMargin ... />.
  • Handle the spacing between the children at the parent component by adding d-flex, flex-column, gap-3

@lorenzo-cavazzi lorenzo-cavazzi self-assigned this Aug 13, 2024
Show session name in show session page and open session details, remove docs and cheat sheet modal
@andre-code
Copy link
Contributor Author

Thank you, @lorenzo-cavazzi, for your review and suggestions. I've applied those changes in the latest commit. They make a lot of sense!

Copy link
Member

@lorenzo-cavazzi lorenzo-cavazzi left a comment

Choose a reason for hiding this comment

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

Looks great! Just a tiny detail before merging

Comment on lines 476 to 483
className={cx(
"d-block",
"d-lg-flex",
"pb-2",
"pb-lg-0",
"gap-2",
"align-items-center"
)}
Copy link
Member

Choose a reason for hiding this comment

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

No need to add additional space on the bottom since the spacing is already handled by the parent component with gap-3

Suggested change
className={cx(
"d-block",
"d-lg-flex",
"pb-2",
"pb-lg-0",
"gap-2",
"align-items-center"
)}
className={cx(
"d-block",
"d-lg-flex",
"gap-2",
"align-items-center"
)}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks @lorenzo-cavazzi I have removed the unnecessary style

Copy link
Member

@lorenzo-cavazzi lorenzo-cavazzi left a comment

Choose a reason for hiding this comment

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

🚀

@andre-code andre-code merged commit fce2c93 into main Aug 26, 2024
18 checks passed
@andre-code andre-code deleted the andrea/issues-renku-2.0 branch August 26, 2024 12:10
@RenkuBot
Copy link
Contributor

Tearing down the temporary RenkuLab deplyoment for this PR.

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.

3 participants