@visns-studio/visns-components 6.5.2 → 6.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -91,7 +91,7 @@
91
91
  "react-dom": "^17.0.0 || ^18.0.0"
92
92
  },
93
93
  "name": "@visns-studio/visns-components",
94
- "version": "6.5.2",
94
+ "version": "6.5.4",
95
95
  "description": "Various packages to assist in the development of our Custom Applications.",
96
96
  "main": "src/index.js",
97
97
  "files": [
@@ -147,6 +147,11 @@ const Login = ({
147
147
  window.location.href = result.previous;
148
148
  } else {
149
149
  setSystemAuth(true);
150
+ // Move now, with the profile the server just
151
+ // returned — waiting for the background
152
+ // re-check to navigate leaves the login form
153
+ // on screen for a beat after success.
154
+ navigate('/', { replace: true });
150
155
  }
151
156
  }
152
157
  } else {
@@ -121,12 +121,16 @@ const GenericAuth = ({
121
121
  const [isClientAuthenticated, setIsClientAuthenticated] = useState(false);
122
122
 
123
123
  const updateAuthStatus = async () => {
124
- // Guards must not act while the profile check is in flight: after a
125
- // login flips isAuthenticated this re-runs, and a route evaluated
126
- // against the half-updated state bounced dashboard → /login →
127
- // dashboard. Loading renders AuthLoading instead, so the user sees
128
- // one spinner and one navigation.
129
- setIsLoading(true);
124
+ // Guards must not act while the FIRST profile check is in flight:
125
+ // evaluated against empty state they bounced dashboard → /login →
126
+ // dashboard after sign-in. But only block when there is no usable
127
+ // profile — raising loading over an already-authenticated tree swaps
128
+ // the whole page for a spinner on every background re-check, which
129
+ // is its own flicker. With a profile in hand the re-check is
130
+ // invisible.
131
+ if (!userProfile.id) {
132
+ setIsLoading(true);
133
+ }
130
134
 
131
135
  try {
132
136
  const { data } = await CustomFetch('/ajax/user/profile', 'GET');
@@ -137,7 +141,12 @@ const GenericAuth = ({
137
141
  }
138
142
  setIsLoading(false);
139
143
 
140
- if (location.pathname.split('/')[1] === 'login') {
144
+ // The live pathname, not the router hook's: this resolves after
145
+ // Login has already navigated, and the closure still holds
146
+ // '/login' from the render that created the effect — firing a
147
+ // second navigate('/') over the settled dashboard, whose route
148
+ // re-render is the sub-second flicker after sign-in.
149
+ if (window.location.pathname.split('/')[1] === 'login') {
141
150
  navigate('/', { replace: true });
142
151
  }
143
152
  } catch (error) {
@@ -888,6 +888,15 @@
888
888
  display: flex;
889
889
  flex-direction: column;
890
890
 
891
+ /* The rail is `position: fixed` with no z-index, so its notification /
892
+ switch-account panels — stacked inside it — lost to the content's own
893
+ contexts (grid dropdowns sit at 1000+) and painted underneath the
894
+ page. Desktop only: above the content chrome, below modal overlays.
895
+ The ≤1024px drawer keeps its own 600-under-the-header stacking. */
896
+ @media (min-width: 1025px) {
897
+ z-index: 1050;
898
+ }
899
+
891
900
  /* The rail clips itself so a long nav list can't spill; the panels that
892
901
  open from the action rows — the notification list, the account
893
902
  switcher — would be cut off by that. The nav list keeps its own