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

Sep 2024 Fixes #1181

Merged
merged 6 commits into from
Sep 27, 2024
Merged

Sep 2024 Fixes #1181

merged 6 commits into from
Sep 27, 2024

Conversation

JGreenlee
Copy link
Collaborator

@JGreenlee JGreenlee commented Sep 25, 2024

remove StatusBar plugin

I attempted to unify the appearance of the statusbar between platforms by adding the StatusBar plugin (which had already been referenced in the code).
However, this caused major issues on some Android devices with the entire appbar no longer being visible.
This was not a high priority; rather than spend a lot of time trying to get the right appearance, I am just going to revert it for now

Don't override fraction digits on SummaryCard

This allows formatForDisplay to determine digits appropriately (e.g. instead of 300.1, just shows 300)

fix redundant dates showing on Label tab

using isoDatesDifference here (which wraps Luxon's diff) yields decimal values when a full datetime string is provided. If on the same day we are expecting the diff to be 0 (falsy) but get 0.2 or similar (truthy)
All we actually need here is to know if the start and end fall on different dates, so we can simply take the YYYY-MM-DD part of the strings and test for string equality
KISS

charting: use emcommon color fns; remove unused fns

uses e-mission-common's scale_lightness and dedupe_colors, so no longer need darkenOrLighten and dedupColors
Also remove getMeteredBackgroundColor and createDiagonalPattern which were both unused

Fix typo "SumaryCard"

rename util -> datetimeUtil

I attempted to unify the appearance of the statusbar between platforms by adding the StatusBar plugin (which had already been referenced in the code).
However, this caused major issues on some Android devices with the entire appbar no longer being visible.
This was not a high priority; rather than spend a lot of time trying to get the right appearance, I am just going to revert it for now
This allows formatForDisplay to determine digits appropriately (e.g. instead of 300.1, just shows 300)
using isoDatesDifference here (which wraps Luxon's diff) yields decimal values when a full datetime string is provided. If on the same day we are expecting the diff to be 0 (falsy) but get 0.2 or similar (truthy)
All we actually need here is to know if the start and end fall on different dates, so we can simply take the YYYY-MM-DD part of the strings and test for string equality
KISS
uses e-mission-common's scale_lightness and dedupe_colors, so no longer need darkenOrLighten and dedupColors
Also remove getMeteredBackgroundColor and createDiagonalPattern which were both unused
@JGreenlee JGreenlee marked this pull request as ready for review September 25, 2024 14:04
Copy link

codecov bot commented Sep 25, 2024

Codecov Report

Attention: Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.

Project coverage is 29.12%. Comparing base (9c2186b) to head (85b7b83).
Report is 9 commits behind head on master.

Files with missing lines Patch % Lines
www/js/components/Chart.tsx 0.00% 2 Missing ⚠️
www/js/metrics/SummaryCard.tsx 0.00% 2 Missing ⚠️
www/js/diary/useDerivedProperties.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1181      +/-   ##
==========================================
+ Coverage   28.83%   29.12%   +0.29%     
==========================================
  Files         122      122              
  Lines        5012     4961      -51     
  Branches     1145     1129      -16     
==========================================
  Hits         1445     1445              
+ Misses       3565     3514      -51     
  Partials        2        2              
Flag Coverage Δ
unit 29.12% <0.00%> (+0.29%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
www/js/TimelineContext.ts 51.53% <ø> (ø)
www/js/components/charting.ts 6.66% <ø> (+3.44%) ⬆️
www/js/config/useImperialConfig.ts 82.60% <ø> (ø)
www/js/datetimeUtil.ts 93.75% <ø> (ø)
www/js/diary/diaryHelper.ts 100.00% <ø> (ø)
www/js/diary/list/DateSelect.tsx 52.38% <ø> (ø)
www/js/diary/list/TimelineScrollList.tsx 0.00% <ø> (ø)
www/js/metrics/MetricsTab.tsx 0.00% <ø> (ø)
...w/js/metrics/footprint/FootprintComparisonCard.tsx 0.00% <ø> (ø)
www/js/metrics/footprint/FootprintSection.tsx 0.00% <ø> (ø)
... and 8 more

Copy link
Contributor

@shankari shankari left a comment

Choose a reason for hiding this comment

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

LGTM!

}
// //fill pattern creation
// //https://stackoverflow.com/questions/28569667/fill-chart-js-bar-chart-with-diagonal-stripes-or-other-patterns
// function createDiagonalPattern(color = 'black') {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: why is this commented out? will it be restored or removed in the future?

@shankari shankari merged commit 0c26330 into e-mission:master Sep 27, 2024
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Tasks completed
Development

Successfully merging this pull request may close these issues.

2 participants