Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the back button behavior in the Directus admin interface by introducing a back-to prop that allows explicit navigation targets instead of relying solely on browser history. The key improvement ensures only one element (back button, icon, or slot content) renders in the title prepend area, preventing potential layout conflicts.
- Adds
back-toprop toPrivateViewcomponent for explicit back navigation targets - Refactors header bar rendering logic to ensure mutual exclusivity between back button, custom icon, and title-outer:prepend slot
- Applies
back-toprop across 12 nested route pages to provide predictable navigation paths
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| contributors.yml | Adds new contributor kekekuli to the contributors list |
| app/src/views/private/private-view/components/private-view.vue | Adds optional backTo prop definition with documentation |
| app/src/views/private/private-view/components/private-view-main.vue | Passes back-to prop through to header bar component |
| app/src/views/private/private-view/components/private-view-header-bar.vue | Implements priority-based rendering logic (showBack > icon > slot) and reorders imports for consistency |
| app/src/views/private/private-view/components/private-view-header-bar-icon.vue | Updates back button to support conditional navigation via backTo prop or browser history |
| app/src/views/private/private-view/components/private-view-header-bar.test.ts | Adds comprehensive test coverage for header bar component behavior |
| app/src/views/private/private-view/components/private-view-header-bar-icon.test.ts | Adds comprehensive test coverage for icon component including back button behaviors |
| app/src/modules/users/routes/item.vue | Adds back-to="/users" prop for predictable navigation |
| app/src/modules/settings/routes/webhooks/item.vue | Adds back-to="/settings/webhooks" prop for predictable navigation |
| app/src/modules/settings/routes/translations/item.vue | Adds back-to="/settings/translations" prop for predictable navigation |
| app/src/modules/settings/routes/roles/public-item.vue | Adds back-to="/settings/roles" prop for predictable navigation |
| app/src/modules/settings/routes/roles/item.vue | Adds back-to="/settings/roles" prop for predictable navigation |
| app/src/modules/settings/routes/presets/item.vue | Adds back-to="/settings/presets" prop for predictable navigation |
| app/src/modules/settings/routes/policies/item.vue | Adds back-to="/settings/policies" prop for predictable navigation |
| app/src/modules/settings/routes/marketplace/routes/extension/extension.vue | Adds back-to="/settings/marketplace" prop for predictable navigation |
| app/src/modules/settings/routes/marketplace/routes/account/account.vue | Adds back-to="/settings/marketplace" prop for predictable navigation |
| app/src/modules/settings/routes/flows/flow.vue | Adds back-to="/settings/flows" prop for predictable navigation |
| app/src/modules/settings/routes/data-model/fields/fields.vue | Adds back-to="/settings/data-model" prop and custom title-outer:prepend slot with back button (creates redundancy) |
| app/src/modules/files/routes/item.vue | Adds back-to="/files" prop and consolidates imports for better organization |
| app/src/modules/content/routes/item.vue | Adds dynamic back-to using collectionRoute for collection-specific navigation |
| .changeset/breezy-moons-warn.md | Documents the change as a patch version bump for @directus/app |
app/src/views/private/private-view/components/private-view-header-bar-icon.test.ts
Show resolved
Hide resolved
app/src/views/private/private-view/components/private-view-header-bar.test.ts
Show resolved
Hide resolved
Member
Author
|
@copilot open a new pull request to apply changes based on the comments in this thread |
3 tasks
This comment was marked as resolved.
This comment was marked as resolved.
* Initial plan * Remove redundant custom back button from fields.vue Co-authored-by: rijkvanzanten <[email protected]> * Add test to verify router.back() is not called when backTo is provided Co-authored-by: rijkvanzanten <[email protected]> * Add tests to verify mutual exclusivity of header bar elements Co-authored-by: rijkvanzanten <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: rijkvanzanten <[email protected]> Co-authored-by: Rijk van Zanten <[email protected]>
Contributor
|
Cool! Thank you for your review |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scope
As called out in #26369, the browser-history-back behavior of the back button doesn't always behave like the user would expect. This PR continues on the work in #26399 to:
back-toprop onprivate-viewback-toroutes for nested pages (eg/flows/:id→/flows)Potential Risks / Drawbacks
Tested Scenarios
Review Notes / Questions
Checklist
Fixes #26369, supersedes and closes #26399