Add Previous/Next navigation arrows to record edit pages#7993
Open
teknoprep wants to merge 2 commits into
Open
Add Previous/Next navigation arrows to record edit pages#7993teknoprep wants to merge 2 commits into
teknoprep wants to merge 2 commits into
Conversation
Adds compact chevron buttons to the action bar of the Extensions,
Destinations, Dialplan Manager, Inbound Routes, Outbound Routes and
Devices edit pages so users can walk from one record to the next
without bouncing back to the list page.
The navigation follows the *exact* list the user last saw on the list
page — including the current search filter, sort order, page and (where
applicable) the Show All cross-domain view. This makes bulk-editing
many records (typical during onboarding or audits) far faster.
Implementation:
* New helper class resources/classes/edit_nav.php (auto-loaded).
* Each list page calls edit_nav::snapshot() once, immediately after
fetching its rows, which stores the ordered list of uuids in
$_SESSION under a per-module key (one extra line per list page).
* Each edit page calls edit_nav::render() inside the action bar,
which returns the prev / next / position HTML or '' when there is
no fresh snapshot (one block per edit page).
* Snapshots have a one-hour freshness window.
* Dialplan Manager / Inbound Routes / Outbound Routes are keyed
separately by app_uuid so switching between them never clobbers
each other.
Behaviour is strictly additive: users who never visit the list page
first (deep links, bookmarks, fresh sessions) see no change at all,
because render() returns an empty string when no snapshot exists.
Keyboard shortcuts Alt+Left / Alt+Right are also wired up (ignored
while typing in a form field).
d7835de to
689cd5f
Compare
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds compact Previous (◀) and Next (▶) chevron buttons to the action bar of these edit pages, so users can walk from one record to the next without bouncing back to the list page:
A small
n / Nposition indicator sits next to the arrows. Keyboard shortcutsAlt+◀/Alt+▶also navigate (ignored while typing in a form field).Why
When triaging, onboarding or auditing it is common to open record after record from a filtered list. The current flow forces
list → edit → save → back → next row → editfor every single record. This PR lets the user just keep clicking▶after eachSave.The navigation follows the exact list the user last saw on the list page — including the current
searchfilter,order_by/ordersort,page, and (where applicable) theShow Allcross-domain view.Implementation
resources/classes/edit_nav.phpwith two static methods (snapshot()andrender()).edit_nav::snapshot()once, immediately after fetching its rows, which stores the ordered list of uuids in$_SESSION['edit_nav'][<module_key>](one extra line per list page).edit_nav::render()inside the action bar, which returns the prev / next / position HTML, or''when there is no fresh snapshot (one small block per edit page, right after the existing Save button).app_uuid, so switching between them never clobbers each other's snapshots.sessionStorage. The only inline<script>is a 12-linekeydownhandler for theAlt+Arrowshortcuts.Backwards compatibility
Strictly additive. Users who deep-link straight to an edit page (bookmarks, new session, no list visited yet) see no change at all, because
edit_nav::render()returns an empty string when no snapshot exists. No new permissions, no new settings, no schema change, no new language strings.Scope
resources/classes/edit_nav.php(~190 lines, auto-loaded)Manual test plan
◀ ▶ 3 / 47appears in the action bar after Save.▶— navigates to the next record in the same sort order, preserving the list-page search/sort.Alt+◀/Alt+▶while focused outside any form field — navigates.