@c-rex/components 0.1.31 → 0.1.32
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 +1 -1
- package/src/article/article-action-bar.analysis.md +15 -0
- package/src/article/article-content.analysis.md +15 -0
- package/src/article/article-content.tsx +3 -3
- package/src/autocomplete.analysis.md +17 -0
- package/src/autocomplete.tsx +2 -2
- package/src/breadcrumb.analysis.md +15 -0
- package/src/breadcrumb.tsx +4 -4
- package/src/carousel/carousel.analysis.md +17 -0
- package/src/carousel/carousel.tsx +2 -2
- package/src/check-article-lang.analysis.md +15 -0
- package/src/directoryNodes/tree-of-content.analysis.md +14 -0
- package/src/documents/result-list.analysis.md +14 -0
- package/src/documents/result-list.tsx +2 -2
- package/src/favorites/bookmark-button.analysis.md +17 -0
- package/src/favorites/favorite-button.analysis.md +18 -0
- package/src/generated/create-client-request.tsx +15 -6
- package/src/icons/file-icon.analysis.md +14 -0
- package/src/icons/flag-icon.analysis.md +14 -0
- package/src/icons/loading.analysis.md +14 -0
- package/src/info/info-table.analysis.md +15 -0
- package/src/info/info-table.tsx +8 -8
- package/src/info/shared.analysis.md +14 -0
- package/src/navbar/language-switcher/content-language-switch.analysis.md +15 -0
- package/src/navbar/language-switcher/shared.analysis.md +14 -0
- package/src/navbar/language-switcher/ui-language-switch.analysis.md +15 -0
- package/src/navbar/navbar.analysis.md +14 -0
- package/src/navbar/settings.analysis.md +14 -0
- package/src/navbar/sign-in-out-btns.analysis.md +14 -0
- package/src/navbar/user-menu.analysis.md +14 -0
- package/src/page-wrapper.analysis.md +14 -0
- package/src/render-article.analysis.md +15 -0
- package/src/renditions/file-download.analysis.md +14 -0
- package/src/renditions/html.analysis.md +17 -0
- package/src/renditions/image/container.analysis.md +15 -0
- package/src/renditions/image/rendition.analysis.md +14 -0
- package/src/restriction-menu/restriction-menu-container.analysis.md +14 -0
- package/src/restriction-menu/restriction-menu-container.tsx +2 -2
- package/src/restriction-menu/restriction-menu-item.analysis.md +14 -0
- package/src/restriction-menu/restriction-menu.analysis.md +17 -0
- package/src/restriction-menu/restriction-menu.tsx +4 -6
- package/src/results/cards.analysis.md +14 -0
- package/src/results/dialog-filter.analysis.md +17 -0
- package/src/results/dialog-filter.tsx +32 -27
- package/src/results/empty.analysis.md +14 -0
- package/src/results/filter-navbar.analysis.md +16 -0
- package/src/results/filter-sidebar/index.analysis.md +14 -0
- package/src/results/generic/table-result-list.analysis.md +15 -0
- package/src/results/generic/table-result-list.tsx +3 -3
- package/src/results/pagination.analysis.md +14 -0
- package/src/results/table-with-images.analysis.md +15 -0
- package/src/results/table-with-images.tsx +2 -2
- package/src/results/table.analysis.md +15 -0
- package/src/results/table.tsx +4 -4
- package/src/search-input.analysis.md +15 -0
- package/src/share-button.analysis.md +19 -0
package/package.json
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Analysis: article-action-bar
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/article/article-action-bar.tsx
|
|
4
|
+
- Type: Client component
|
|
5
|
+
- Detected signals: useQueryStates=no, stores=yes, window/document=no, effects=yes, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- Store subscriptions can re-render this component whenever the selected slice changes.
|
|
9
|
+
- Effects that update state can add extra renders on mount and dependency changes.
|
|
10
|
+
|
|
11
|
+
## Possible bugs/risks
|
|
12
|
+
- No critical bug is evident in this quick static pass; keep tests for error and loading paths.
|
|
13
|
+
|
|
14
|
+
## Recommended improvements
|
|
15
|
+
- Standardize loading/error handling and add regression tests to prevent divergent behavior across consuming apps.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Analysis: article-content
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/article/article-content.tsx
|
|
4
|
+
- Type: Server component
|
|
5
|
+
- Detected signals: useQueryStates=no, stores=no, window/document=no, effects=no, fetch/call=yes
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- No obvious excessive re-render trigger beyond normal prop/context updates.
|
|
9
|
+
|
|
10
|
+
## Possible bugs/risks
|
|
11
|
+
- Async flows can hit race conditions during fast param/route changes.
|
|
12
|
+
|
|
13
|
+
## Recommended improvements
|
|
14
|
+
- Consider cancellation guards (isMounted or AbortController) and standardized error handling.
|
|
15
|
+
|
|
@@ -43,8 +43,8 @@ export const ArticleContent: FC<Props> = async ({ renditions }) => {
|
|
|
43
43
|
|
|
44
44
|
return (
|
|
45
45
|
<>
|
|
46
|
-
{metaTags.map((tag
|
|
47
|
-
<meta key={
|
|
46
|
+
{metaTags.map((tag) => (
|
|
47
|
+
<meta key={`${tag.name}-${tag.content}`} name={tag.name} content={tag.content} />
|
|
48
48
|
))}
|
|
49
49
|
<div className="pr-4 relative">
|
|
50
50
|
<RenderArticle htmlContent={articleHtml} contentLang="" />
|
|
@@ -52,4 +52,4 @@ export const ArticleContent: FC<Props> = async ({ renditions }) => {
|
|
|
52
52
|
<ArticleActionBar />
|
|
53
53
|
</>
|
|
54
54
|
)
|
|
55
|
-
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Analysis: autocomplete
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/autocomplete.tsx
|
|
4
|
+
- Type: Client component
|
|
5
|
+
- Detected signals: useQueryStates=no, stores=no, window/document=yes, effects=yes, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- Effects that update state can add extra renders on mount and dependency changes.
|
|
9
|
+
|
|
10
|
+
## Possible bugs/risks
|
|
11
|
+
- Access to window/document needs care to avoid hydration mismatch and non-browser runtime issues.
|
|
12
|
+
- The component renders list-heavy UI; key stability and memoization strongly affect perceived performance.
|
|
13
|
+
|
|
14
|
+
## Recommended improvements
|
|
15
|
+
- Keep browser-only access inside event handlers or useEffect, not in initial render paths.
|
|
16
|
+
- Review key strategy and extract memoized subcomponents for large-list rendering.
|
|
17
|
+
|
package/src/autocomplete.tsx
CHANGED
|
@@ -135,9 +135,9 @@ export const AutoComplete = ({
|
|
|
135
135
|
<>
|
|
136
136
|
{suggestions.length > 0 ? (
|
|
137
137
|
<>
|
|
138
|
-
{suggestions.map((option
|
|
138
|
+
{suggestions.map((option) => (
|
|
139
139
|
<li
|
|
140
|
-
key={
|
|
140
|
+
key={option}
|
|
141
141
|
className="px-4 py-2 hover:bg-accent cursor-pointer text-sm"
|
|
142
142
|
onClick={() => handleSelect(`"${option}"`)}
|
|
143
143
|
>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Analysis: breadcrumb
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/breadcrumb.tsx
|
|
4
|
+
- Type: Client component
|
|
5
|
+
- Detected signals: useQueryStates=no, stores=no, window/document=no, effects=no, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- No obvious excessive re-render trigger beyond normal prop/context updates.
|
|
9
|
+
|
|
10
|
+
## Possible bugs/risks
|
|
11
|
+
- The component renders list-heavy UI; key stability and memoization strongly affect perceived performance.
|
|
12
|
+
|
|
13
|
+
## Recommended improvements
|
|
14
|
+
- Review key strategy and extract memoized subcomponents for large-list rendering.
|
|
15
|
+
|
package/src/breadcrumb.tsx
CHANGED
|
@@ -53,9 +53,9 @@ export const Breadcrumb: FC<BreadcrumbProps> = ({ tree, lang }) => {
|
|
|
53
53
|
</DrawerHeader>
|
|
54
54
|
|
|
55
55
|
<div className="grid gap-1 px-4">
|
|
56
|
-
{items.slice(0, -1).map((item
|
|
56
|
+
{items.slice(0, -1).map((item) => (
|
|
57
57
|
<Link
|
|
58
|
-
key={
|
|
58
|
+
key={item.linkId}
|
|
59
59
|
href={`/topics/${item.linkId}/content`}
|
|
60
60
|
className="py-1 text-sm"
|
|
61
61
|
>
|
|
@@ -103,7 +103,7 @@ export const Breadcrumb: FC<BreadcrumbProps> = ({ tree, lang }) => {
|
|
|
103
103
|
|
|
104
104
|
return (
|
|
105
105
|
<Fragment key={`${item.label}-fragment`}>
|
|
106
|
-
<BreadcrumbItem key={`${item.label}-item`}
|
|
106
|
+
<BreadcrumbItem key={`${item.label}-item`}>
|
|
107
107
|
{renderLink(!isLast, item)}
|
|
108
108
|
</BreadcrumbItem>
|
|
109
109
|
{!isLast && (
|
|
@@ -121,4 +121,4 @@ export const Breadcrumb: FC<BreadcrumbProps> = ({ tree, lang }) => {
|
|
|
121
121
|
</BreadcrumbList>
|
|
122
122
|
</BreadcrumbComponent>
|
|
123
123
|
);
|
|
124
|
-
};
|
|
124
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Analysis: carousel
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/carousel/carousel.tsx
|
|
4
|
+
- Type: Client component
|
|
5
|
+
- Detected signals: useQueryStates=no, stores=no, window/document=yes, effects=yes, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- Effects that update state can add extra renders on mount and dependency changes.
|
|
9
|
+
|
|
10
|
+
## Possible bugs/risks
|
|
11
|
+
- Access to window/document needs care to avoid hydration mismatch and non-browser runtime issues.
|
|
12
|
+
- The component renders list-heavy UI; key stability and memoization strongly affect perceived performance.
|
|
13
|
+
|
|
14
|
+
## Recommended improvements
|
|
15
|
+
- Keep browser-only access inside event handlers or useEffect, not in initial render paths.
|
|
16
|
+
- Review key strategy and extract memoized subcomponents for large-list rendering.
|
|
17
|
+
|
|
@@ -283,7 +283,7 @@ const CarouselIndicators: FC<{ className?: string }> = ({ className }) => {
|
|
|
283
283
|
return (
|
|
284
284
|
<ol className={cn("flex gap-2 z-20 list-none p-0 m-0", className)}>
|
|
285
285
|
{Array.from({ length: totalOfIndicators }).map((_, index) => (
|
|
286
|
-
<li key={index}>
|
|
286
|
+
<li key={`indicator-${index}`}>
|
|
287
287
|
<Button
|
|
288
288
|
className={`w-3 h-3 rounded-full border-0 cursor-pointer transition-colors ${index === current ? "bg-gray-800" : "bg-gray-300"}`}
|
|
289
289
|
size="xs"
|
|
@@ -349,4 +349,4 @@ const DefaultRenderCarouselItem: FC<{ item: CommonItemsModel; showImages: boolea
|
|
|
349
349
|
</Card>
|
|
350
350
|
</div>
|
|
351
351
|
);
|
|
352
|
-
};
|
|
352
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Analysis: check-article-lang
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/check-article-lang.tsx
|
|
4
|
+
- Type: Client component
|
|
5
|
+
- Detected signals: useQueryStates=no, stores=no, window/document=yes, effects=yes, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- Effects that update state can add extra renders on mount and dependency changes.
|
|
9
|
+
|
|
10
|
+
## Possible bugs/risks
|
|
11
|
+
- Access to window/document needs care to avoid hydration mismatch and non-browser runtime issues.
|
|
12
|
+
|
|
13
|
+
## Recommended improvements
|
|
14
|
+
- Keep browser-only access inside event handlers or useEffect, not in initial render paths.
|
|
15
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Analysis: tree-of-content
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/directoryNodes/tree-of-content.tsx
|
|
4
|
+
- Type: Server component
|
|
5
|
+
- Detected signals: useQueryStates=no, stores=no, window/document=no, effects=no, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- No obvious excessive re-render trigger beyond normal prop/context updates.
|
|
9
|
+
|
|
10
|
+
## Possible bugs/risks
|
|
11
|
+
- No critical bug is evident in this quick static pass; keep tests for error and loading paths.
|
|
12
|
+
|
|
13
|
+
## Recommended improvements
|
|
14
|
+
- Standardize loading/error handling and add regression tests to prevent divergent behavior across consuming apps.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Analysis: result-list
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/documents/result-list.tsx
|
|
4
|
+
- Type: Server component
|
|
5
|
+
- Detected signals: useQueryStates=no, stores=no, window/document=no, effects=no, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- No obvious excessive re-render trigger beyond normal prop/context updates.
|
|
9
|
+
|
|
10
|
+
## Possible bugs/risks
|
|
11
|
+
- No critical bug is evident in this quick static pass; keep tests for error and loading paths.
|
|
12
|
+
|
|
13
|
+
## Recommended improvements
|
|
14
|
+
- Standardize loading/error handling and add regression tests to prevent divergent behavior across consuming apps.
|
|
@@ -56,7 +56,7 @@ export const DocumentsResultList: FC<Props> = ({
|
|
|
56
56
|
|
|
57
57
|
return (
|
|
58
58
|
<div
|
|
59
|
-
key={
|
|
59
|
+
key={item.shortId}
|
|
60
60
|
className={cn(
|
|
61
61
|
"min-h-12 flex flex-wrap items-center border px-4 py-2 gap-2 rounded",
|
|
62
62
|
index == items.length - 1 ? "" : "mb-4",
|
|
@@ -124,4 +124,4 @@ export const DocumentsResultList: FC<Props> = ({
|
|
|
124
124
|
})}
|
|
125
125
|
</div>
|
|
126
126
|
);
|
|
127
|
-
};
|
|
127
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Analysis: bookmark-button
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/favorites/bookmark-button.tsx
|
|
4
|
+
- Type: Client component
|
|
5
|
+
- Detected signals: useQueryStates=no, stores=no, window/document=yes, effects=yes, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- Effects that update state can add extra renders on mount and dependency changes.
|
|
9
|
+
|
|
10
|
+
## Possible bugs/risks
|
|
11
|
+
- Access to window/document needs care to avoid hydration mismatch and non-browser runtime issues.
|
|
12
|
+
- markersList is loaded only on mount/shortId change; later store updates may not refresh the badge.
|
|
13
|
+
|
|
14
|
+
## Recommended improvements
|
|
15
|
+
- Keep browser-only access inside event handlers or useEffect, not in initial render paths.
|
|
16
|
+
- Read documents[shortId]?.topics directly through a Zustand selector to keep UI reactive.
|
|
17
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Analysis: favorite-button
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/favorites/favorite-button.tsx
|
|
4
|
+
- Type: Client component
|
|
5
|
+
- Detected signals: useQueryStates=no, stores=yes, window/document=no, effects=yes, fetch/call=yes
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- Store subscriptions can re-render this component whenever the selected slice changes.
|
|
9
|
+
- Effects that update state can add extra renders on mount and dependency changes.
|
|
10
|
+
|
|
11
|
+
## Possible bugs/risks
|
|
12
|
+
- Async flows can hit race conditions during fast param/route changes.
|
|
13
|
+
- useEffect with empty deps calls getTopicDocumentData(id) and does not react if id/type changes.
|
|
14
|
+
|
|
15
|
+
## Recommended improvements
|
|
16
|
+
- Consider cancellation guards (isMounted or AbortController) and standardized error handling.
|
|
17
|
+
- Include id and type in effect dependencies and handle fetch cancellation on unmount.
|
|
18
|
+
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
"use client";
|
|
9
9
|
|
|
10
|
-
import { useState, useEffect, useCallback } from 'react';
|
|
10
|
+
import { useState, useEffect, useCallback, useMemo } from 'react';
|
|
11
11
|
import { replacePathParams, call } from "@c-rex/utils"
|
|
12
12
|
|
|
13
13
|
type SerializedError = {
|
|
@@ -40,11 +40,21 @@ export function createClientDataRequest<T, PathParams, QueryParams>(
|
|
|
40
40
|
isLoading: true,
|
|
41
41
|
});
|
|
42
42
|
|
|
43
|
+
const pathParamsKey = useMemo(
|
|
44
|
+
() => JSON.stringify(pathParams ?? {}),
|
|
45
|
+
[pathParams]
|
|
46
|
+
);
|
|
47
|
+
const queryParamsKey = useMemo(
|
|
48
|
+
() => JSON.stringify(queryParams ?? {}),
|
|
49
|
+
[queryParams]
|
|
50
|
+
);
|
|
51
|
+
|
|
43
52
|
const fetchData = useCallback(async () => {
|
|
44
|
-
setState({
|
|
45
|
-
...
|
|
53
|
+
setState((prev) => ({
|
|
54
|
+
...prev,
|
|
46
55
|
error: null,
|
|
47
|
-
|
|
56
|
+
isLoading: true,
|
|
57
|
+
}));
|
|
48
58
|
|
|
49
59
|
try {
|
|
50
60
|
const url = replacePathParams(endpointTemplate, pathParams as Record<string, string>);
|
|
@@ -66,8 +76,7 @@ export function createClientDataRequest<T, PathParams, QueryParams>(
|
|
|
66
76
|
isLoading: false,
|
|
67
77
|
});
|
|
68
78
|
}
|
|
69
|
-
|
|
70
|
-
}, [endpointTemplate, pathParams]);
|
|
79
|
+
}, [endpointTemplate, pathParamsKey, queryParamsKey]);
|
|
71
80
|
|
|
72
81
|
|
|
73
82
|
// Initial fetch
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Analysis: file-icon
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/icons/file-icon.tsx
|
|
4
|
+
- Type: Server component
|
|
5
|
+
- Detected signals: useQueryStates=no, stores=no, window/document=no, effects=no, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- No obvious excessive re-render trigger beyond normal prop/context updates.
|
|
9
|
+
|
|
10
|
+
## Possible bugs/risks
|
|
11
|
+
- No critical bug is evident in this quick static pass; keep tests for error and loading paths.
|
|
12
|
+
|
|
13
|
+
## Recommended improvements
|
|
14
|
+
- Standardize loading/error handling and add regression tests to prevent divergent behavior across consuming apps.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Analysis: flag-icon
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/icons/flag-icon.tsx
|
|
4
|
+
- Type: Server component
|
|
5
|
+
- Detected signals: useQueryStates=no, stores=no, window/document=no, effects=no, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- No obvious excessive re-render trigger beyond normal prop/context updates.
|
|
9
|
+
|
|
10
|
+
## Possible bugs/risks
|
|
11
|
+
- No critical bug is evident in this quick static pass; keep tests for error and loading paths.
|
|
12
|
+
|
|
13
|
+
## Recommended improvements
|
|
14
|
+
- Standardize loading/error handling and add regression tests to prevent divergent behavior across consuming apps.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Analysis: loading
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/icons/loading.tsx
|
|
4
|
+
- Type: Server component
|
|
5
|
+
- Detected signals: useQueryStates=no, stores=no, window/document=no, effects=no, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- No obvious excessive re-render trigger beyond normal prop/context updates.
|
|
9
|
+
|
|
10
|
+
## Possible bugs/risks
|
|
11
|
+
- No critical bug is evident in this quick static pass; keep tests for error and loading paths.
|
|
12
|
+
|
|
13
|
+
## Recommended improvements
|
|
14
|
+
- Standardize loading/error handling and add regression tests to prevent divergent behavior across consuming apps.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Analysis: info-table
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/info/info-table.tsx
|
|
4
|
+
- Type: Server component
|
|
5
|
+
- Detected signals: useQueryStates=no, stores=no, window/document=no, effects=no, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- No obvious excessive re-render trigger beyond normal prop/context updates.
|
|
9
|
+
|
|
10
|
+
## Possible bugs/risks
|
|
11
|
+
- The component renders list-heavy UI; key stability and memoization strongly affect perceived performance.
|
|
12
|
+
|
|
13
|
+
## Recommended improvements
|
|
14
|
+
- Review key strategy and extract memoized subcomponents for large-list rendering.
|
|
15
|
+
|
package/src/info/info-table.tsx
CHANGED
|
@@ -56,8 +56,8 @@ export const InfoTable: FC<Props> = async ({
|
|
|
56
56
|
<CardContent className="space-y-3 !p-0">
|
|
57
57
|
<Table>
|
|
58
58
|
<TableBody>
|
|
59
|
-
{processDataToLabelValuePairs(data).map((item
|
|
60
|
-
<TableRow key={
|
|
59
|
+
{processDataToLabelValuePairs(data).map((item) => (
|
|
60
|
+
<TableRow key={item.label} className="min-h-12">
|
|
61
61
|
<TableCell className="font-medium w-28 pl-4">
|
|
62
62
|
<h4 className="text-sm font-medium capitalize">{t(item.label)}</h4>
|
|
63
63
|
</TableCell>
|
|
@@ -108,24 +108,24 @@ export const InfoTable: FC<Props> = async ({
|
|
|
108
108
|
</TableCell>
|
|
109
109
|
<TableCell className="text-xs text-muted-foreground flex items-center gap-2 min-h-12">
|
|
110
110
|
|
|
111
|
-
{Object.keys(files).map((
|
|
112
|
-
if (!files[
|
|
111
|
+
{Object.keys(files).map((fileKey) => {
|
|
112
|
+
if (!files[fileKey]) return null
|
|
113
113
|
|
|
114
114
|
return (
|
|
115
|
-
<DropdownMenu key={
|
|
115
|
+
<DropdownMenu key={fileKey}>
|
|
116
116
|
<DropdownMenuTrigger className="mr-2" asChild >
|
|
117
117
|
<Button variant="outline" size="icon" >
|
|
118
|
-
<FileIcon extension={
|
|
118
|
+
<FileIcon extension={fileKey} />
|
|
119
119
|
</Button>
|
|
120
120
|
</DropdownMenuTrigger>
|
|
121
121
|
<DropdownMenuContent>
|
|
122
122
|
<DropdownMenuItem>
|
|
123
|
-
<a href={files[
|
|
123
|
+
<a href={files[fileKey].view} target="_blank" rel="noreferrer" className="flex items-center">
|
|
124
124
|
<Eye className="mr-2" /> Open
|
|
125
125
|
</a>
|
|
126
126
|
</DropdownMenuItem>
|
|
127
127
|
<DropdownMenuItem>
|
|
128
|
-
<a href={files[
|
|
128
|
+
<a href={files[fileKey].download} target="_blank" rel="noreferrer" className="flex items-center">
|
|
129
129
|
<CloudDownload className="mr-2" /> Download
|
|
130
130
|
</a>
|
|
131
131
|
</DropdownMenuItem>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Analysis: shared
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/info/shared.tsx
|
|
4
|
+
- Type: Server component
|
|
5
|
+
- Detected signals: useQueryStates=no, stores=no, window/document=no, effects=no, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- No obvious excessive re-render trigger beyond normal prop/context updates.
|
|
9
|
+
|
|
10
|
+
## Possible bugs/risks
|
|
11
|
+
- No critical bug is evident in this quick static pass; keep tests for error and loading paths.
|
|
12
|
+
|
|
13
|
+
## Recommended improvements
|
|
14
|
+
- Standardize loading/error handling and add regression tests to prevent divergent behavior across consuming apps.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Analysis: content-language-switch
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/navbar/language-switcher/content-language-switch.tsx
|
|
4
|
+
- Type: Client component
|
|
5
|
+
- Detected signals: useQueryStates=no, stores=no, window/document=yes, effects=no, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- No obvious excessive re-render trigger beyond normal prop/context updates.
|
|
9
|
+
|
|
10
|
+
## Possible bugs/risks
|
|
11
|
+
- Access to window/document needs care to avoid hydration mismatch and non-browser runtime issues.
|
|
12
|
+
|
|
13
|
+
## Recommended improvements
|
|
14
|
+
- Keep browser-only access inside event handlers or useEffect, not in initial render paths.
|
|
15
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Analysis: shared
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/navbar/language-switcher/shared.tsx
|
|
4
|
+
- Type: Server component
|
|
5
|
+
- Detected signals: useQueryStates=no, stores=no, window/document=no, effects=no, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- No obvious excessive re-render trigger beyond normal prop/context updates.
|
|
9
|
+
|
|
10
|
+
## Possible bugs/risks
|
|
11
|
+
- No critical bug is evident in this quick static pass; keep tests for error and loading paths.
|
|
12
|
+
|
|
13
|
+
## Recommended improvements
|
|
14
|
+
- Standardize loading/error handling and add regression tests to prevent divergent behavior across consuming apps.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Analysis: ui-language-switch
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/navbar/language-switcher/ui-language-switch.tsx
|
|
4
|
+
- Type: Client component
|
|
5
|
+
- Detected signals: useQueryStates=no, stores=yes, window/document=yes, effects=no, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- Store subscriptions can re-render this component whenever the selected slice changes.
|
|
9
|
+
|
|
10
|
+
## Possible bugs/risks
|
|
11
|
+
- Access to window/document needs care to avoid hydration mismatch and non-browser runtime issues.
|
|
12
|
+
|
|
13
|
+
## Recommended improvements
|
|
14
|
+
- Keep browser-only access inside event handlers or useEffect, not in initial render paths.
|
|
15
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Analysis: navbar
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/navbar/navbar.tsx
|
|
4
|
+
- Type: Server component
|
|
5
|
+
- Detected signals: useQueryStates=no, stores=no, window/document=no, effects=no, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- No obvious excessive re-render trigger beyond normal prop/context updates.
|
|
9
|
+
|
|
10
|
+
## Possible bugs/risks
|
|
11
|
+
- No critical bug is evident in this quick static pass; keep tests for error and loading paths.
|
|
12
|
+
|
|
13
|
+
## Recommended improvements
|
|
14
|
+
- Standardize loading/error handling and add regression tests to prevent divergent behavior across consuming apps.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Analysis: settings
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/navbar/settings.tsx
|
|
4
|
+
- Type: Server component
|
|
5
|
+
- Detected signals: useQueryStates=no, stores=no, window/document=no, effects=no, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- No obvious excessive re-render trigger beyond normal prop/context updates.
|
|
9
|
+
|
|
10
|
+
## Possible bugs/risks
|
|
11
|
+
- No critical bug is evident in this quick static pass; keep tests for error and loading paths.
|
|
12
|
+
|
|
13
|
+
## Recommended improvements
|
|
14
|
+
- Standardize loading/error handling and add regression tests to prevent divergent behavior across consuming apps.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Analysis: sign-in-out-btns
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/navbar/sign-in-out-btns.tsx
|
|
4
|
+
- Type: Client component
|
|
5
|
+
- Detected signals: useQueryStates=no, stores=no, window/document=no, effects=no, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- No obvious excessive re-render trigger beyond normal prop/context updates.
|
|
9
|
+
|
|
10
|
+
## Possible bugs/risks
|
|
11
|
+
- No critical bug is evident in this quick static pass; keep tests for error and loading paths.
|
|
12
|
+
|
|
13
|
+
## Recommended improvements
|
|
14
|
+
- Standardize loading/error handling and add regression tests to prevent divergent behavior across consuming apps.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Analysis: user-menu
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/navbar/user-menu.tsx
|
|
4
|
+
- Type: Client component
|
|
5
|
+
- Detected signals: useQueryStates=no, stores=no, window/document=no, effects=no, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- No obvious excessive re-render trigger beyond normal prop/context updates.
|
|
9
|
+
|
|
10
|
+
## Possible bugs/risks
|
|
11
|
+
- No critical bug is evident in this quick static pass; keep tests for error and loading paths.
|
|
12
|
+
|
|
13
|
+
## Recommended improvements
|
|
14
|
+
- Standardize loading/error handling and add regression tests to prevent divergent behavior across consuming apps.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Analysis: page-wrapper
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/page-wrapper.tsx
|
|
4
|
+
- Type: Server component
|
|
5
|
+
- Detected signals: useQueryStates=no, stores=no, window/document=no, effects=no, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- No obvious excessive re-render trigger beyond normal prop/context updates.
|
|
9
|
+
|
|
10
|
+
## Possible bugs/risks
|
|
11
|
+
- No critical bug is evident in this quick static pass; keep tests for error and loading paths.
|
|
12
|
+
|
|
13
|
+
## Recommended improvements
|
|
14
|
+
- Standardize loading/error handling and add regression tests to prevent divergent behavior across consuming apps.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Analysis: render-article
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/render-article.tsx
|
|
4
|
+
- Type: Client component
|
|
5
|
+
- Detected signals: useQueryStates=no, stores=yes, window/document=no, effects=yes, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- Store subscriptions can re-render this component whenever the selected slice changes.
|
|
9
|
+
- Effects that update state can add extra renders on mount and dependency changes.
|
|
10
|
+
|
|
11
|
+
## Possible bugs/risks
|
|
12
|
+
- No critical bug is evident in this quick static pass; keep tests for error and loading paths.
|
|
13
|
+
|
|
14
|
+
## Recommended improvements
|
|
15
|
+
- Standardize loading/error handling and add regression tests to prevent divergent behavior across consuming apps.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Analysis: file-download
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/renditions/file-download.tsx
|
|
4
|
+
- Type: Server component
|
|
5
|
+
- Detected signals: useQueryStates=no, stores=no, window/document=no, effects=no, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- No obvious excessive re-render trigger beyond normal prop/context updates.
|
|
9
|
+
|
|
10
|
+
## Possible bugs/risks
|
|
11
|
+
- No critical bug is evident in this quick static pass; keep tests for error and loading paths.
|
|
12
|
+
|
|
13
|
+
## Recommended improvements
|
|
14
|
+
- Standardize loading/error handling and add regression tests to prevent divergent behavior across consuming apps.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Analysis: html
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/renditions/html.tsx
|
|
4
|
+
- Type: Server component
|
|
5
|
+
- Detected signals: useQueryStates=no, stores=no, window/document=no, effects=no, fetch/call=yes
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- No obvious excessive re-render trigger beyond normal prop/context updates.
|
|
9
|
+
|
|
10
|
+
## Possible bugs/risks
|
|
11
|
+
- Async flows can hit race conditions during fast param/route changes.
|
|
12
|
+
- fetch(url) runs inside async server rendering path and can increase list/page latency.
|
|
13
|
+
|
|
14
|
+
## Recommended improvements
|
|
15
|
+
- Consider cancellation guards (isMounted or AbortController) and standardized error handling.
|
|
16
|
+
- Consider caching/revalidation and lighter fallback strategy to reduce N+1 impact.
|
|
17
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Analysis: container
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/renditions/image/container.tsx
|
|
4
|
+
- Type: Client component
|
|
5
|
+
- Detected signals: useQueryStates=no, stores=no, window/document=no, effects=no, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- No obvious excessive re-render trigger beyond normal prop/context updates.
|
|
9
|
+
|
|
10
|
+
## Possible bugs/risks
|
|
11
|
+
- imageRestrictions prop exists but is not applied to Restrict composition.
|
|
12
|
+
|
|
13
|
+
## Recommended improvements
|
|
14
|
+
- Apply imageRestrictions to Restrict or remove the prop to avoid misleading API behavior.
|
|
15
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Analysis: rendition
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/renditions/image/rendition.tsx
|
|
4
|
+
- Type: Server component
|
|
5
|
+
- Detected signals: useQueryStates=no, stores=no, window/document=no, effects=no, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- No obvious excessive re-render trigger beyond normal prop/context updates.
|
|
9
|
+
|
|
10
|
+
## Possible bugs/risks
|
|
11
|
+
- No critical bug is evident in this quick static pass; keep tests for error and loading paths.
|
|
12
|
+
|
|
13
|
+
## Recommended improvements
|
|
14
|
+
- Standardize loading/error handling and add regression tests to prevent divergent behavior across consuming apps.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Analysis: restriction-menu-container
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/restriction-menu/restriction-menu-container.tsx
|
|
4
|
+
- Type: Client component
|
|
5
|
+
- Detected signals: useQueryStates=no, stores=no, window/document=no, effects=no, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- No obvious excessive re-render trigger beyond normal prop/context updates.
|
|
9
|
+
|
|
10
|
+
## Possible bugs/risks
|
|
11
|
+
- No critical bug is evident in this quick static pass; keep tests for error and loading paths.
|
|
12
|
+
|
|
13
|
+
## Recommended improvements
|
|
14
|
+
- Standardize loading/error handling and add regression tests to prevent divergent behavior across consuming apps.
|
|
@@ -38,7 +38,7 @@ export const RestrictionMenuContainer: FC<Props> = ({
|
|
|
38
38
|
<div className="flex justify-between">
|
|
39
39
|
<Skeleton className="w-12 h-9 rounded-full" />
|
|
40
40
|
{Array(itemsToRender).fill(0).map((_, index) => (
|
|
41
|
-
<Skeleton key={index} className="w-28 h-9 rounded-full" />
|
|
41
|
+
<Skeleton key={`skeleton-${index}`} className="w-28 h-9 rounded-full" />
|
|
42
42
|
))}
|
|
43
43
|
<Skeleton className="w-20 h-9 rounded-full" />
|
|
44
44
|
</div>
|
|
@@ -50,4 +50,4 @@ export const RestrictionMenuContainer: FC<Props> = ({
|
|
|
50
50
|
}}
|
|
51
51
|
</RequestComponent>
|
|
52
52
|
);
|
|
53
|
-
};
|
|
53
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Analysis: restriction-menu-item
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/restriction-menu/restriction-menu-item.tsx
|
|
4
|
+
- Type: Client component
|
|
5
|
+
- Detected signals: useQueryStates=no, stores=no, window/document=no, effects=no, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- No obvious excessive re-render trigger beyond normal prop/context updates.
|
|
9
|
+
|
|
10
|
+
## Possible bugs/risks
|
|
11
|
+
- No critical bug is evident in this quick static pass; keep tests for error and loading paths.
|
|
12
|
+
|
|
13
|
+
## Recommended improvements
|
|
14
|
+
- Standardize loading/error handling and add regression tests to prevent divergent behavior across consuming apps.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Analysis: restriction-menu
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/restriction-menu/restriction-menu.tsx
|
|
4
|
+
- Type: Client component
|
|
5
|
+
- Detected signals: useQueryStates=yes, stores=yes, window/document=no, effects=yes, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- useQueryStates triggers re-renders whenever relevant query-string values change.
|
|
9
|
+
- Store subscriptions can re-render this component whenever the selected slice changes.
|
|
10
|
+
- Effects that update state can add extra renders on mount and dependency changes.
|
|
11
|
+
|
|
12
|
+
## Possible bugs/risks
|
|
13
|
+
- Breakpoint-driven sorting/partitioning can trigger chained updates (visibleCount, visibleItems, hiddenItems).
|
|
14
|
+
|
|
15
|
+
## Recommended improvements
|
|
16
|
+
- Derive visibleItems/hiddenItems via useMemo from sortedItems + visibleCount to reduce duplicated state.
|
|
17
|
+
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { FC,
|
|
3
|
+
import { FC, useEffect, useMemo, useState } from "react"
|
|
4
4
|
import {
|
|
5
5
|
NavigationMenu,
|
|
6
6
|
NavigationMenuList,
|
|
7
7
|
NavigationMenuItem,
|
|
8
|
-
NavigationMenuLink,
|
|
9
8
|
} from "@c-rex/ui/navigation-menu";
|
|
10
|
-
import Link from "next/link";
|
|
11
9
|
import { Button } from "@c-rex/ui/button";
|
|
12
|
-
import { ChevronDown
|
|
10
|
+
import { ChevronDown } from "lucide-react";
|
|
13
11
|
import { DropdownHoverItem } from "@c-rex/ui/dropdown-hover-item";
|
|
14
12
|
import { RestrictionDropdownItem, RestrictionNavigationItem } from "./restriction-menu-item";
|
|
15
13
|
import { parseAsString, useQueryStates } from "nuqs";
|
|
@@ -58,7 +56,7 @@ export const RestrictionMenu: FC<Props> = ({
|
|
|
58
56
|
const uiLang = useLanguageStore.getState().uiLang;
|
|
59
57
|
const lang = uiLang?.split("-")[0] ?? "";
|
|
60
58
|
|
|
61
|
-
|
|
59
|
+
useEffect(() => {
|
|
62
60
|
const map = new Map<string, string>();
|
|
63
61
|
items.forEach((item) => {
|
|
64
62
|
const label = getLabelByLang(item.labels, lang);
|
|
@@ -154,4 +152,4 @@ export const RestrictionMenu: FC<Props> = ({
|
|
|
154
152
|
</NavigationMenuList>
|
|
155
153
|
</NavigationMenu>
|
|
156
154
|
);
|
|
157
|
-
};
|
|
155
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Analysis: cards
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/results/cards.tsx
|
|
4
|
+
- Type: Client component
|
|
5
|
+
- Detected signals: useQueryStates=no, stores=no, window/document=no, effects=no, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- No obvious excessive re-render trigger beyond normal prop/context updates.
|
|
9
|
+
|
|
10
|
+
## Possible bugs/risks
|
|
11
|
+
- No critical bug is evident in this quick static pass; keep tests for error and loading paths.
|
|
12
|
+
|
|
13
|
+
## Recommended improvements
|
|
14
|
+
- Standardize loading/error handling and add regression tests to prevent divergent behavior across consuming apps.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Analysis: dialog-filter
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/results/dialog-filter.tsx
|
|
4
|
+
- Type: Client component
|
|
5
|
+
- Detected signals: useQueryStates=yes, stores=yes, window/document=no, effects=no, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- useQueryStates triggers re-renders whenever relevant query-string values change.
|
|
9
|
+
- Store subscriptions can re-render this component whenever the selected slice changes.
|
|
10
|
+
- Form changes and URL/store synchronization can re-render the dialog multiple times in dev mode.
|
|
11
|
+
|
|
12
|
+
## Possible bugs/risks
|
|
13
|
+
- No critical bug is evident in this quick static pass; keep tests for error and loading paths.
|
|
14
|
+
|
|
15
|
+
## Recommended improvements
|
|
16
|
+
- If needed, memoize trigger in parent and consider React.memo when props are stable.
|
|
17
|
+
|
|
@@ -26,18 +26,18 @@ interface Props {
|
|
|
26
26
|
trigger: React.ReactNode;
|
|
27
27
|
}
|
|
28
28
|
export const DialogFilter: FC<Props> = ({ trigger }) => {
|
|
29
|
-
console.log("Render DialogFilter")
|
|
30
29
|
const t = useTranslations("filter");
|
|
31
|
-
const searchLanguage = useSearchSettingsStore(state => state.language);
|
|
32
30
|
const availableLanguagesAndCountries = useLanguageStore(state => state.availableLanguages);
|
|
31
|
+
const initialSettings = useSearchSettingsStore.getState();
|
|
33
32
|
|
|
34
|
-
const [
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
const [form, setForm] = useState({
|
|
34
|
+
like: initialSettings.like,
|
|
35
|
+
operator: initialSettings.operator as string,
|
|
36
|
+
wildcard: initialSettings.wildcard as string,
|
|
37
|
+
language: initialSettings.language || '',
|
|
38
|
+
});
|
|
38
39
|
|
|
39
|
-
const [
|
|
40
|
-
search: parseAsString,
|
|
40
|
+
const [, setParams] = useQueryStates({
|
|
41
41
|
language: parseAsString,
|
|
42
42
|
page: parseAsInteger,
|
|
43
43
|
wildcard: parseAsString,
|
|
@@ -50,27 +50,29 @@ export const DialogFilter: FC<Props> = ({ trigger }) => {
|
|
|
50
50
|
|
|
51
51
|
const apply = () => {
|
|
52
52
|
useSearchSettingsStore.getState().updatePreferences({
|
|
53
|
-
like,
|
|
54
|
-
operator: operator as OperatorType,
|
|
55
|
-
wildcard: wildcard as WildCardType,
|
|
56
|
-
language: language,
|
|
53
|
+
like: form.like,
|
|
54
|
+
operator: form.operator as OperatorType,
|
|
55
|
+
wildcard: form.wildcard as WildCardType,
|
|
56
|
+
language: form.language,
|
|
57
57
|
});
|
|
58
58
|
|
|
59
59
|
setParams({
|
|
60
60
|
page: 1,
|
|
61
|
-
language: language,
|
|
62
|
-
operator: operator,
|
|
63
|
-
wildcard: wildcard,
|
|
64
|
-
like: like,
|
|
61
|
+
language: form.language,
|
|
62
|
+
operator: form.operator,
|
|
63
|
+
wildcard: form.wildcard,
|
|
64
|
+
like: form.like,
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
const reload = () => {
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
const settings = useSearchSettingsStore.getState();
|
|
70
|
+
setForm({
|
|
71
|
+
like: settings.like,
|
|
72
|
+
operator: settings.operator,
|
|
73
|
+
wildcard: settings.wildcard,
|
|
74
|
+
language: settings.language || '',
|
|
75
|
+
});
|
|
74
76
|
};
|
|
75
77
|
|
|
76
78
|
return (
|
|
@@ -88,7 +90,7 @@ export const DialogFilter: FC<Props> = ({ trigger }) => {
|
|
|
88
90
|
{t("languages")}:
|
|
89
91
|
</Label>
|
|
90
92
|
<div className="flex items-center">
|
|
91
|
-
<Select onValueChange={
|
|
93
|
+
<Select onValueChange={(language) => setForm((prev) => ({ ...prev, language }))} value={form.language}>
|
|
92
94
|
<SelectTrigger className="w-[180px]">
|
|
93
95
|
<SelectValue placeholder="" />
|
|
94
96
|
</SelectTrigger>
|
|
@@ -110,7 +112,10 @@ export const DialogFilter: FC<Props> = ({ trigger }) => {
|
|
|
110
112
|
{t("wildcard")}:
|
|
111
113
|
</Label>
|
|
112
114
|
<div className="flex items-center">
|
|
113
|
-
<Select
|
|
115
|
+
<Select
|
|
116
|
+
onValueChange={(wildcard) => setForm((prev) => ({ ...prev, wildcard }))}
|
|
117
|
+
value={form.wildcard}
|
|
118
|
+
>
|
|
114
119
|
<SelectTrigger className="w-[180px]">
|
|
115
120
|
<SelectValue placeholder="" />
|
|
116
121
|
</SelectTrigger>
|
|
@@ -136,8 +141,8 @@ export const DialogFilter: FC<Props> = ({ trigger }) => {
|
|
|
136
141
|
|
|
137
142
|
<Switch
|
|
138
143
|
id="operator"
|
|
139
|
-
onCheckedChange={(value) =>
|
|
140
|
-
checked={operator == OPERATOR_OPTIONS.AND}
|
|
144
|
+
onCheckedChange={(value) => setForm((prev) => ({ ...prev, operator: value ? OPERATOR_OPTIONS.AND : OPERATOR_OPTIONS.OR }))}
|
|
145
|
+
checked={form.operator == OPERATOR_OPTIONS.AND}
|
|
141
146
|
/>
|
|
142
147
|
</div>
|
|
143
148
|
|
|
@@ -145,13 +150,13 @@ export const DialogFilter: FC<Props> = ({ trigger }) => {
|
|
|
145
150
|
<Label htmlFor="like" className="text-right">
|
|
146
151
|
{t("like")}:
|
|
147
152
|
</Label>
|
|
148
|
-
<Switch id="like" onCheckedChange={(
|
|
153
|
+
<Switch id="like" onCheckedChange={(like) => setForm((prev) => ({ ...prev, like }))} checked={form.like} />
|
|
149
154
|
</div>
|
|
150
155
|
|
|
151
156
|
<DialogFooter className="pt-2">
|
|
152
157
|
<DialogClose asChild>
|
|
153
158
|
<Button onClick={apply}>
|
|
154
|
-
{
|
|
159
|
+
{t("apply")}
|
|
155
160
|
</Button>
|
|
156
161
|
</DialogClose>
|
|
157
162
|
</DialogFooter>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Analysis: empty
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/results/empty.tsx
|
|
4
|
+
- Type: Server component
|
|
5
|
+
- Detected signals: useQueryStates=no, stores=no, window/document=no, effects=no, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- No obvious excessive re-render trigger beyond normal prop/context updates.
|
|
9
|
+
|
|
10
|
+
## Possible bugs/risks
|
|
11
|
+
- No critical bug is evident in this quick static pass; keep tests for error and loading paths.
|
|
12
|
+
|
|
13
|
+
## Recommended improvements
|
|
14
|
+
- Standardize loading/error handling and add regression tests to prevent divergent behavior across consuming apps.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Analysis: filter-navbar
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/results/filter-navbar.tsx
|
|
4
|
+
- Type: Client component
|
|
5
|
+
- Detected signals: useQueryStates=yes, stores=yes, window/document=no, effects=no, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- useQueryStates triggers re-renders whenever relevant query-string values change.
|
|
9
|
+
- Store subscriptions can re-render this component whenever the selected slice changes.
|
|
10
|
+
|
|
11
|
+
## Possible bugs/risks
|
|
12
|
+
- Query defaults based on getState() may diverge between SSR and CSR when cookie/store state changes between renders.
|
|
13
|
+
|
|
14
|
+
## Recommended improvements
|
|
15
|
+
- Centralize defaults from server-provided props or a stable context to reduce mismatch risk.
|
|
16
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Analysis: index
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/results/filter-sidebar/index.tsx
|
|
4
|
+
- Type: Client component
|
|
5
|
+
- Detected signals: useQueryStates=yes, stores=no, window/document=no, effects=no, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- useQueryStates triggers re-renders whenever relevant query-string values change.
|
|
9
|
+
|
|
10
|
+
## Possible bugs/risks
|
|
11
|
+
- No critical bug is evident in this quick static pass; keep tests for error and loading paths.
|
|
12
|
+
|
|
13
|
+
## Recommended improvements
|
|
14
|
+
- Standardize loading/error handling and add regression tests to prevent divergent behavior across consuming apps.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Analysis: table-result-list
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/results/generic/table-result-list.tsx
|
|
4
|
+
- Type: Server component
|
|
5
|
+
- Detected signals: useQueryStates=no, stores=no, window/document=no, effects=no, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- No obvious excessive re-render trigger beyond normal prop/context updates.
|
|
9
|
+
|
|
10
|
+
## Possible bugs/risks
|
|
11
|
+
- The component renders list-heavy UI; key stability and memoization strongly affect perceived performance.
|
|
12
|
+
|
|
13
|
+
## Recommended improvements
|
|
14
|
+
- Review key strategy and extract memoized subcomponents for large-list rendering.
|
|
15
|
+
|
|
@@ -36,7 +36,7 @@ export const GenericTableResultList: FC<Props> = async ({
|
|
|
36
36
|
}
|
|
37
37
|
</div>
|
|
38
38
|
|
|
39
|
-
{items.map((item
|
|
39
|
+
{items.map((item) => {
|
|
40
40
|
const title = getTitle(item.titles, item.labels);
|
|
41
41
|
const itemType = getType(item.class);
|
|
42
42
|
const language = getLanguage(item.languages);
|
|
@@ -66,7 +66,7 @@ export const GenericTableResultList: FC<Props> = async ({
|
|
|
66
66
|
"min-h-12 c-rex-result-item flex flex-wrap items-center border-b",
|
|
67
67
|
`c-rex-result-${itemType.toLowerCase()}`,
|
|
68
68
|
)}
|
|
69
|
-
key={
|
|
69
|
+
key={item.shortId}
|
|
70
70
|
>
|
|
71
71
|
<div className="flex-1 p-2">
|
|
72
72
|
<Link href={link} className="hover:underline">{title}</Link>
|
|
@@ -96,4 +96,4 @@ export const GenericTableResultList: FC<Props> = async ({
|
|
|
96
96
|
})}
|
|
97
97
|
</div>
|
|
98
98
|
);
|
|
99
|
-
};
|
|
99
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Analysis: pagination
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/results/pagination.tsx
|
|
4
|
+
- Type: Client component
|
|
5
|
+
- Detected signals: useQueryStates=no, stores=no, window/document=no, effects=no, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- No obvious excessive re-render trigger beyond normal prop/context updates.
|
|
9
|
+
|
|
10
|
+
## Possible bugs/risks
|
|
11
|
+
- No critical bug is evident in this quick static pass; keep tests for error and loading paths.
|
|
12
|
+
|
|
13
|
+
## Recommended improvements
|
|
14
|
+
- Standardize loading/error handling and add regression tests to prevent divergent behavior across consuming apps.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Analysis: table-with-images
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/results/table-with-images.tsx
|
|
4
|
+
- Type: Server component
|
|
5
|
+
- Detected signals: useQueryStates=no, stores=no, window/document=no, effects=no, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- No obvious excessive re-render trigger beyond normal prop/context updates.
|
|
9
|
+
|
|
10
|
+
## Possible bugs/risks
|
|
11
|
+
- The component renders list-heavy UI; key stability and memoization strongly affect perceived performance.
|
|
12
|
+
|
|
13
|
+
## Recommended improvements
|
|
14
|
+
- Review key strategy and extract memoized subcomponents for large-list rendering.
|
|
15
|
+
|
|
@@ -51,7 +51,7 @@ export const TableWithImage: FC<TableWithImageProps> = ({
|
|
|
51
51
|
|
|
52
52
|
return (
|
|
53
53
|
<div
|
|
54
|
-
key={
|
|
54
|
+
key={item.shortId}
|
|
55
55
|
className={cn(
|
|
56
56
|
"min-h-12 flex flex-wrap items-center border px-4 py-2 gap-2 rounded",
|
|
57
57
|
index == items.length - 1 ? "" : "mb-4",
|
|
@@ -124,4 +124,4 @@ export const TableWithImage: FC<TableWithImageProps> = ({
|
|
|
124
124
|
})}
|
|
125
125
|
</div>
|
|
126
126
|
);
|
|
127
|
-
};
|
|
127
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Analysis: table
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/results/table.tsx
|
|
4
|
+
- Type: Server component
|
|
5
|
+
- Detected signals: useQueryStates=no, stores=no, window/document=no, effects=no, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- No obvious excessive re-render trigger beyond normal prop/context updates.
|
|
9
|
+
|
|
10
|
+
## Possible bugs/risks
|
|
11
|
+
- The component renders list-heavy UI; key stability and memoization strongly affect perceived performance.
|
|
12
|
+
|
|
13
|
+
## Recommended improvements
|
|
14
|
+
- Review key strategy and extract memoized subcomponents for large-list rendering.
|
|
15
|
+
|
package/src/results/table.tsx
CHANGED
|
@@ -31,7 +31,7 @@ const TableView: FC<TableViewProps> = ({ items }) => {
|
|
|
31
31
|
<div className="w-1/2 md:w-1/5 p-2 flex justify-center">{t("files")}</div>
|
|
32
32
|
</div>
|
|
33
33
|
|
|
34
|
-
{items.map((item
|
|
34
|
+
{items.map((item) => (
|
|
35
35
|
<div
|
|
36
36
|
className={cn(
|
|
37
37
|
"min-h-12 c-rex-result-item flex flex-wrap items-center",
|
|
@@ -39,7 +39,7 @@ const TableView: FC<TableViewProps> = ({ items }) => {
|
|
|
39
39
|
item.disabled && "c-rex-result-item-disabled",
|
|
40
40
|
"border-b"
|
|
41
41
|
)}
|
|
42
|
-
key={
|
|
42
|
+
key={item.shortId}
|
|
43
43
|
>
|
|
44
44
|
<div className="w-4/5 md:w-2/5 p-2">
|
|
45
45
|
{item.disabled ? (item.title) : (<a href={`${item.link}?q=${query}`}>{item.title}</a>)}
|
|
@@ -64,14 +64,14 @@ const TableView: FC<TableViewProps> = ({ items }) => {
|
|
|
64
64
|
null // remove null rendering
|
|
65
65
|
) : (
|
|
66
66
|
<>
|
|
67
|
-
{Object.keys(item.files).map((fileKey
|
|
67
|
+
{Object.keys(item.files).map((fileKey) => {
|
|
68
68
|
|
|
69
69
|
if (!item.files[fileKey]) {
|
|
70
70
|
return null
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
return (
|
|
74
|
-
<DropdownMenu key={
|
|
74
|
+
<DropdownMenu key={fileKey}>
|
|
75
75
|
<DropdownMenuTrigger className="mx-2">
|
|
76
76
|
{IconsToFileExtension[fileKey]}
|
|
77
77
|
</DropdownMenuTrigger>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Analysis: search-input
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/search-input.tsx
|
|
4
|
+
- Type: Client component
|
|
5
|
+
- Detected signals: useQueryStates=no, stores=no, window/document=no, effects=yes, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- Effects that update state can add extra renders on mount and dependency changes.
|
|
9
|
+
|
|
10
|
+
## Possible bugs/risks
|
|
11
|
+
- Dynamic autocomplete component selection based on pathname/local state can add redundant mount renders.
|
|
12
|
+
|
|
13
|
+
## Recommended improvements
|
|
14
|
+
- Avoid derived state when possible; compute autocomplete type with useMemo.
|
|
15
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Analysis: share-button
|
|
2
|
+
|
|
3
|
+
- Component: packages/components/src/share-button.tsx
|
|
4
|
+
- Type: Client component
|
|
5
|
+
- Detected signals: useQueryStates=no, stores=no, window/document=yes, effects=yes, fetch/call=no
|
|
6
|
+
|
|
7
|
+
## Possible re-render causes
|
|
8
|
+
- Effects that update state can add extra renders on mount and dependency changes.
|
|
9
|
+
|
|
10
|
+
## Possible bugs/risks
|
|
11
|
+
- Access to window/document needs care to avoid hydration mismatch and non-browser runtime issues.
|
|
12
|
+
- Console logs in production can add noise and leak internal details.
|
|
13
|
+
- Timeout used to reset copied state is not cleaned up on unmount.
|
|
14
|
+
|
|
15
|
+
## Recommended improvements
|
|
16
|
+
- Keep browser-only access inside event handlers or useEffect, not in initial render paths.
|
|
17
|
+
- Remove debug logs or gate them by environment flag.
|
|
18
|
+
- Store timer in ref and clear it in effect cleanup.
|
|
19
|
+
|