@c-rex/components 0.1.31 → 0.1.33
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 +15 -0
- package/src/favorites/bookmark-button.tsx +39 -37
- package/src/favorites/favorite-button.analysis.md +17 -0
- package/src/favorites/favorite-button.tsx +30 -7
- 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/src/stores/favorites-store.ts +21 -21
|
@@ -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
|
+
|