Add previous/next navigation to detail pages - #12528
Open
ejspeed-cmd wants to merge 5 commits into
Open
Conversation
✅ Deploy Preview for inventree-web-pui-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Encodes active filter/ordering context as _nav_* URL params when clicking a table row. On the detail page, prev/next chevron buttons query the API using pk_gt/pk_lt to find adjacent items in the same filtered/ordered list. - Add useNextPrevSiblings hook (UseNextPrev.tsx) - Add NextPrevAction component with prev/next chevron buttons - Wire pk prop into PageDetail; hook and buttons render there - Encode nav context in InvenTreeTable row click handler - Add pk_gt/pk_lt filter fields to StockFilter and PartFilter - Preserve query params in PanelGroup panel navigation - Wire pk into PartDetail and StockDetail PageDetail calls
matmair
reviewed
Jul 31, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #12528 +/- ##
==========================================
- Coverage 86.75% 86.67% -0.09%
==========================================
Files 1445 1445
Lines 96281 96278 -3
Branches 11229 11132 -97
==========================================
- Hits 83526 83446 -80
- Misses 12691 12768 +77
Partials 64 64
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Author
|
@matmair is there anything i can do to fix the failing test ?, i checked them and it doesn't seem related to my changes |
Author
|
@matmair can you reapprove the ci ? |
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 previous/next navigation buttons to detail pages, allowing users to move through a filtered and ordered list without returning to the table view.
Motivation
When reviewing many items from a filtered list (e.g. all in-stock items for a location), users currently have to navigate back to the list, find their place, and click into the next item. This adds prev/next chevron buttons to the detail page header that preserve the active filter and ordering context.
Changes
Backend
stock/api.py: Addedpk_gtandpk_ltfilter fields toStockFilterpart/api.py: Addedpk_gtandpk_ltfilter fields toPartFilterThese allow the frontend to query for the adjacent item in the current ordered/filtered set.
Frontend
hooks/UseNextPrev.tsx: New hookuseNextPrevSiblings(pk)that reads nav context from_nav_*URL params and issuespk_gt/pk_ltAPI queries to find the previous and next item PKscomponents/nav/NextPrevAction.tsx: New component rendering prev/next chevron buttons, disabled when no sibling existscomponents/nav/PageDetail.tsx: Accepts apkprop; callsuseNextPrevSiblingsinternally and rendersNextPrevActionin the header actions areacomponents/tables/InvenTreeTable.tsx: Row click handler now encodes the active endpoint, ordering and filters as_nav_*query params on the detail URLcomponents/panels/PanelGroup.tsx: Panel navigation now preserves existing query params so nav context is not lost when switching tabspages/part/PartDetail.tsx: PassespktoPageDetailpages/stock/StockDetail.tsx: PassespktoPageDetailBehaviour
_nav_*params are present in the URL)InvenTreeTable,PageDetail) with no per-page logic beyond passingpk