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

Showcase refactor and additions #930

Merged
merged 7 commits into from
Jun 27, 2024
Merged

Conversation

victorlin
Copy link
Member

@victorlin victorlin commented Jun 21, 2024

preview

Description of proposed changes

Small fixes - see commit messages.

Related issue(s)

Checklist

Cards are already required to have an image, as reflected in
static-site/src/components/Showcase/types.ts.
@victorlin victorlin self-assigned this Jun 21, 2024
@nextstrain-bot nextstrain-bot temporarily deployed to nextstrain-s-victorlin--7dxrsz June 21, 2024 23:59 Inactive
This was referenced Jun 22, 2024
@victorlin victorlin temporarily deployed to nextstrain-s-victorlin--7dxrsz June 22, 2024 00:32 Inactive
@victorlin victorlin requested review from trvrb and jameshadfield June 22, 2024 00:32
@victorlin victorlin marked this pull request as ready for review June 22, 2024 00:32
@victorlin victorlin changed the title Showcase refactor Showcase refactor and additions Jun 22, 2024
Copy link
Member

@jameshadfield jameshadfield left a comment

Choose a reason for hiding this comment

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

Scanned through the code / used the review app and this looks good to me, barring the one in-line comment. (I preferred left-aligned dangling rows, contrary to the majority.)

Now that the showcase is expandable, it's appropriate to add more
entries.
The width of every column is a fixed value.
The percentage value isn't factored in to clientHeight, which is a value
that is used to calculate the total height of the expanded showcase.

This subtlety isn't very noticeable with 1% + white space on the border
of the current CardComponent. It is more apparent at larger percents and
with other work involving a CardComponent that uses a colored border,
which was being cut off in the expanded showcase.
It doesn't make sense to keep card-specific height and styles with the
Showcase component which accepts an arbitrary CardComponent. These
should be defined wherever Showcase is used.
@victorlin victorlin force-pushed the victorlin/showcase-refactor branch from cdce492 to e71d5e1 Compare June 24, 2024 22:46
@victorlin victorlin temporarily deployed to nextstrain-s-victorlin--7dxrsz June 24, 2024 22:46 Inactive
Copy link
Member Author

Choose a reason for hiding this comment

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

Re: #930 (review)

(I preferred left-aligned dangling rows, contrary to the majority.)

I also prefer left-aligned dangling rows (which is what prompted using CSS grid here). That makes it a tie, and since left-aligned is the current behavior on nextstrain.org, I've updated this PR to keep it. The other reason I had changed to flexbox here was to avoid passing the width as a prop since it's required for CSS grid. This PR now keeps CSS grid and passes the width as a prop, which isn't terrible since the height is already necessary for different reasons.

Copy link
Member

Choose a reason for hiding this comment

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

I also prefer left-aligned dangling rows.

@victorlin victorlin merged commit f827221 into master Jun 27, 2024
7 checks passed
@victorlin victorlin deleted the victorlin/showcase-refactor branch June 27, 2024 18:07
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.

Add mumps and EV-D68 to /pathogens showcase
5 participants