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

[WIP] Show included modules on pipeline pages #3094

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

lmReef
Copy link
Contributor

@lmReef lmReef commented Feb 19, 2025

Preview for #2722

image

@lmReef lmReef self-assigned this Feb 19, 2025
Copy link

netlify bot commented Feb 19, 2025

Deploy Preview for nf-core-main-site ready!

Name Link
🔨 Latest commit bf7b2bf
🔍 Latest deploy log https://app.netlify.com/sites/nf-core-main-site/deploys/67db8f1edbe3e9000863a9ff
😎 Deploy Preview https://deploy-preview-3094--nf-core-main-site.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mashehu
Copy link
Contributor

mashehu commented Feb 20, 2025

hmm, maybe make the "show more" button a bit more subtle, e.g. similar to how we do it in the module cards
Screenshot 2025-02-20 at 09 12 44

@lmReef
Copy link
Contributor Author

lmReef commented Feb 27, 2025

So the implementation for this in Astro is looking more scuffed than it needs to be. I think it could be better to abstract this out from the other places its implemented (module/subworkflow cards and pages) into a new svelte component so we can reuse it across all 3 places.

This approach should make it easier to maintain and fix issues like this going forward too.

I can do up a draft for now in svelte 5 and wait for #3047 before opening a new PR/updating this one. Let me know what you think.

Probably something along these lines with a few extras for handling the differences with pipelines:

<script lang="ts">
    const {
        tags,
        maxSliced = 5,
        type,
    }: { tags: string[]; maxSliced?: number; type: "modules" | "subworkflows" | "pipelines" } = $props();
    let expanded = $state(false);
</script>

<div class="tags-section mb-2">
    {#each expanded ? tags : tags.slice(0, maxSliced) as tag}
        <a
            href={`/${type}/${tag.replace("/", "_")}/`}
            class="badge fw-normal border border-info-subtle bg-info-subtle text-body me-2 text-decoration-none"
        >
            {tag}
        </a>
    {/each}
</div>
<span
    class="text-small cursor-pointer tags-show-more"
    title={`click to show all ${tags}`}
    on:click={() => (expanded = !expanded)}
    on:keydown={() => (expanded = !expanded)}
    role="button"
    data-bs-toggle="tooltip"
    data-bs-delay="500">+{tags.length - maxSliced} more {tags}</span
>

@mashehu
Copy link
Contributor

mashehu commented Feb 27, 2025

great idea!

@mashehu
Copy link
Contributor

mashehu commented Mar 4, 2025

#3047 is merged so give the component approach a shot

@lmReef
Copy link
Contributor Author

lmReef commented Mar 19, 2025

awesome! I'll get started

@github-actions github-actions bot deleted a comment from netlify bot Mar 20, 2025
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.

2 participants