-
Notifications
You must be signed in to change notification settings - Fork 14
Improve pages tree navigation #763
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the pages tree navigation in the panel by adding support for viewing children of pages that have the children.list option disabled. The main change introduces a dedicated "View children pages" action and refactors the tree view to handle nested navigation with breadcrumbs.
Key changes include:
- New
/pages/{page}/tree/route for viewing children of specific pages - Breadcrumb navigation in the header showing the current page hierarchy
- Dropdown menu for page actions (edit, view children, delete) replacing standalone buttons
- Dynamic enabling/disabling of expand/collapse/reorder buttons based on tree state
Reviewed Changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| panel/views/pages/tree.php | Adds level offset calculation, conditional rendering of children based on scheme options, and replaces action buttons with dropdown menu |
| panel/views/pages/index.php | Implements breadcrumb navigation and makes tree control buttons dynamically enabled/disabled |
| panel/translations/en.yaml | Adds translations for new "Edit page" and "View children pages" actions |
| panel/src/ts/components/views/pages.ts | Refactors click handlers, adds state management for command buttons, and calls filter logic on modal initialization |
| panel/src/ts/components/dropdowns.ts | Adds focusin handler to close dropdowns when focus moves outside |
| panel/src/scss/components/forms/_forms-editor.scss | Removes box shadow from disabled toolbar buttons |
| panel/src/scss/components/_header.scss | Adjusts header styling for breadcrumb navigation with overflow handling and link hover states |
| panel/src/scss/components/_dropdowns.scss | Updates disabled item color and adds focus styling for dropdown items |
| panel/src/scss/components/_buttons.scss | Standardizes disabled button styling across different button types |
| panel/modals/newPage.yaml | Sets default parent to current model route for new page modal |
| panel/config/routes/routes.php | Adds new panel.pages.tree route |
| formwork/src/Panel/Controllers/PagesController.php | Refactors index action to redirect to tree, implements new tree action with parent context |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1bb4553 to
47da9b4
Compare
47da9b4 to
a8f0479
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 15 out of 16 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const orderablePages = $$(".pages-tree-item.is-orderable"); | ||
|
|
||
| if (commandExpandAllPages) { | ||
| commandExpandAllPages.disabled = allPages.length === expandedPages.length; |
Copilot
AI
Nov 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The expand all button should also be disabled when there are no pages with children (allPages.length === 0), otherwise it remains enabled but has no effect. Update the condition to: commandExpandAllPages.disabled = allPages.length === 0 || allPages.length === expandedPages.length;
| commandExpandAllPages.disabled = allPages.length === expandedPages.length; | |
| commandExpandAllPages.disabled = allPages.length === 0 || allPages.length === expandedPages.length; |
This pull request introduces significant improvements to the pages tree view and related UI/UX in the panel. The main changes include the addition of a dedicated pages tree route, enhanced navigation with breadcrumb support, improved handling and styling of disabled UI elements, and better user interaction for expanding, collapsing, and reordering pages. There are also several quality-of-life improvements for both the backend logic and frontend appearance.
Pages Tree and Navigation Enhancements:
panel.pages.treeroute and correspondingtreeaction inPagesController, enabling viewing the children of any page and supporting breadcrumbs for navigation. The controller now checks for the correct permission (panel.pages.tree) and handles subtree options for children.UI/UX and Accessibility Improvements:
Pages Tree Interaction Improvements:
Visual and Layout Adjustments:
Other Notable Changes:
These changes collectively make the pages section of the panel more powerful, user-friendly, and visually consistent.
Pages Tree and Navigation:
panel.pages.treeroute andtreeaction inPagesController, enabling navigation to view children of any page and supporting breadcrumbs.UI/UX and Accessibility:
Pages Tree Interaction:
Visual/Layout Adjustments:
Translations and Workflow: