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

Add optional grouping of features by path in tree view #370

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

frederikb
Copy link

Background

See #366

Changes

Introduced an optional feature to group feature files by their directory paths in the tree view, providing a better overview of features for teams that organize them by functionality in nested directories.

The default behavior remains unchanged, with features listed without grouping for backward compatibility.

Added new configuration options:

  • groupFeaturesByPath: Enables or disables path-based grouping (default: false).
  • removableBasePaths: Specifies base paths to strip from feature file URIs before grouping.
  • directoryNameFormatter: Customizes how directory names are displayed in the grouped tree view.

Development

I hope that it's ok that I suggest one approach on how to implement the feature request linked above. I understood by you assigning it to the next release version that you would be open to support this feature.

Regarding the implementation:

  • I tried to follow your naming conventions and code style as best as possible - but please feel free to request changes. In particular I did not find any information regarding the style guide / formatter / linter and therefore just followed some IntelliJ built-ins.
  • I was not sure about the location of some of the newly introduced classes.
  • I used Java 11 as the baseline and avoided newer APIs. There is probably some slight code style optimization possible if we baseline on 17.
  • The name of the configuration properties are up for discussion - please feel more than welcome to suggest better names.
  • I followed the versioning strategy and increased the version as documented in the contribution guidelines.
  • The styling is my initial suggestion and very much open to changes

Screenshot

The existing test JSONs are not the best at showcasing the intent of the feature. But nevertheless, if you switch groupFeaturesByPath to true you can see it in action:

image

Introduced an optional feature to group feature files by their directory paths in the tree view, providing a better overview of features for teams that organize them by functionality in nested directories.

The default behavior remains unchanged, with features listed without grouping for backward compatibility.

Added new configuration options:
- `groupFeaturesByPath`: Enables or disables path-based grouping (default: false).
- `removableBasePaths`: Specifies base paths to strip from feature file URIs before grouping.
- `directoryNameFormatter`: Customizes how directory names are displayed in the grouped tree view.

Fixes trivago#366
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.

1 participant