feat(managers): richer channel cards + drop the rows layout, cap the channel column
UAT round 1 feedback: - Retire the `rows` layout — it barely differed from the table; keep Table + Cards. - The card now shows the About cell (+ its hover overlay) and the priority stepper in every layout, not just the table: ChannelLayoutGrid gains named slots (lead / about / actions) and stops hiding the `hideInCard` columns, since the roomy desktop card has space the cramped mobile fallback did not. - Fix the table losing its centering with "Rows per page: All": a long-titled channel stretched the uncapped Channel column (~289→429px) and overflowed the centered table. Cap it with a max-w element inside the cell (table-layout:auto ignores a cell max-width), the same trick AboutCell already uses. Gaps now 163/162.
This commit is contained in:
@@ -13,7 +13,6 @@ import {
|
||||
Pencil,
|
||||
Plus,
|
||||
RefreshCw,
|
||||
Rows3,
|
||||
Table,
|
||||
UserMinus,
|
||||
X,
|
||||
@@ -57,7 +56,6 @@ const STATUS_FILTERS: { id: ChannelStatusFilter; labelKey: string }[] = [
|
||||
const LAYOUT_ICON: Record<ChannelLayout, typeof Table> = {
|
||||
table: Table,
|
||||
cards: LayoutGrid,
|
||||
rows: Rows3,
|
||||
};
|
||||
|
||||
export default function Channels() {
|
||||
@@ -306,14 +304,19 @@ export default function Channels() {
|
||||
sortValue: (c) => (c.title ?? c.id).toLowerCase(),
|
||||
filter: { kind: "text", get: (c) => `${c.title ?? ""} ${c.handle ?? ""}` },
|
||||
cardPrimary: true,
|
||||
// Cap the width so a long-titled channel can't stretch the column (table-layout:auto ignores a
|
||||
// cell max-width, but a max-w element INSIDE the cell bounds it — same trick AboutCell uses).
|
||||
// Without this a single long name blows the column ~289→429px and overflows the centered table.
|
||||
render: (c) => (
|
||||
<ChannelLink
|
||||
id={c.id}
|
||||
title={c.title}
|
||||
handle={c.handle}
|
||||
thumbnailUrl={c.thumbnail_url}
|
||||
onView={() => onView(c)}
|
||||
/>
|
||||
<div className="max-w-[18rem]">
|
||||
<ChannelLink
|
||||
id={c.id}
|
||||
title={c.title}
|
||||
handle={c.handle}
|
||||
thumbnailUrl={c.thumbnail_url}
|
||||
onView={() => onView(c)}
|
||||
/>
|
||||
</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
@@ -656,7 +659,8 @@ export default function Channels() {
|
||||
rows={visibleChannels}
|
||||
columns={columns}
|
||||
rowKey={(c) => c.id}
|
||||
layout={layout}
|
||||
leadKey="priority"
|
||||
aboutKey="about"
|
||||
actionsKey="actions"
|
||||
rowClassName={(c) => (c.hidden ? "opacity-60" : "")}
|
||||
emptyText={t("channels.empty")}
|
||||
|
||||
Reference in New Issue
Block a user