Skip to content

Commit 3022812

Browse files
authored
Merge pull request #24 from kentbull/fix-identifier-screen
fix identifier screen
2 parents ffb34ef + 87ea4fd commit 3022812

3 files changed

Lines changed: 8 additions & 67 deletions

File tree

‎docs/identifier-ui.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,14 @@ The desktop table columns are:
7373

7474
- Name
7575
- AID
76-
- Current Key
7776
- Type
7877
- KIDX
7978
- PIDX
8079
- Actions
8180

8281
Mobile cards mirror the same core fields and rotate action.
8382

84-
The AID and current-key display contract:
83+
The AID display contract:
8584

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

92+
Do not add Current Key back to the table unless the list API can supply it
93+
without per-row `get(...)` hydration. Current key belongs in details so the
94+
identifier list does not grow an N+1 request pattern.
95+
9396
The table rotate button:
9497

9598
- uses the rotate icon,

‎src/features/identifiers/IdentifierTable.tsx‎

Lines changed: 2 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ import RotateRightIcon from '@mui/icons-material/RotateRight';
2020
import type { IdentifierSummary } from './identifierTypes';
2121
import {
2222
formatIdentifierMetadata,
23-
identifierCurrentKey,
24-
identifierUnavailableValue,
2523
identifierIdentifierIndex,
2624
identifierKeyIndex,
2725
identifierType,
@@ -48,15 +46,13 @@ interface CopyableMonoValueProps {
4846
label: string;
4947
copied: boolean;
5048
onCopy: (value: string) => void;
51-
color?: string;
5249
}
5350

5451
const CopyableMonoValue = ({
5552
value,
5653
label,
5754
copied,
5855
onCopy,
59-
color = 'primary.main',
6056
}: CopyableMonoValueProps) => (
6157
<Tooltip title={copied ? `Copied ${value}` : value}>
6258
<Box
@@ -71,7 +67,7 @@ const CopyableMonoValue = ({
7167
m: 0,
7268
border: 0,
7369
bgcolor: 'transparent',
74-
color: copied ? 'success.main' : color,
70+
color: copied ? 'success.main' : 'primary.main',
7571
cursor: 'copy',
7672
fontSize: 'inherit',
7773
lineHeight: 'inherit',
@@ -86,17 +82,6 @@ const CopyableMonoValue = ({
8682
</Tooltip>
8783
);
8884

89-
const MonospaceUnavailable = () => (
90-
<Typography
91-
component="span"
92-
variant="body2"
93-
color="text.disabled"
94-
sx={monoSx}
95-
>
96-
{identifierUnavailableValue}
97-
</Typography>
98-
);
99-
10085
/**
10186
* Pure identifier list table.
10287
*
@@ -157,32 +142,6 @@ export const IdentifierTable = ({
157142
onCopy={copyValue}
158143
/>
159144
</Box>
160-
<Stack spacing={0.25}>
161-
<Typography
162-
variant="caption"
163-
color="text.secondary"
164-
>
165-
Current Key
166-
</Typography>
167-
{identifierCurrentKey(identifier) === null ? (
168-
<MonospaceUnavailable />
169-
) : (
170-
<CopyableMonoValue
171-
value={
172-
identifierCurrentKey(
173-
identifier
174-
) ?? ''
175-
}
176-
label="current key"
177-
copied={
178-
copiedValue ===
179-
identifierCurrentKey(identifier)
180-
}
181-
onCopy={copyValue}
182-
color="success.dark"
183-
/>
184-
)}
185-
</Stack>
186145
<Typography
187146
variant="caption"
188147
color="text.secondary"
@@ -233,12 +192,11 @@ export const IdentifierTable = ({
233192
component={Paper}
234193
sx={{ display: { xs: 'none', sm: 'block' } }}
235194
>
236-
<Table sx={{ minWidth: 980 }} aria-label="identifier table">
195+
<Table sx={{ minWidth: 800 }} aria-label="identifier table">
237196
<TableHead>
238197
<TableRow>
239198
<TableCell>Name</TableCell>
240199
<TableCell>AID</TableCell>
241-
<TableCell>Current Key</TableCell>
242200
<TableCell>Type</TableCell>
243201
<TableCell>KIDX</TableCell>
244202
<TableCell>PIDX</TableCell>
@@ -270,26 +228,6 @@ export const IdentifierTable = ({
270228
onCopy={copyValue}
271229
/>
272230
</TableCell>
273-
<TableCell>
274-
{identifierCurrentKey(identifier) === null ? (
275-
<MonospaceUnavailable />
276-
) : (
277-
<CopyableMonoValue
278-
value={
279-
identifierCurrentKey(
280-
identifier
281-
) ?? ''
282-
}
283-
label="current key"
284-
copied={
285-
copiedValue ===
286-
identifierCurrentKey(identifier)
287-
}
288-
onCopy={copyValue}
289-
color="success.dark"
290-
/>
291-
)}
292-
</TableCell>
293231
<TableCell>
294232
{identifierType(identifier)}
295233
</TableCell>

‎tests/browser-smoke.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ try {
116116
timeout: 10000,
117117
});
118118
const identifierTableText = await textContent(page, '[data-testid="identifier-table"]');
119-
for (const expectedHeader of ['AID', 'Current Key', 'KIDX', 'PIDX', 'Actions']) {
119+
for (const expectedHeader of ['AID', 'KIDX', 'PIDX', 'Actions']) {
120120
if (!identifierTableText.includes(expectedHeader)) {
121121
throw new Error(`Identifier table is missing ${expectedHeader} header`);
122122
}

0 commit comments

Comments
 (0)