From 318e9cf13a1c7b65a726f31752ccb7501f4b9baa Mon Sep 17 00:00:00 2001
From: Dendi Suhubdy <4477337+dendisuhubdy@users.noreply.github.com>
Date: Tue, 27 Oct 2026 12:57:25 +0800
Subject: [PATCH] home: the latest blocks and transactions cards are the same
size
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Side by side, each half of the page is ~530 px, and both tables scrolled sideways: blocks
lost View and Age off the right edge, and the transactions card opened scrolled past its hashes.
The action cell wrapped too ("validator / 10 RAND" on two lines), so the transactions card
was half again as tall as the blocks card.
On the home page the two tables now show the columns that fit (View, Fee and Height stay on
/blocks and /transactions), shorter hashes (`compact`: 6…4, proposers and action keys 4…4),
3-unit cell padding and one 52 px row height, and each card stretches to the grid row.
Measured at 1280, 1440 and 1920 px wide: both cards 532 × 559, every row 52 px, no
horizontal overflow. The action cell no longer wraps anywhere (DataTable cells are nowrap).
Co-Authored-By: Claude Opus 5.5
---
frontend/src/app/[lang]/page.tsx | 20 +++++++---
frontend/src/components/Tables.tsx | 60 +++++++++++++++++++++++-------
2 files changed, 61 insertions(+), 19 deletions(-)
diff --git a/frontend/src/app/[lang]/page.tsx b/frontend/src/app/[lang]/page.tsx
index deb6ab0..a68c76c 100644
--- a/frontend/src/app/[lang]/page.tsx
+++ b/frontend/src/app/[lang]/page.tsx
@@ -365,9 +365,11 @@ export default function DashboardPage() {
)}
- {/* Latest blocks + transactions */}
+ {/* Latest blocks + transactions: side by side they show one-line rows and the columns that
+ fit half the page (View, Fee and Height are on /blocks and /transactions), so the two
+ cards line up row for row (one row height) and end at the same height. */}
-
diff --git a/frontend/src/components/Tables.tsx b/frontend/src/components/Tables.tsx
index 3782836..440abbc 100644
--- a/frontend/src/components/Tables.tsx
+++ b/frontend/src/components/Tables.tsx
@@ -13,7 +13,12 @@ import type { BlockSummary, TokenInfo, TransactionSummary } from '@/types';
type TFn = ReturnType['t'];
-export function blockColumns(t: TFn, fmt: Fmt): Column[] {
+/** Hash lengths: `compact` is for a table sharing the row with another (the home page). */
+const HASH = { start: 8, end: 6 };
+const HASH_COMPACT = { start: 6, end: 4 };
+
+export function blockColumns(t: TFn, fmt: Fmt, compact = false): Column[] {
+ const h = compact ? HASH_COMPACT : HASH;
return [
{
key: 'height',
@@ -27,13 +32,18 @@ export function blockColumns(t: TFn, fmt: Fmt): Column[] {
{
key: 'hash',
header: t('components.tables.blocks.hash'),
- render: (block) => ,
+ render: (block) => ,
},
{
key: 'proposer',
header: t('components.tables.blocks.proposer'),
render: (block) => (
-
+
),
},
{
@@ -62,14 +72,27 @@ interface BlocksTableProps {
blocks: BlockSummary[];
isLoading?: boolean;
emptyMessage?: string;
+ /** Drop columns that are redundant in the surrounding context. */
+ hideColumns?: string[];
+ /** Shorter hashes, for a table that shares the row with another. */
+ compact?: boolean;
+ className?: string;
}
-export function BlocksTable({ blocks, isLoading, emptyMessage }: BlocksTableProps) {
+export function BlocksTable({
+ blocks,
+ isLoading,
+ emptyMessage,
+ hideColumns = [],
+ compact = false,
+ className,
+}: BlocksTableProps) {
const { t } = useT();
const fmt = useFmt();
return (
!hideColumns.includes(column.key))}
+ className={className}
data={blocks}
keyExtractor={(block) => block.hash}
isLoading={isLoading}
@@ -88,11 +111,12 @@ export function BlocksTable({ blocks, isLoading, emptyMessage }: BlocksTableProp
* nothing, by design — its asset is private, and `tokens` (the cached registry) resolves an RPL
* amount's index to its symbol ("12.50 zUSD") rather than a bare unit count.
*/
-function actionCell(tx: TransactionSummary, t: TFn, fmt: Fmt, tokens?: TokenInfo[]) {
+function actionCell(tx: TransactionSummary, t: TFn, fmt: Fmt, tokens?: TokenInfo[], compact = false) {
const parts: React.ReactNode[] = [];
+ const n = compact ? 4 : 6;
if (tx.program) {
parts.push(
-
+
);
}
if (tx.validator) {
@@ -101,8 +125,8 @@ function actionCell(tx: TransactionSummary, t: TFn, fmt: Fmt, tokens?: TokenInfo
key="validator"
value={tx.validator}
href={`/validators/${tx.validator}`}
- start={6}
- end={6}
+ start={n}
+ end={n}
/>
);
}
@@ -120,19 +144,21 @@ function actionCell(tx: TransactionSummary, t: TFn, fmt: Fmt, tokens?: TokenInfo
);
}
- return {parts};
+ return {parts};
}
export function transactionColumns(
t: TFn,
fmt: Fmt,
- tokens?: TokenInfo[]
+ tokens?: TokenInfo[],
+ compact = false
): Column[] {
+ const h = compact ? HASH_COMPACT : HASH;
return [
{
key: 'hash',
header: t('components.tables.txs.hash'),
- render: (tx) => ,
+ render: (tx) => ,
},
{
key: 'kind',
@@ -151,7 +177,7 @@ export function transactionColumns(
{
key: 'action',
header: t('components.tables.txs.action'),
- render: (tx) => actionCell(tx, t, fmt, tokens),
+ render: (tx) => actionCell(tx, t, fmt, tokens, compact),
},
{
key: 'fee',
@@ -183,6 +209,9 @@ interface TransactionsTableProps {
emptyMessage?: string;
/** Drop columns that are redundant in the surrounding context. */
hideColumns?: string[];
+ /** Shorter hashes, for a table that shares the row with another. */
+ compact?: boolean;
+ className?: string;
}
export function TransactionsTable({
@@ -190,17 +219,20 @@ export function TransactionsTable({
isLoading,
emptyMessage,
hideColumns = [],
+ compact = false,
+ className,
}: TransactionsTableProps) {
const { data: tokenList } = useTokens();
const { t } = useT();
const fmt = useFmt();
- const columns = transactionColumns(t, fmt, tokenList?.tokens).filter((column) => !hideColumns.includes(column.key));
+ const columns = transactionColumns(t, fmt, tokenList?.tokens, compact).filter((column) => !hideColumns.includes(column.key));
return (
tx.hash}
+ className={className}
isLoading={isLoading}
emptyMessage={emptyMessage ?? t('components.tables.txs.empty')}
/>