Skip to content

Add collapse, empty states and deep linking to group by #6498

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

Merged
merged 1 commit into from
Jun 25, 2025

Conversation

vbustamante
Copy link
Contributor

How does this PR change the system?

  • Makes component groups collapsible by the user
  • Stores the groupby criteria on the URL so a user can link to specific UI states
  • Shows empty groups with the new design

Screenshots:

image

@github-actions github-actions bot added the A-web label Jun 25, 2025
Copy link

github-actions bot commented Jun 25, 2025

Dependency Review

✅ No vulnerabilities or OpenSSF Scorecard issues found.

Scanned Files

None

Comment on lines 984 to 1005
watch([groupBySelection], () => {
const query: SelectionsInQueryString = {
...router.currentRoute.value?.query,
};
delete query.map;
delete query.groupBy;

query.grid = "1";
router.push({ query });

if (groupBySelection.value === GroupByCriteria.Diff) {
query.groupBy = "diff";
} else if (groupBySelection.value === GroupByCriteria.Qualification) {
query.groupBy = "qual";
} else if (groupBySelection.value === GroupByCriteria.Upgrade) {
query.groupBy = "upgr";
}

router.push({
query,
});
});

Copy link
Contributor

Choose a reason for hiding this comment

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

Such a clean and elegant watcher!

@vbustamante vbustamante force-pushed the nick-and-victor/eng-3082-part-2 branch from f44afc6 to 86ee105 Compare June 25, 2025 19:02
Comment on lines +492 to +494
"Failed qualifications": [],
Warnings: [],
"Passed qualifications": [],
Copy link
Contributor

Choose a reason for hiding this comment

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

Intentional ordering

delete query.map;
delete query.groupBy;

query.grid = "1";
Copy link
Contributor

Choose a reason for hiding this comment

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

Note: when you share the link you also need to be sent to the grid rather than the map. This handles that.

case "running":
return "Running";
return "Running qualifications";
Copy link
Contributor

Choose a reason for hiding this comment

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

"Running" is not real and will die in a follow up PR. This is from before qualifications were on the prop tree... might be like... since late 2022 😅. For now, we'll keep it since we discovered this right as we were wrapping it. It is harmless.

const getQualificationStatusTitle = (component: ComponentInList) => {
const status = getQualificationStatus(component);
switch (status) {
case "success":
return "Passed";
return "Passed qualifications";
Copy link
Contributor

Choose a reason for hiding this comment

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

Note: the section titles and icons are intentional and match what we have discussed.

@@ -265,6 +265,7 @@ export type SelectionsInQueryString = Partial<{
map: string;
grid: string;
c: string;
groupBy: "diff" | "qual" | "upgr";
Copy link
Contributor

Choose a reason for hiding this comment

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

These are the first four characters of each type. We may go down to one character or change this in the future, but we wanted something that could be backwards compatible to start.

Comment on lines +166 to +170
// Handle the very first time everything is loaded. We want empty sections to begin collapsed
// and non-empty sections to be expanded by default.
if (collapsed === undefined) {
collapsed = count === 0;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Here's the deal: this was originally a "toggle", but we needed to handle a ternary state. By default, empty sections needed to be collapsed and non-empty sections needed to be expanded. So, this is how we handle that.

Comment on lines +68 to +70
<div v-else>
<!-- footer area -->
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

Subtle, but important to have a div here.

@vbustamante vbustamante force-pushed the nick-and-victor/eng-3082-part-2 branch from 86ee105 to 0cb9741 Compare June 25, 2025 19:04
Co-authored-by: Victor Bustamante <victor@systeminit.com>
Signed-off-by: Nick Gerace <nick@systeminit.com>
@vbustamante vbustamante force-pushed the nick-and-victor/eng-3082-part-2 branch from 54ec15f to 67e2416 Compare June 25, 2025 19:14
@vbustamante vbustamante enabled auto-merge June 25, 2025 19:20
Copy link
Contributor

@jobelenus jobelenus left a comment

Choose a reason for hiding this comment

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

Excellent router query work

@vbustamante vbustamante added this pull request to the merge queue Jun 25, 2025
Merged via the queue into main with commit 67acc58 Jun 25, 2025
10 checks passed
@vbustamante vbustamante deleted the nick-and-victor/eng-3082-part-2 branch June 25, 2025 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy