Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions docs/identifier-ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,14 @@ The desktop table columns are:

- Name
- AID
- Current Key
- Type
- KIDX
- PIDX
- Actions

Mobile cards mirror the same core fields and rotate action.

The AID and current-key display contract:
The AID display contract:

- use `truncateMiddle(aid)` as first eight characters, `...`, last eight
characters for long values,
Expand All @@ -90,6 +89,10 @@ The AID and current-key display contract:
- stop click propagation so copying does not open details,
- use the shared `--app-mono-font` CSS variable.

Do not add Current Key back to the table unless the list API can supply it
without per-row `get(...)` hydration. Current key belongs in details so the
identifier list does not grow an N+1 request pattern.

The table rotate button:

- uses the rotate icon,
Expand Down
66 changes: 2 additions & 64 deletions src/features/identifiers/IdentifierTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ import RotateRightIcon from '@mui/icons-material/RotateRight';
import type { IdentifierSummary } from './identifierTypes';
import {
formatIdentifierMetadata,
identifierCurrentKey,
identifierUnavailableValue,
identifierIdentifierIndex,
identifierKeyIndex,
identifierType,
Expand All @@ -48,15 +46,13 @@ interface CopyableMonoValueProps {
label: string;
copied: boolean;
onCopy: (value: string) => void;
color?: string;
}

const CopyableMonoValue = ({
value,
label,
copied,
onCopy,
color = 'primary.main',
}: CopyableMonoValueProps) => (
<Tooltip title={copied ? `Copied ${value}` : value}>
<Box
Expand All @@ -71,7 +67,7 @@ const CopyableMonoValue = ({
m: 0,
border: 0,
bgcolor: 'transparent',
color: copied ? 'success.main' : color,
color: copied ? 'success.main' : 'primary.main',
cursor: 'copy',
fontSize: 'inherit',
lineHeight: 'inherit',
Expand All @@ -86,17 +82,6 @@ const CopyableMonoValue = ({
</Tooltip>
);

const MonospaceUnavailable = () => (
<Typography
component="span"
variant="body2"
color="text.disabled"
sx={monoSx}
>
{identifierUnavailableValue}
</Typography>
);

/**
* Pure identifier list table.
*
Expand Down Expand Up @@ -157,32 +142,6 @@ export const IdentifierTable = ({
onCopy={copyValue}
/>
</Box>
<Stack spacing={0.25}>
<Typography
variant="caption"
color="text.secondary"
>
Current Key
</Typography>
{identifierCurrentKey(identifier) === null ? (
<MonospaceUnavailable />
) : (
<CopyableMonoValue
value={
identifierCurrentKey(
identifier
) ?? ''
}
label="current key"
copied={
copiedValue ===
identifierCurrentKey(identifier)
}
onCopy={copyValue}
color="success.dark"
/>
)}
</Stack>
<Typography
variant="caption"
color="text.secondary"
Expand Down Expand Up @@ -233,12 +192,11 @@ export const IdentifierTable = ({
component={Paper}
sx={{ display: { xs: 'none', sm: 'block' } }}
>
<Table sx={{ minWidth: 980 }} aria-label="identifier table">
<Table sx={{ minWidth: 800 }} aria-label="identifier table">
<TableHead>
<TableRow>
<TableCell>Name</TableCell>
<TableCell>AID</TableCell>
<TableCell>Current Key</TableCell>
<TableCell>Type</TableCell>
<TableCell>KIDX</TableCell>
<TableCell>PIDX</TableCell>
Expand Down Expand Up @@ -270,26 +228,6 @@ export const IdentifierTable = ({
onCopy={copyValue}
/>
</TableCell>
<TableCell>
{identifierCurrentKey(identifier) === null ? (
<MonospaceUnavailable />
) : (
<CopyableMonoValue
value={
identifierCurrentKey(
identifier
) ?? ''
}
label="current key"
copied={
copiedValue ===
identifierCurrentKey(identifier)
}
onCopy={copyValue}
color="success.dark"
/>
)}
</TableCell>
<TableCell>
{identifierType(identifier)}
</TableCell>
Expand Down
2 changes: 1 addition & 1 deletion tests/browser-smoke.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ try {
timeout: 10000,
});
const identifierTableText = await textContent(page, '[data-testid="identifier-table"]');
for (const expectedHeader of ['AID', 'Current Key', 'KIDX', 'PIDX', 'Actions']) {
for (const expectedHeader of ['AID', 'KIDX', 'PIDX', 'Actions']) {
if (!identifierTableText.includes(expectedHeader)) {
throw new Error(`Identifier table is missing ${expectedHeader} header`);
}
Expand Down
Loading