QutEcoacoustics / workbench-client

workbench-client: a client side browser application for interacting with acoustic workbenches
Other
8 stars 1 forks source link

Implement Date/Time components #2117

Closed hudson-newey closed 6 months ago

hudson-newey commented 7 months ago

Implement Date/Time components

With the functionality of the date/time components now complete, we should implement them on the relevant pages to standardize formatting and localization.

This fixes a common and re-occuring point of user friction.

Changes

Bug fixes

Problems

None

Issues

Fixes: #345 Fixes: #346

Visual Changes

The "created by" and "updated by" shields widget (in the menu bar) now uses the two largest units (to keep consistent with the rest of the relative duration formats in the website)

image Old Format

image New Format


The audio recordings page now shows fractional seconds

image Old Format

image New Format


Harvest ETA component now uses the <baw-time-since> and <baw-duration> components

This means that I have had to re-order some words above the progress bar

image Old Format

image New Format

This also removes an additional RxJS observable (potentially improving performance)


The "My Sites" page now uses the two largest units in the "Last Modified" column

image Old Format

image New Format


Recent annotations and recent audio recordings now show the two largest units

image Old Format

image New Format


The audio recording details page has new changed date/time formats

image Old Format

image New Format (amended)


Unshown visual changes

Final Checklist

github-actions[bot] commented 7 months ago

Size Change: +360 B (0%)

Total Size: 3.01 MB

Filename Size Change
dist/workbench-client/browser/main-V4H2UQGM.js 0 B -1.07 MB (removed) πŸ†
dist/workbench-client/server/main.js 1.87 MB +256 B (0%)
dist/workbench-client/browser/main-STQ7JKIV.js 1.07 MB +1.07 MB (new file) πŸ†•
ℹ️ View Unchanged | Filename | Size | | :--- | :---: | | `dist/workbench-client/browser/assets/environment.json` | 555 B | | `dist/workbench-client/browser/index.html` | 4.71 kB | | `dist/workbench-client/browser/manifest.json` | 150 B | | `dist/workbench-client/browser/polyfills-C5CKP5CH.js` | 12.3 kB | | `dist/workbench-client/browser/styles-UNSEPFNK.css` | 39.4 kB | | `dist/workbench-client/server/776.js` | 4.2 kB |

compressed-size-action

github-actions[bot] commented 7 months ago

Unit Test Results

βŸβ€„βŸβ€„β€ˆβŸβ€„βŸβ€„6 filesβ€„β€ƒβŸβ€„βŸβ€„β€ˆβŸβ€„βŸβ€„6 suites   8m 1s :stopwatch: 23β€ˆ154 tests 22β€ˆ638 :heavy_check_mark: 516 :zzz: 0 :x: 23β€ˆ376 runs  22β€ˆ860 :heavy_check_mark: 516 :zzz: 0 :x:

Results for commit 71c1f516.

:recycle: This comment has been updated with latest results.

atruskie commented 7 months ago

image

For this case we can probably just add a (<baw-datetime-since ...></baw-datetime-since>) afterwards to achieve a similar effect to what was there.

hudson-newey commented 6 months ago

For this case we can probably just add a (<baw-datetime-since ...></baw-datetime-since>) afterwards to achieve a similar effect to what was there.

My hesitation about this format was that we would have two tooltips that shouw the exact same information (one for the baw-datetime and one for the baw-time-since).

However, by adding a hasTooltip input signal to the abstract-template.component, we are able to conditionally hide the baw-time-since tooltip (since it give the same information as the baw-datetime tooltip)

image

atruskie commented 6 months ago

For this case we can probably just add a (<baw-datetime-since ...></baw-datetime-since>) afterwards to achieve a similar effect to what was there.

My hesitation about this format was that we would have two tooltips that shouw the exact same information (one for the baw-datetime and one for the baw-time-since).

However, by adding a hasTooltip input signal to the abstract-template.component, we are able to conditionally hide the baw-time-since tooltip (since it give the same information as the baw-datetime tooltip)

image

I don't think we need to worry honestly. The tooltips add context to the text they wrap. They're not on by default.

If we really wanted to solve this we might add another datetime control or option to show date and time-since in one component. But as it stands we have exactly one example so that would be premature optimization - as would be adding an option to hide the tooltip