Skip to content

Add Previous/Next navigation arrows to record edit pages#7993

Open
teknoprep wants to merge 2 commits into
fusionpbx:masterfrom
teknoprep:feature/edit-page-nav-arrows
Open

Add Previous/Next navigation arrows to record edit pages#7993
teknoprep wants to merge 2 commits into
fusionpbx:masterfrom
teknoprep:feature/edit-page-nav-arrows

Conversation

@teknoprep

@teknoprep teknoprep commented May 26, 2026

Copy link
Copy Markdown
Contributor

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:

  • Extensions
  • Destinations
  • Dialplan Manager
  • Inbound Routes
  • Outbound Routes
  • Devices
  • Follow Me (call_forward)

A small n / N position indicator sits next to the arrows. Keyboard shortcuts Alt+◀ / 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 → edit for every single record. This PR lets the user just keep clicking after each Save.

The navigation follows the exact list the user last saw on the list page — including the current search filter, order_by / order sort, page, and (where applicable) the Show All cross-domain view.

Implementation

  • New auto-loaded helper class resources/classes/edit_nav.php with two static methods (snapshot() and render()).
  • Each list page calls 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).
  • 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 small block per edit page, right after the existing Save button).
  • Snapshots have a 1-hour TTL guard so we never navigate via ancient state.
  • The Dialplan Manager, Inbound Routes and Outbound Routes views are keyed separately by app_uuid, so switching between them never clobbers each other's snapshots.
  • 100% server-side PHP — no JavaScript framework, no theme modifications, no sessionStorage. The only inline <script> is a 12-line keydown handler for the Alt+Arrow shortcuts.

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

  • 1 new file: resources/classes/edit_nav.php (~190 lines, auto-loaded)
  • 10 existing files touched, 3 lines added per file on average

Manual test plan

  1. Visit any list page above — page loads as before.
  2. Click into a record — ◀ ▶ 3 / 47 appears in the action bar after Save.
  3. Click — navigates to the next record in the same sort order, preserving the list-page search/sort.
  4. Bookmark an edit URL directly, open it in a fresh session — arrows are not rendered (graceful no-op).
  5. Press Alt+◀ / Alt+▶ while focused outside any form field — navigates.

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).
@teknoprep teknoprep changed the title Add Previous/Next navigation arrows to record edit pages Add Previous/Next navigation arrows to record edit pages (all standard modules) May 26, 2026
@teknoprep teknoprep force-pushed the feature/edit-page-nav-arrows branch from d7835de to 689cd5f Compare May 26, 2026 20:50
@teknoprep teknoprep changed the title Add Previous/Next navigation arrows to record edit pages (all standard modules) Add Previous/Next navigation arrows to record edit pages May 26, 2026
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.

1 participant