@gadmin2n/schematics 0.0.119 → 0.0.120

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.
@@ -48,7 +48,8 @@ settings.local.json
48
48
 
49
49
  .agent/
50
50
  .claude-internal/
51
- .claude
51
+ .claude/
52
+ .codebuddy/
52
53
  docs/
53
54
  .frontend-slides/
54
55
  .agent
@@ -82,23 +82,27 @@ function writeCache(key: string, value: unknown): void {
82
82
  }
83
83
  }
84
84
 
85
+ // In dev mode, skip sessionStorage cache so menu changes after seed are
86
+ // visible immediately without clearing browser storage manually.
87
+ const IS_DEV = import.meta.env.DEV;
88
+
85
89
  export const useUserPageAccess = (): UseUserPageAccessResult => {
86
90
  const [isIdentityLoading, setIsIdentityLoading] = useState(true);
87
91
 
88
92
  // Role names — initialise from cache so first render is non-empty
89
- const [roleNames, setRoleNames] = useState<string[]>(
90
- () => readCache<string[]>(RoleCacheKey) ?? [],
93
+ const [roleNames, setRoleNames] = useState<string[]>(() =>
94
+ IS_DEV ? [] : (readCache<string[]>(RoleCacheKey) ?? []),
91
95
  );
92
96
 
93
97
  // Data states — initialise from cache for instant first render
94
98
  const [rolesData, setRolesData] = useState<Role[] | null>(() =>
95
- readCache<Role[]>(RolesDataCacheKey),
99
+ IS_DEV ? null : readCache<Role[]>(RolesDataCacheKey),
96
100
  );
97
101
  const [rolePagesData, setRolePagesData] = useState<RolePage[] | null>(() =>
98
- readCache<RolePage[]>(RolePagesCacheKey),
102
+ IS_DEV ? null : readCache<RolePage[]>(RolePagesCacheKey),
99
103
  );
100
104
  const [pagesData, setPagesData] = useState<Page[] | null>(() =>
101
- readCache<Page[]>(PagesCacheKey),
105
+ IS_DEV ? null : readCache<Page[]>(PagesCacheKey),
102
106
  );
103
107
 
104
108
  // Track previous roles to detect changes
@@ -312,7 +316,8 @@ export const useUserPageAccess = (): UseUserPageAccessResult => {
312
316
  // Calculate loading state
313
317
  // If we have cached data, isLoading is false even while background-refreshing
314
318
  const hasCache = useMemo(
315
- () => !!(readCache(PagesCacheKey) && readCache(RolePagesCacheKey)),
319
+ () =>
320
+ !IS_DEV && !!(readCache(PagesCacheKey) && readCache(RolePagesCacheKey)),
316
321
  // eslint-disable-next-line react-hooks/exhaustive-deps
317
322
  [],
318
323
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gadmin2n/schematics",
3
- "version": "0.0.119",
3
+ "version": "0.0.120",
4
4
  "description": "Gadmin - modern, fast, powerful node.js web framework (@schematics)",
5
5
  "main": "dist/index.js",
6
6
  "files": [