mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-08 11:18:17 +00:00
fix(customers): drop fake before-state in history diff rows
DiffRow rendered onboarding's initial field values as '— → value', implying a prior state that never existed. Show the value alone when there is no real before. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -174,6 +174,10 @@ export function DiffRow({
|
|||||||
from: string;
|
from: string;
|
||||||
to: string;
|
to: string;
|
||||||
}) {
|
}) {
|
||||||
|
// No real "before" (field went from unset straight to a value, e.g. the
|
||||||
|
// onboarding wizard's first save) — show the value alone rather than a
|
||||||
|
// fake "— → value" that implies a prior state that never existed.
|
||||||
|
const hadBefore = from !== "—";
|
||||||
const changed = from !== to;
|
const changed = from !== to;
|
||||||
return (
|
return (
|
||||||
<Stack gap={2}>
|
<Stack gap={2}>
|
||||||
@@ -181,24 +185,24 @@ export function DiffRow({
|
|||||||
{label}
|
{label}
|
||||||
</Text>
|
</Text>
|
||||||
<Group gap={8} wrap="nowrap" align="center">
|
<Group gap={8} wrap="nowrap" align="center">
|
||||||
<Text
|
{hadBefore && (
|
||||||
size="sm"
|
<Text
|
||||||
c="dimmed"
|
size="sm"
|
||||||
td={changed ? "line-through" : undefined}
|
c="dimmed"
|
||||||
style={{ wordBreak: "break-word" }}
|
td={changed ? "line-through" : undefined}
|
||||||
>
|
style={{ wordBreak: "break-word" }}
|
||||||
{from}
|
>
|
||||||
</Text>
|
{from}
|
||||||
{changed && (
|
</Text>
|
||||||
<>
|
|
||||||
<Text size="sm" c="edr-muted">
|
|
||||||
→
|
|
||||||
</Text>
|
|
||||||
<Text size="sm" fw={600} c="edr-text">
|
|
||||||
{to}
|
|
||||||
</Text>
|
|
||||||
</>
|
|
||||||
)}
|
)}
|
||||||
|
{hadBefore && changed && (
|
||||||
|
<Text size="sm" c="edr-muted">
|
||||||
|
→
|
||||||
|
</Text>
|
||||||
|
)}
|
||||||
|
<Text size="sm" fw={changed ? 600 : undefined} c={changed ? "edr-text" : "dimmed"}>
|
||||||
|
{to}
|
||||||
|
</Text>
|
||||||
</Group>
|
</Group>
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user