Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

Commit f3d40a7

Browse files
christoph2806Developer
andauthored
fix: resolve DataTable pagination dropdown sync and AppShell border styling issues (#63)
* fix: resolve DataTable pagination dropdown sync and AppShell border styling issues * fix: improve pagination dropdown sync with enhanced deduplication logic --------- Co-authored-by: Developer <developer@example.com>
1 parent a543430 commit f3d40a7

File tree

5 files changed

+44
-7
lines changed

5 files changed

+44
-7
lines changed

packages/ui-kit/src/components/data-display/DataTable/DataTable.tsx

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,19 +160,39 @@ export const DataTable = React.memo(
160160
// Smart pagination defaults based on data size
161161
const smartPaginationConfig = useMemo((): PaginationConfig | false => {
162162
if (pagination === false) return false;
163-
if (pagination) return pagination;
163+
if (pagination) {
164+
// Ensure pageSize is in pageSizeOptions to prevent dropdown sync issues
165+
const configPageSize = pagination.pageSize ?? pageSize;
166+
const defaultOptions = [10, 25, 50, 100];
167+
const options = pagination.pageSizeOptions ?? defaultOptions;
168+
169+
// Deduplicate and ensure pageSize is in options
170+
const uniqueOptions = [...new Set([...options, configPageSize])];
171+
const pageSizeOptions = uniqueOptions.sort((a, b) => a - b);
172+
173+
return {
174+
...pagination,
175+
pageSize: configPageSize,
176+
pageSizeOptions,
177+
};
178+
}
164179

165180
// Auto-detect pagination strategy
166181
if (data.length <= 15) {
167182
return false; // No pagination for small datasets
168183
}
169184

185+
// Ensure default pageSize is in options and deduplicate
186+
const defaultOptions = [10, 25, 50, 100];
187+
const uniqueOptions = [...new Set([...defaultOptions, pageSize])];
188+
const pageSizeOptions = uniqueOptions.sort((a, b) => a - b);
189+
170190
return {
171191
pageSize: pageSize,
172192
showSizeSelector: true,
173193
showPageInfo: true,
174194
showNavigation: true,
175-
pageSizeOptions: [10, 25, 50, 100],
195+
pageSizeOptions,
176196
enableFastNavigation: data.length > 100,
177197
enableJumpToPage: data.length > 200,
178198
};

packages/ui-kit/src/components/primitives/MarkdownEditor/MarkdownEditor.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ export function MarkdownEditor({
112112
<div className={baseClasses} data-testid={dataTestId}>
113113
{/* Toolbar */}
114114
<div className={toolbarClasses}>
115-
<span style={disabled ? { color: "#000000" } : undefined}>
115+
<span
116+
style={disabled ? { color: "hsl(var(--foreground))" } : undefined}
117+
>
116118
{isPreview ? "Preview" : "Edit"}
117119
</span>
118120
<button

packages/ui-kit/src/layout/AppShell/AppShell.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,10 @@ export const AppShell: React.FC<AppShellProps> = ({
123123

124124
{/* Footer */}
125125
{footer && (
126-
<div className="mt-auto p-4 bg-background border-t border-gray-200">
126+
<div
127+
className="mt-auto p-4 bg-background border-t border-border"
128+
style={{ borderColor: "hsl(var(--border))" }}
129+
>
127130
{footer}
128131
</div>
129132
)}

packages/ui-kit/src/layout/AppShell/AppShellTopBar.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ export const AppShellTopBar: React.FC<AppShellTopBarProps> = ({
320320
fixed && "sticky top-0 z-40",
321321
className,
322322
)}
323+
style={{ borderColor: "hsl(var(--border))" }}
323324
role="banner"
324325
aria-label="Top navigation bar"
325326
data-testid={dataTestId}

packages/ui-kit/src/layout/AppShell/ContentWrapper.tsx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,22 @@ export const ContentWrapper: React.FC<ContentWrapperProps> = ({
4848
<main className={cn("flex flex-col flex-1 overflow-auto", className)}>
4949
{/* Breadcrumbs section */}
5050
{breadcrumbs && breadcrumbs.length > 0 && (
51-
<div className={cn("py-2 px-4 border-b border-border", "bg-muted/40")}>
51+
<div
52+
className={cn("py-2 px-4 border-b bg-muted/40", "border-border")}
53+
style={{ borderColor: "hsl(var(--border))" }}
54+
>
5255
<AppShellBreadcrumbs items={breadcrumbs} />
5356
</div>
5457
)}
5558

5659
{/* Custom header if provided */}
5760
{header && (
58-
<div className="content-header border-b border-border">{header}</div>
61+
<div
62+
className="content-header border-b border-border"
63+
style={{ borderColor: "hsl(var(--border))" }}
64+
>
65+
{header}
66+
</div>
5967
)}
6068

6169
{/* Main content */}
@@ -70,7 +78,10 @@ export const ContentWrapper: React.FC<ContentWrapperProps> = ({
7078

7179
{/* Custom footer if provided */}
7280
{footer && (
73-
<div className="content-footer border-t border-border mt-auto">
81+
<div
82+
className="content-footer border-t border-border mt-auto"
83+
style={{ borderColor: "hsl(var(--border))" }}
84+
>
7485
{footer}
7586
</div>
7687
)}

0 commit comments

Comments
 (0)