Skip to content

a0b32b4e - Date the Safe activity rows and drop the bracketed order labels - #1207

Merged
TaprootFreak merged 4 commits into
developfrom
fix/safe-activity-date-and-labels
Jul 29, 2026
Merged

a0b32b4e - Date the Safe activity rows and drop the bracketed order labels#1207
TaprootFreak merged 4 commits into
developfrom
fix/safe-activity-date-and-labels

Conversation

@TaprootFreak

@TaprootFreak TaprootFreak commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

What

Three things the Safe screen got wrong for anyone reading the activity list.

No entry carried a date. Nothing in Recent Activity could be placed in time. The rows now show the order's valuta timestamp next to its status, falling back to the creation date for orders that never completed — the two are distinct fields, and for an order stuck in an early state the creation date is the only timestamp it has. When neither is present (an API predating DFXswiss/api#4448) the row shows no date at all rather than Invalid Date; the fields are typed optional to match that.

sZCHF had no logo. AssetIconVariant has no sZCHF member, so DfxAssetIcon fell through to its grey placeholder. Saving positions mirror an underlying asset, so they now borrow its icon — sZCHF renders as ZCHF. The alias table is explicit rather than a rule over the s prefix, because the prefix is not a reliable marker. Applies to the asset list and the activity rows alike.

The labels named the form of the deposit. Deposit (Fiat), Deposit (Crypto), Deposit (Saving) all collapse to Deposit, and the three withdrawal variants to Withdrawal. Which rail an order took is not something the label needs to carry. Translations in de/fr/it follow; Deposit already existed as a key in all three, Withdrawal was added.

Baselines

Both Safe specs are regenerated — the committed images showed the bracketed labels and no dates, i.e. exactly the state this branch changes. Generated on macOS against a local API, and both specs verified to reproduce without --update-snapshots.

Two things worth knowing when reading the image diff:

  • The figures shift slightly. The data set the original baselines were taken on was never recorded anywhere, so it had to be rebuilt from what the images showed. Holdings and orders are close but not identical, and the totals move with current prices.
  • There is a new sZCHF position. Deliberate: without a saving position in the portfolio, the icon alias has nothing to show, and the change would go undocumented.

The two specs need different data states — the account switcher only renders once several accounts are reachable, which is why safe.spec.ts shows none. Both were regenerated against the state their own spec describes.

Depends on

DFXswiss/api#4448 (merged) supplies created and completedAt. It needs to be deployed before this; without it the rows degrade to the previous, date-less rendering rather than breaking.

Three things the Safe screen got wrong for a reader of the activity list:

- No entry carried a timestamp, so nothing could be placed in time. The
  rows now show the valuta timestamp, falling back to the creation date
  for orders that never completed, and no date at all when the API
  predates the fields.
- sZCHF fell through to the grey placeholder because AssetIconVariant has
  no such member. Saving positions mirror an underlying asset, so they now
  borrow its icon - both in the asset list and in the activity rows.
- The order labels named the form of the deposit (Fiat, Crypto, Saving).
  That distinction means nothing to the reader and is now gone from the
  labels and from the translations.
The rendering path already handles their absence - an API predating the
fields serves neither, and the row then shows no date. Typing created as
required contradicted the code that guards against it.
The committed baselines still showed the bracketed labels and no dates,
i.e. exactly the state this branch changes. Regenerated on macOS against
a local API, both specs verified to reproduce without --update-snapshots.

The local data set had to be rebuilt: the original one was never recorded
anywhere, so the figures differ slightly. It carries an sZCHF position on
purpose - without a saving position the icon alias has nothing to show.
completedAt is written once and never cleared, so reading it regardless of
status would keep showing a valuta for an order that has since moved back
out of Completed. Read it only while the order says it is completed.
@TaprootFreak
TaprootFreak marked this pull request as ready for review July 29, 2026 15:00
@TaprootFreak
TaprootFreak merged commit c84dd69 into develop Jul 29, 2026
6 checks passed
@TaprootFreak
TaprootFreak deleted the fix/safe-activity-date-and-labels branch July 29, 2026 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant