Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add toggle switch between time ago and utc time #366

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tx-nikola
Copy link
Contributor

@tx-nikola tx-nikola commented Dec 23, 2024

What ❔

This PR adds the functionality to toggle between "Ago" and "UTC Date" for tx timestamps in the transactions table.

Screen.Recording.2024-12-23.at.14.28.25.mov

Why ❔

For better user experience - previously users could only see for example "4 weeks ago" timestamp for multiple transactions - this enables easier navigation trough the transactions list.

Checklist

  • PR title corresponds to the body of PR (we generate changelog entries from PRs).
  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.

This PR fixes #341

@tx-nikola tx-nikola added the frontend Task requires changes to the frontend implementation label Dec 23, 2024
@tx-nikola tx-nikola requested a review from popzxc December 23, 2024 13:28
@tx-nikola tx-nikola self-assigned this Dec 23, 2024
Copy link

github-actions bot commented Dec 23, 2024

API E2E Test Results

207 tests   207 ✅  19s ⏱️
 14 suites    0 💤
  1 files      0 ❌

Results for commit 30fb600.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Dec 23, 2024

Unit Test Results

    4 files    263 suites   11m 51s ⏱️
2 136 tests 2 135 ✅ 1 💤 0 ❌
2 348 runs  2 347 ✅ 1 💤 0 ❌

Results for commit 30fb600.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Dec 23, 2024

Visit the preview URL for this PR:
https://staging-scan-v2--pr-366-15i93nih.web.app

@@ -1,7 +1,7 @@
<template>
<div class="info-field-time" :title="utcStringFromISOString(isoString)">
<span class="time-ago">
{{ timeAgo }}
{{ isUtcDate ? localDateFromISOString(isoString) : timeAgo }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need it and not simply use showExactDate flag?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

showExactDate is used for showing the full date next to the "time ago", and it's set as false in all component except the transaction view, one example here: https://sepolia.explorer.zksync.io/tx/0x578366ab5db0538dcab887a1bdd6aeb82dc45e822acf280230d3c5e6dd64023f
Screenshot 2025-01-16 at 14 11 52

I could refactor it, or rename the variables to make it more clear? To rename it to something like "showBothDates" instead of just "showExactDate", and use that name instead of isUtcDate check?

:value="item.receivedAt"
:show-exact-date="false"
:data-testid="$testId.timestamp"
:is-utc-date="!isTimeAgeView"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need it and not simply use showExactDate flag?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explained in the comment above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend Task requires changes to the frontend implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Switch between Age and Timestamp view for transactions list
2 participants