[Client] [2025.06-ext2]: Application Frame incorrectly calculates sidebar width

I am in the process of upgrading my application to A12 2025.06 ext2. During the upgrade, I discovered an incorrect calculating behavior of sidebar related to the Application Frame View. Below are the steps to reproduce and an explanation:

  1. Start the app (initial route loads Dashboard which uses MasterDetailLayout).
  2. Navigate to the Candidate screen (this uses SidebarLayout).
  3. Click a candidate row to open the details — a MasterDetailLayout opens to show the form
  4. Observe the layout: in the previous version the left sidebar shrinks to ~30% of the viewport (the table scrolls horizontally) and the right side reserved for the form.
  5. In the current version the sidebar keeps the full SidebarLayout width (the overview table width), breaking the form UI

Observed behavior

  • Sidebar retains its full SidebarLayout width when navigating from DashboardCandidateCandidate details. The form area does not get the expected remaining space and is visually broken.

Expected behavior

  • When a details MasterDetailLayout opens, the sidebar should be reduced (previously ~30% of the viewport) and the remaining width used by the form (table should overflow-scroll).

Investigation / root cause hypothesis

  • The layout calculation lives in @com.mgmtp.a12.widgets/widgets-core/src/layout/application-frame/main/application-frame.view.ts and uses useSideBarExpandedWidth.

  • I found a useEffect that depends on sidebarRef (a ref object). Because refs are mutable (ref.current changes do not trigger effect re-runs), React does not reliably re-run that effect when the DOM element is later assigned to sidebarRef.current.

  • When the app first loads on Dashboard, sidebarRef is null so the effect runs once with expandedMinimizedWidth = "" (empty). Later, when navigating to Candidate, the ref is populated but the effect does not run again, so getSidebarWidth() uses the wrong expandedMinimizedWidth and returns an incorrect calculation.

  • If I reload the page while on Candidate, ref.current is populated on first render and the calculation is correct — which explains the inconsistent behavior.

    Please verify whether you consider this a bug :slight_smile:

Hello @minh-sparse-knoll

Please check A12-17989