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

New Area and MenuItem classes #6969

Merged
merged 15 commits into from
Feb 4, 2025

Conversation

bastianallgeier
Copy link
Member

@bastianallgeier bastianallgeier commented Feb 3, 2025

Summary

  • New Kirby\Panel\Ui\MenuItem class
  • New Kirby\Panel\Area class
  • Refactored Areas and Menu classes
  • The Fiber class no longer takes a wildcard options array, but has new dedicated props for areas and area
  • Other panel classes have been refactored to work with the new Area instances
  • Unit tests have been adapted and new unit tests have been added.

@distantnative
Copy link
Member

I think it would be great if Ui\Menu and Ui\MenuItem would follow our UI component classes logic, e.g. extending Ui\Component (or Ui\Button for the menu items) but at least working in the same ::render() with component/props logic. What do you think?

Comment on lines 161 to 172
// register all routes from areas
foreach ($areas as $id => $area) {
foreach ($areas as $area) {
$routes = [
...$routes,
...static::routesForViews($id, $area),
...static::routesForSearches($id, $area),
...static::routesForDialogs($id, $area),
...static::routesForDrawers($id, $area),
...static::routesForDropdowns($id, $area),
...static::routesForRequests($id, $area),
...static::routesForViews($area),
...static::routesForSearches($area),
...static::routesForDialogs($area),
...static::routesForDrawers($area),
...static::routesForDropdowns($area),
...static::routesForRequests($area),
];
}
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick: Not necessarily in this PR, but looking at this it just screams to me for

...$area->routes()

@distantnative
Copy link
Member

Looks great! I'd suggest to merge #6970 first in here and then together in the other PR.

@bastianallgeier bastianallgeier marked this pull request as ready for review February 4, 2025 13:23
@bastianallgeier bastianallgeier merged commit f473fb8 into v5/refactor/panel-php Feb 4, 2025
16 checks passed
@bastianallgeier bastianallgeier deleted the v5/refactor/panel-php-part-2 branch February 4, 2025 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants