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

Enhancement: group nesting/subgroups #4337

Closed

Conversation

DamitusThyYeetus123
Copy link
Contributor

Proposed change

Adds Nested groups and subgroups, with the following formatting

- Group A:
  - Subgroup A:
      type: group
      services:
        - Service A:
            href: http://localhost/
  - Service B:
      href: http://localhost/

- Group B:
    - Service C:
        href: http://localhost/

Closes #2310

Type of change

  • New service widget
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Documentation only
  • Other (please explain)

Checklist:

  • If applicable, I have added corresponding documentation changes.
  • If applicable, I have reviewed the feature and / or service widget guidelines.
  • I have checked that all code style checks pass using pre-commit hooks and linting checks.
  • If applicable, I have tested my code for new features & regressions on both mobile & desktop devices, using the latest version of major browsers.

@shamoon shamoon changed the title Features: Add group nesting/subgroups Enhancement: group nesting/subgroups Nov 27, 2024
@shamoon
Copy link
Collaborator

shamoon commented Nov 27, 2024

Not to be a downer here, but can I ask what this actually accomplishes? This basically allows the user to have 1-level deeper nesting of services, ie. it adds a second level title that looks exactly the same and groups those inside a box? Also, doesnt work with docker labels

At least as is, you cannot set a different icon, use a different layout style (rows vs columns) and overall I do not find it aesthetically pleasing at all:

Screenshot 2024-11-27 at 12 15 56 AM Screenshot 2024-11-27 at 12 16 13 AM

I hate to say it but I would not merge this as-is...

@DamitusThyYeetus123
Copy link
Contributor Author

I’ll add all those changes you’ve mentioned, and i will say that I added it due to the fact that it’s the most requested non-widget feature in discussions.

@shamoon
Copy link
Collaborator

shamoon commented Nov 27, 2024

Again, most requested does not always necessarily mean belongs in this project. Sometimes features get up-voted because they've hung around for a while. I see my role as a maintainer as a steward of the project as much as anything else, i.e. to maintain its quality and keep it focused.

I worry this is going to get messy...

@DamitusThyYeetus123
Copy link
Contributor Author

I think this feature is something basic enough that it makes sense in the project. If this idea isn't wanted in the project, that's fine, but I do think that something like this would benefit the project.

@DamitusThyYeetus123
Copy link
Contributor Author

In terms of stylistic changes, i'm implementing style: row and icon: ... for subgroups.

@DamitusThyYeetus123
Copy link
Contributor Author

image
Icons done, just row/column stuff left

@DamitusThyYeetus123
Copy link
Contributor Author

image
Here is mixing columns and rows

@DamitusThyYeetus123
Copy link
Contributor Author

DamitusThyYeetus123 commented Nov 27, 2024

image
Using subgroups and header: false to mix columns and rows more seamlessly. This is very similar to what is described in #2671

@shamoon
Copy link
Collaborator

shamoon commented Nov 27, 2024

Sorry Im not happy with this PR, I'm going to close it for now and have a think about how to do this, but stuff like this is generally very poor practice:

      .filter((entry) => entry[Object.keys(entry)[0]].type == "group")
       .map((entries) => ({
         style: entries[Object.keys(entries)[0]].style,
         icon: entries[Object.keys(entries)[0]].icon,
         columns: entries[Object.keys(entries)[0]].columns,
         header: entries[Object.keys(entries)[0]].header,
         ...mappingFunc(entries, entries[Object.keys(entries)

You are iterating an object, creating arrays repeatedly etc.

In general I'd really prefer you try to tackle some smaller PRs, the review requirement here is very high for these things that touch a lot of different parts of the app.

Thanks

@shamoon shamoon closed this Nov 27, 2024
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