Skip to content

Conversation

@emmadesilva
Copy link
Member

@emmadesilva emmadesilva commented Feb 23, 2024

Further normalizes the configuration API. Targets #1568

@codecov
Copy link

codecov bot commented Feb 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.91%. Comparing base (57a013e) to head (b93174f).

Additional details and impacted files
@@                       Coverage Diff                        @@
##             improved-navigation-internals    #1586   +/-   ##
================================================================
  Coverage                            99.91%   99.91%           
- Complexity                            1757     1765    +8     
================================================================
  Files                                  183      183           
  Lines                                 4754     4773   +19     
================================================================
+ Hits                                  4750     4769   +19     
  Misses                                   4        4           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@emmadesilva
Copy link
Member Author

GPT 4 Turbo generated description and release notes:

(Won't be using these, but since I paid for the tokens I might as well comment them here)

Pull Request Description

Title: Enhance Navigation Data Factory with Configurable Label Support

Description:

This pull request introduces enhancements to the NavigationDataFactory by allowing it to search for navigation labels within both general navigation and specific sidebar configurations. This update aims to provide more flexibility and control over the labeling of navigation items, particularly improving support for projects with complex navigation structures.

Previously, NavigationDataFactory had limited capabilities, only searching for labels in a predetermined configuration path. With this update, the factory now differentiates between general navigation labels and documentation sidebar labels, allowing a more granular and organized handling of navigation item labels.

Key Changes:

  • The searchForLabelInConfig method has been expanded into searchForLabelInConfigs, which now includes logic to differentiate between general navigation (hyde.navigation.labels) and documentation sidebar (docs.sidebar.labels) label configurations.
  • Introduced two new private methods: searchForLabelInNavigationConfig and searchForLabelInSidebarConfig, encapsulating the logic to fetch labels from their respective configuration paths.
  • Adjusted the makeLabel method to utilize the new searchForLabelInConfigs method, ensuring labels are correctly fetched from the updated logic.
  • Enhanced the logic to provide a fallback to the document's title or the predefined title property if labels are not defined within the configurations.

Motivation:

This enhancement was driven by the need for more sophisticated labeling capabilities within projects that utilize HydePHP, catering especially to those with extensive documentation or complex navigation requirements. By distinguishing between different types of navigation contexts (general vs. documentation-specific), this update allows project maintainers and content creators to easily manage and organize their navigation labels in a more structured manner.

Testing:

Unit tests have been expanded to cover the new methods introduced and ensure that label fetching behaves as expected across different configuration scenarios. The tests validate both the successful retrieval of labels from the configurations and the proper fallback behavior when labels are unspecified.


Release Notes

HydePHP Framework - Enhanced Navigation Label Support

We're excited to announce an update to the HydePHP Framework that significantly enhances the flexibility and control of navigation labeling. This update focuses on improving the organization and management of navigation item labels, especially for projects with complex navigation schemes or extensive documentation.

What's New:

  • Configurable Label Support: The NavigationDataFactory now supports fetching labels from both general navigation and documentation-specific sidebar configurations, offering greater flexibility in how navigation items are labeled.
  • Refined Label Fetching Logic: Introduced new methods to streamline the process of fetching labels, ensuring that labels can be easily managed and organized within the project's configuration files.
  • Fallback to Title: Enhanced the label fetching mechanism to provide a seamless fallback to the document's title, ensuring that navigation items are always labeled even when specific configurations are not set.

Improvements for Project Maintainers:

  • Customize navigation labels more precisely by specifying them within general or documentation-specific configuration paths.
  • Easily manage the appearance and organization of your project's navigation items through simple configuration updates.
  • Benefit from a more intuitive fallback mechanism that ensures all navigation items are properly labeled, enhancing the user's navigation experience.

Upgrading:

This update is part of the latest release and is available for immediate use. To take advantage of these new features, ensure that your project is updated to the latest version of the HydePHP Framework. No breaking changes were introduced, but reviewing the updated documentation on navigation configuration is recommended to fully leverage the new capabilities.

We hope you find these improvements beneficial for your projects, and as always, we welcome your feedback and contributions to further enhance the HydePHP experience.

@emmadesilva emmadesilva force-pushed the support-setting-sidebar-labels-in-config branch from 5363ddb to 3431ebe Compare February 23, 2024 10:29
@emmadesilva emmadesilva changed the title [2.x] Support setting sidebar labels in config [2.x] Support setting sidebar labels and visibility in docs config Feb 23, 2024
@emmadesilva emmadesilva marked this pull request as ready for review February 23, 2024 18:18
@emmadesilva emmadesilva merged commit b227b8b into improved-navigation-internals Feb 23, 2024
@emmadesilva emmadesilva deleted the support-setting-sidebar-labels-in-config branch February 23, 2024 18:21
@emmadesilva emmadesilva added this to the v2 milestone Jul 9, 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