Repository navigation
feat(ux): URL-addressable sub-tabs (default-first) for Inventory + Admin (QA A.4) - #905
Conversation
…min (closes #902) Resolve QA A.4: Inventory & Coverage remembered its last sub-tab via hidden in-memory session state while Admin always read its sub-tab from the /admin/<subtab> URL. The inconsistency was the defect. Make Inventory sub-tabs URL-addressable as /inventory/<subtab>, matching the existing Admin convention: - loadInventory() now derives the sub-section from the URL path (getInventorySubTabFromPath), not the module-level currentSubSection, so a fresh /inventory lands on the default (active-commitments) and a /inventory/<subtab> deep link lands on that sub-tab. - A sub-nav click routes through navigation.switchInventorySubTab, which pushes /inventory/<subtab> via history.pushState so the view is shareable/bookmarkable and browser back/forward works. - The history push lives in navigation.ts alongside switchSettingsSubTab so the single historyId counter stays authoritative for the back/forward dirty-guard; inventory.ts keeps the pure DOM view switch. Supersedes the partial PR #757 session-memory behavior with explicit URL state. Both pages now behave identically; existing /admin/* deep links are unaffected. Tests assert, for each page: no param -> default sub-tab, explicit param -> that sub-tab, switching updates the URL (query/hash preserved, no duplicate entry), and unknown param -> default.
|
Warning Review limit reached
More reviews will be available in 55 minutes and 46 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Summary
Resolves QA A.4: Inventory & Coverage and Admin handled sub-tab state inconsistently.
/admin/<subtab>URL.That inconsistency was the defect. This PR makes Inventory sub-tabs URL-addressable as
/inventory/<subtab>, matching the existing Admin convention, so both pages behave identically and the sub-tab is shareable/bookmarkable with working browser back/forward.Changes
loadInventory()derives the sub-section from the URL path (getInventorySubTabFromPath), not the module-levelcurrentSubSection. Fresh/inventorylands on the default (active-commitments); a/inventory/<subtab>deep link lands on that sub-tab.navigation.switchInventorySubTab, which pushes/inventory/<subtab>viahistory.pushState(preserving existing query params + hash, no full reload, no duplicate entry on a no-op switch).navigation.tsalongsideswitchSettingsSubTabso the singlehistoryIdcounter stays authoritative for the back/forward dirty-guard;inventory.tskeeps the pure DOM view switch.Supersedes the partial #757 session-memory behavior with explicit URL state. Existing
/admin/*deep links are unaffected.URL scheme
Path-based
/inventory/<subtab>and/admin/<subtab>. This matches the app's established sub-tab convention (Admin already used/admin/<subtab>with full pushState/popstate handling innavigation.ts). The topbar global filter uses query params (?provider=&account=); that convention is for orthogonal cross-section filter state, not sub-tab identity, and is preserved across sub-tab switches.Tests
For each page: no param -> default/first sub-tab; explicit param -> that sub-tab; switching updates the URL (query/hash preserved); unknown param -> default. Full frontend suite green (2177 pass).
Closes #902.