Merge branch 'fix/table-thead-and-horizontal-overflow' into 'main'

fix(table+layout): TableHead = THEAD wrapper + kill horizontal scroll

See merge request 2-6/2-6-4/terravault/ordinis!58
This commit is contained in:
Александр Зимин
2026-05-11 12:49:35 +00:00
3 changed files with 8 additions and 5 deletions
+2 -2
View File
@@ -36,8 +36,8 @@ function RootLayout() {
<MobileSidebar open={mobileNavOpen} onClose={() => setMobileNavOpen(false)} /> <MobileSidebar open={mobileNavOpen} onClose={() => setMobileNavOpen(false)} />
<div className="flex-1 flex flex-col min-w-0"> <div className="flex-1 flex flex-col min-w-0">
<TopBar onMenuClick={() => setMobileNavOpen(true)} /> <TopBar onMenuClick={() => setMobileNavOpen(true)} />
<main className="flex-1 overflow-y-auto px-4 sm:px-6 py-4 sm:py-6"> <main className="flex-1 overflow-y-auto overflow-x-clip px-4 sm:px-6 py-4 sm:py-6">
<div className="max-w-7xl mx-auto w-full"> <div className="max-w-7xl mx-auto w-full min-w-0">
<Outlet /> <Outlet />
</div> </div>
</main> </main>
@@ -498,7 +498,7 @@ function DictionaryDetail() {
<div className="space-y-6"> <div className="space-y-6">
{scope && ( {scope && (
<div <div
className={`-mt-6 -mx-4 sm:-mx-6 lg:-mx-8 mb-2 h-1 border-t-4 ${SCOPE_BORDER_TOP[scope]}`} className={`-mt-4 sm:-mt-6 -mx-4 sm:-mx-6 mb-2 h-1 border-t-4 ${SCOPE_BORDER_TOP[scope]}`}
aria-hidden="true" aria-hidden="true"
/> />
)} )}
+5 -2
View File
@@ -37,6 +37,11 @@ export const TableHeader = React.forwardRef<
/> />
) )
}) })
// nstart-compat alias: nstart использовал <TableHead> как THEAD wrapper.
// shadcn по convention использует TableHead как TH cell — это конфликтовало
// (callsites писали `<TableHead><TableRow>...` ожидая THEAD-семантику).
// Резолвим в пользу nstart-compat (callsites больше). Для TH cell — TableHeaderCell.
export const TableHead = TableHeader
export const TableBody = React.forwardRef< export const TableBody = React.forwardRef<
HTMLTableSectionElement, HTMLTableSectionElement,
@@ -104,8 +109,6 @@ export const TableHeaderCell = React.forwardRef<HTMLTableCellElement, TableHeade
) )
}, },
) )
// Alias for shadcn convention.
export const TableHead = TableHeaderCell
export const TableCell = React.forwardRef< export const TableCell = React.forwardRef<
HTMLTableCellElement, HTMLTableCellElement,