Skip to content

feat(ux): URL-addressable sub-tabs (default-first) for Inventory + Admin (QA A.4) - #905

Merged
cristim merged 1 commit into
feat/multicloud-web-frontendfrom
feat/url-addressable-subtabs
Jun 1, 2026
Merged

cristim merged 1 commit into
feat/multicloud-web-frontendfrom
feat/url-addressable-subtabs

Conversation

@cristim

@cristim cristim commented Jun 1, 2026

Copy link
Copy Markdown
Member

Summary

Resolves QA A.4: Inventory & Coverage and Admin handled sub-tab state inconsistently.

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-level currentSubSection. Fresh /inventory lands on the default (active-commitments); a /inventory/<subtab> deep link lands on that sub-tab.
  • Sub-nav clicks route through navigation.switchInventorySubTab, which pushes /inventory/<subtab> via history.pushState (preserving existing query params + hash, no full reload, no duplicate entry on a no-op switch).
  • 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 #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 in navigation.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.

…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.
@cristim cristim added triaged Item has been triaged priority/p3 Polish / idea / may never ship severity/low Minor harm urgency/this-sprint Within the current sprint impact/many Affects most users effort/m Days type/feat New capability labels Jun 1, 2026
@coderabbitai

coderabbitai Bot commented Jun 1, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@cristim, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ff280587-9b62-49fc-9cca-1ed956e1c8dc

📥 Commits

Reviewing files that changed from the base of the PR and between 9476456 and 21cf13f.

📒 Files selected for processing (4)
  • frontend/src/__tests__/inventory.test.ts
  • frontend/src/__tests__/navigation.test.ts
  • frontend/src/inventory.ts
  • frontend/src/navigation.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/url-addressable-subtabs

Comment @coderabbitai help to get the list of available commands and usage tips.

@cristim

cristim commented Jun 1, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim

cristim commented Jun 1, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim

cristim commented Jun 1, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim
cristim merged commit 18620bc into feat/multicloud-web-frontend Jun 1, 2026
6 checks passed
@cristim
cristim deleted the feat/url-addressable-subtabs branch June 1, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/m Days impact/many Affects most users priority/p3 Polish / idea / may never ship severity/low Minor harm triaged Item has been triaged type/feat New capability urgency/this-sprint Within the current sprint

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant