feat(channels): R14 zoom-fit table — fluid columns + column fogyókúra
- DataTable: opt-in `fixedLayout` (colgroup + table-layout:fixed) so the table fits its container at any zoom/text-size; only the channel manager opts in — playlists/discovery/Plex keep auto-sizing. - Remove the N/S/L and Sync columns from the manager table. Fully-synced status becomes a ✓ charm on the Stored count; the sync filter moves to an `applySyncFilter` pre-filter still driven by the top chips. - Channel column is now fluid: ChannelLink truncates with the full name on hover (title). Data columns get fixed widths so only Channel/About flex. - N/S/L (normal/short/live) breakdown moves to the channel page: add the three counts to the channelDetail endpoint (one grouped query, same filters as the list) + the ChannelDetail type + a meta-line entry. - Drop the now-dead sync/types i18n keys (en+hu).
This commit is contained in:
@@ -60,6 +60,7 @@ export default function DataTable<T>({
|
||||
onSortChange,
|
||||
filters: filtersProp,
|
||||
onFiltersChange,
|
||||
fixedLayout = false,
|
||||
}: {
|
||||
rows: T[];
|
||||
columns: Column<T>[];
|
||||
@@ -96,6 +97,12 @@ export default function DataTable<T>({
|
||||
// default internal, persistKey-backed filters.
|
||||
filters?: FilterMap;
|
||||
onFiltersChange?: (next: FilterMap) => void;
|
||||
// Opt into `table-layout: fixed` (default is `auto`). In fixed mode the table width == its
|
||||
// container at every zoom/text-size — the columns with an explicit `width` keep it, and the rest
|
||||
// (the fluid text columns) split what remains and TRUNCATE instead of pushing the table wider than
|
||||
// the viewport. Off by default so existing content-sized tables (playlists, discovery, Plex) are
|
||||
// untouched; the channel manager turns it on so its row never scrolls horizontally out of view.
|
||||
fixedLayout?: boolean;
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const initial = loadPersist(persistKey);
|
||||
@@ -224,7 +231,17 @@ export default function DataTable<T>({
|
||||
{(controlsPosition === "top" || controlsPosition === "both") && topControls}
|
||||
{/* Wide screens: table. The wrapper isn't clipped so header filter popovers can overflow. */}
|
||||
<div className="hidden md:block">
|
||||
<table className="w-full border-collapse text-sm">
|
||||
<table className={`w-full border-collapse text-sm ${fixedLayout ? "table-fixed" : ""}`}>
|
||||
{/* In fixed-layout mode a colgroup drives the column widths: those with an explicit
|
||||
`width` keep it, and the unspecified (fluid) columns split the remainder — so the
|
||||
table never exceeds its container and the fluid cells truncate instead. */}
|
||||
{fixedLayout && (
|
||||
<colgroup>
|
||||
{columns.map((col) => (
|
||||
<col key={col.key} style={col.width ? { width: col.width } : undefined} />
|
||||
))}
|
||||
</colgroup>
|
||||
)}
|
||||
<ColumnHead
|
||||
columns={columns}
|
||||
sort={sort}
|
||||
|
||||
Reference in New Issue
Block a user