Skip to content

Restore proxy navigation and sidebar accordion state - #7381

Merged
diegosouzapw merged 10 commits into
cheaper-inference:release/v3.8.49from
JxnLexn:dev/fix-sidebar-proxy-state
Jul 18, 2026
Merged

diegosouzapw merged 10 commits into
cheaper-inference:release/v3.8.49from
JxnLexn:dev/fix-sidebar-proxy-state

Conversation

@JxnLexn

@JxnLexn JxnLexn commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Restore always-available proxy navigation, preserve sidebar accordion state across navigation, and prevent free-pool translation failures with localized strings and fallbacks.

Validation

  • npm run lint
  • npm run test:unit
  • npm run test:coverage
  • Coverage is still >= 60% for statements, lines, functions, and branches
  • SonarQube PR analysis is green or any remaining issues are explicitly documented below

Tests Added Or Updated

  • Updated FreePoolTab source-toggle tests to verify required German translations.
  • Added sidebar expansion-state tests covering proxy visibility, hydration, accordion behavior, and route changes.

Coverage Notes

  • Sidebar tests cover proxy navigation visibility and expansion-state transitions.
  • FreePoolTab tests cover render-critical translation keys.
  • No coverage decrease was provided.

Reviewer Notes

  • Legacy settings cannot hide the proxy navigation entry.
  • Stored empty expansion state remains collapsed; explicitly pinned sections still expand.
  • Free-pool labels use German translations when available and English fallbacks otherwise.

@JxnLexn
JxnLexn requested a review from diegosouzapw as a code owner July 16, 2026 09:03

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a translateOrFallback helper to provide default fallback values for proxy-related settings, adds German translations, and refactors the sidebar expansion state logic into a dedicated utility file (sidebarExpansionState.ts) with corresponding unit tests. The review feedback highlights two key improvements: addressing a potential Next.js hydration mismatch in FreePoolTab.tsx when formatting dates/times with toLocaleTimeString(), and converting the new sidebar proxy expansion test file from Node's native test runner to Vitest to maintain consistency with the rest of the project's test suite.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fd3201a31b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 42d1945bab

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c649f4571e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/shared/components/Sidebar.tsx Resolved
@diegosouzapw

Copy link
Copy Markdown
Collaborator

Thanks for this — the accordion-hydration fix (sidebarExpansionState.ts + the skipInitialActiveExpansion guard) and making proxy permanently visible are both solid, well-isolated changes, and tests/unit/ui/sidebar-proxy-expansion.test.tsx covers them correctly and passes.

One placement issue before this can merge: tests/unit/free-pool-tab.test.tsx lives outside tests/unit/ui/, so it's never collected by any CI test runner (test:vitest uses a different include list, test:vitest:ui is scoped to the tests/unit/ui positional filter, and test:unit's node-native runner only globs .test.ts, not .test.tsx — I confirmed the file even crashes if you try to run it under node --import tsx/esm --test). That means the new "has every render-critical German translation" assertion you added never actually runs, so the translateOrFallback change in FreePoolTab.tsx/ProxyTab.tsx currently has no executing test coverage.

Could you move that file to tests/unit/ui/free-pool-tab.test.tsx (and fix the two relative imports, ../../src/... → ../../../src/...)? Once that's in, this looks ready to me.

Also worth knowing (not a blocker): the same keys you added to de.json are still missing from ~24 other locale files — your translateOrFallback fallback already protects them from crashing, so no urgency, just flagging for a follow-up.

@JxnLexn

JxnLexn commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Implemented and pushed in commit d3da710.

  • Moved tests/unit/free-pool-tab.test.tsx to tests/unit/ui/free-pool-tab.test.tsx so it is collected by the UI Vitest suite.
  • Updated the relative imports for the new location.
  • Updated the translation mock to exercise the fallback path.
  • Restored per-source sync error extraction from results.<source>.errors, which the now-collected regression test exposed.

Validation: npm exec vitest run --config vitest.config.ts tests/unit/ui/free-pool-tab.test.tsx — 14/14 tests passed.

…line

The move to tests/unit/ui/free-pool-tab.test.tsx (this branch) relinks
it to the test:vitest:ui runner, so the tests/unit/free-pool-tab.test.tsx
entry in the frozen orphan baseline is now stale and fails
check:test-discovery. Removes the stale entry (60 -> 59 known orphans).

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
@diegosouzapw
diegosouzapw merged commit c711ed2 into cheaper-inference:release/v3.8.49 Jul 18, 2026
4 of 5 checks passed
@diegosouzapw

Copy link
Copy Markdown
Collaborator

Thanks @JxnLexn! Merged into release/v3.8.49 after combined merge-train validation (static gates + tests + vitest green on the merged tree). Where quality gates flagged growth we decomposed/extracted inside your branch keeping you as author — including renumbering the reasoning-routing migration slot and the ProviderDetailPageClient rebaseline annotation.

@diegosouzapw diegosouzapw mentioned this pull request Jul 23, 2026
HouMinXi pushed a commit to HouMinXi/OmniRoute that referenced this pull request Aug 2, 2026
…ce#7381)

* fix(sidebar): restore proxy navigation and accordion state

* fix(proxy): prevent free pool translation crash

* fix(settings): guard protected sidebar items and hydration state

* test(sidebar): cover proxy visibility and expansion state

* chore: restart pull request checks

* refactor(sidebar): extract group item visibility control

* refactor(sidebar): move group visibility control to module scope

* fix(sidebar): preserve collapsed state on initial load

* fix(proxy): collect free pool UI regression test

* chore(test): unfreeze free-pool-tab.test.tsx from test-discovery baseline

The move to tests/unit/ui/free-pool-tab.test.tsx (this branch) relinks
it to the test:vitest:ui runner, so the tests/unit/free-pool-tab.test.tsx
entry in the frozen orphan baseline is now stale and fails
check:test-discovery. Removes the stale entry (60 -> 59 known orphans).

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>

---------

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…ce#7381)

* fix(sidebar): restore proxy navigation and accordion state

* fix(proxy): prevent free pool translation crash

* fix(settings): guard protected sidebar items and hydration state

* test(sidebar): cover proxy visibility and expansion state

* chore: restart pull request checks

* refactor(sidebar): extract group item visibility control

* refactor(sidebar): move group visibility control to module scope

* fix(sidebar): preserve collapsed state on initial load

* fix(proxy): collect free pool UI regression test

* chore(test): unfreeze free-pool-tab.test.tsx from test-discovery baseline

The move to tests/unit/ui/free-pool-tab.test.tsx (this branch) relinks
it to the test:vitest:ui runner, so the tests/unit/free-pool-tab.test.tsx
entry in the frozen orphan baseline is now stale and fails
check:test-discovery. Removes the stale entry (60 -> 59 known orphans).

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>

---------

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
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.

2 participants