feat(managers): actions-first discovery table, tabs in the back chain, pager scrolls to top

UAT round 4:
- Discovery table: move Actions to the first column, mirroring the Subscriptions
  table (where it sits right after Prio) so both tabs' actions line up.
- The manager's tabs now ride in history.state (`_chTab`), the same way the channel
  page (`_chan`) and the live search (`_yt`) already do — so Back steps back through
  the tabs you visited before it leaves the module. Arriving from elsewhere stamps
  the entry setPage pushed (one navigation never costs two Back presses).
- Turning a page now scrolls the list back to its top (both the tables and the card
  grid, since they share Pager) — landing mid-list in an unseen page is disorienting.
This commit is contained in:
2026-07-20 00:14:23 +02:00
parent dff4152522
commit a50608d026
3 changed files with 70 additions and 29 deletions
+28 -26
View File
@@ -97,6 +97,34 @@ export default function ChannelDiscovery({
);
const columns: Column<DiscoveredChannel>[] = [
// Actions first, mirroring the Subscriptions table (where it sits right after Prio) so the two
// tabs' action clusters line up in the same place.
{
key: "actions",
header: t("channels.cols.actions"),
align: "left",
nowrap: true,
width: "120px",
cardLabel: false,
render: (c) => (
<Tooltip
hint={
canWrite
? t("channels.discovery.subscribeHint")
: t("channels.discovery.needWriteHint")
}
>
<button
onClick={() => onSubscribe(c)}
disabled={!canWrite || subscribe.isPending}
className="glass-card glass-hover inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs disabled:opacity-50 transition"
>
<UserPlus className="w-3.5 h-3.5" />
{t("channels.discovery.subscribe")}
</button>
</Tooltip>
),
},
{
key: "channel",
header: t("channels.cols.channel"),
@@ -156,32 +184,6 @@ export default function ChannelDiscovery({
</Tooltip>
),
},
{
key: "actions",
header: t("channels.cols.actions"),
align: "right",
nowrap: true,
width: "120px",
cardLabel: false,
render: (c) => (
<Tooltip
hint={
canWrite
? t("channels.discovery.subscribeHint")
: t("channels.discovery.needWriteHint")
}
>
<button
onClick={() => onSubscribe(c)}
disabled={!canWrite || subscribe.isPending}
className="glass-card glass-hover inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs disabled:opacity-50 transition"
>
<UserPlus className="w-3.5 h-3.5" />
{t("channels.discovery.subscribe")}
</button>
</Tooltip>
),
},
];
// Card layout paginates like the table (slice the sorted rows; the Pager reports changes).