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

📈 👔 ✅ Dashboard rewrite (complete) + profile logic improvements + initial testing framework! #1046

Merged
merged 179 commits into from
Oct 2, 2023

Commits on Jul 12, 2023

  1. Initial commit, added chart

    - replaced normal details view of 'My distance' with chart
    - next steps
        - create button to switch between chart and details view in 'my distance' card
        - Figure out why all data is showing up unlabled
        - Allow the axis to switch easily
            - right now, setting isHorizontal doesn't completely switch data, only thedirection of the bars
            - would be nice to flip data axis and bar axis simultaneously
    ctyrrellnrel committed Jul 12, 2023
    Configuration menu
    Copy the full SHA
    b9385e6 View commit details
    Browse the repository at this point in the history
  2. Added two new components

    - one (MetricDetails) is going to be a copy of the original metric details view
    - the next (MetricsCard) is going to be a container to have both the BarChart component, and the MetricDetails component
        - Will be a react component, rather than function, and will hold onto the state of whether or not the barchart or metricdetails will be showing
    
    - next steps
        - add a button to switch between the two views
    ctyrrellnrel committed Jul 12, 2023
    Configuration menu
    Copy the full SHA
    26fe4f9 View commit details
    Browse the repository at this point in the history
  3. Added view state to MetricsCard

    - allows the card to keep track of whether or not it has a BarChart or MetricDetails child component
    - next step
        - Add button
    ctyrrellnrel committed Jul 12, 2023
    Configuration menu
    Copy the full SHA
    c05e071 View commit details
    Browse the repository at this point in the history
  4. Added button to switch between components

    - next step
        - format and style button
    ctyrrellnrel committed Jul 12, 2023
    Configuration menu
    Copy the full SHA
    011b858 View commit details
    Browse the repository at this point in the history
  5. Added button and styling to MetricsCard

    - button allows switching between the BarChart and the MetricDetails card
    - button icon switches depending on the card represented
    ctyrrellnrel committed Jul 12, 2023
    Configuration menu
    Copy the full SHA
    e36ba87 View commit details
    Browse the repository at this point in the history

Commits on Jul 13, 2023

  1. Removing unnecessary code

    - removed children property from card
    - removed leftover code from copying from BarChart.tsx to MetricsCard and MetricDetails
    - Removed unecessary import statements
    ctyrrellnrel committed Jul 13, 2023
    Configuration menu
    Copy the full SHA
    4440e1d View commit details
    Browse the repository at this point in the history

Commits on Jul 19, 2023

  1. Added MetricsCard module to metrics.js

    -- also switched main-metrics html so that only the MetricsCard element is held in the ion-slide element, without any extra divs or headers
    ctyrrellnrel committed Jul 19, 2023
    Configuration menu
    Copy the full SHA
    5ca9754 View commit details
    Browse the repository at this point in the history

Commits on Aug 21, 2023

  1. Configuration menu
    Copy the full SHA
    f3af351 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    cb4c65c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ef8ce3c View commit details
    Browse the repository at this point in the history

Commits on Aug 22, 2023

  1. use new MetricsTab instead of main-metrics

    The new dashboard will have the MetricsTab component as its entry point - main-metrics.html will no longer be rendered
    JGreenlee committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    1bd3b62 View commit details
    Browse the repository at this point in the history
  2. new MetricsTab

    Replacing main-metrics, this component represents the entire Dashboard tab and will get metrics data from the server, store it as state, and pass it down to child components like MetricsCard.
    
    There is also a date picker at the top (TODO) and a refresh button.
    
    The logic for fetching metrics has been modernized into modern JS (async/await) and uses Luxon instead of Moment. I tested to make sure the timestamps of the resulting queries are the same using Luxon as they were with Moment.
    JGreenlee committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    c24da18 View commit details
    Browse the repository at this point in the history
  3. add typings for metric data

    This typing is based on the data we receive from the server.
    For each metric, we receive an array containing "days" of metric data. Each day has a few props (ts, fmt_time, nUsers, local_dt) plus any number of properties with the `label_` prefix that represent the measurment for a particular label.
    
    Having this be type-safe from the start should make it much easier to realized the desired visualizations!
    JGreenlee committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    7473855 View commit details
    Browse the repository at this point in the history
  4. reformat MetricsCard to work with new MetricsTab

    MetricsCard will now accept 'metricDataDays' as a prop and derive the chart data from this.
    We can employ `useMemo` for this so that iff metricDataDays changes, chartData updates.
    
    Prior to this, MetricsCard had an IconButton on the right side allowing users toggle between 'details' and 'graph' view.
    To be clearer to the user, I have changed this to a SegmentedButtons. This way, users see both their options side by side and can select the desired one.
    
    A few colors were added in appTheme.ts - surfaceDisabled and onSurfaceDisabled.
    These are colors that already exist in the React Native Paper default theme, but we are overriding for our own purposes.
    In the SegmentedButtons on MetricsCard, the surfaceDisabled color is used for the button that is not checked
    JGreenlee committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    8753162 View commit details
    Browse the repository at this point in the history
  5. fill out MetricDetails

    With the new MetricsTab, MetricsDetails will receive 'metricDataDays', sum up the totals for each label, and display these in a 2-column.
    The display is the same as the old dashboard, but now the logic to sum up the values is here in this component instead of jumbled in with everything else.
    JGreenlee committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    12d17ce View commit details
    Browse the repository at this point in the history

Commits on Aug 23, 2023

  1. implement datepicker + agg metrics on new dashboard

    MetricsDateSelect will allow users to select a date range. It appears as a NavBarButton, like the label screen date picker, and also uses a DatePickerModal.
    However, this one works differently because users can select a range of days instead of just one.
    
    The selected range is stored in LabelTab as `dateRange` - once this range is loaded, all the displayed metrics will update to reflect the new data.
    `dateRange` is an array of two Luxon DateTime objects, which works well to bridge between the JS Date objects (used by RN Paper Dates) and Unix timestamps (used by e-mission-server / for any network calls)
    JGreenlee committed Aug 23, 2023
    Configuration menu
    Copy the full SHA
    52854c0 View commit details
    Browse the repository at this point in the history
  2. adjust padding in MetricsCard

    The chart does not need so much padding - we want to be able to show as much detail as we can.
    MetricDetails should show with 2 columns, but could use some padding in between.
    
    So let's remove all the padding from the card content since its children will have padding anyway.
    JGreenlee committed Aug 23, 2023
    Configuration menu
    Copy the full SHA
    5ebced8 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f32609e View commit details
    Browse the repository at this point in the history
  4. add ActiveMinutesCard to new dashboard

    The "active minutes" should display the cumulative duration for modes that are considered "active" - currenty this is just 'walk' and 'bike'; I am not sure if anything else will count.
    This should include a graph later on, but right now it just lists out the minutes for each mode.
    JGreenlee committed Aug 23, 2023
    Configuration menu
    Copy the full SHA
    470b4e0 View commit details
    Browse the repository at this point in the history
  5. rename UserMetrics type to MetricsData

    The same type will be used for both user metrics and aggregate metrics, so its naming should be more generic.
    JGreenlee committed Aug 23, 2023
    Configuration menu
    Copy the full SHA
    f93ba1e View commit details
    Browse the repository at this point in the history
  6. add @types/react to devDependencies

    This adds type definitions for the React hooks and makes some of the annoying typing errors go away.
    I don't know why the React package doesn't have types built-in, but this is how you get them.
    JGreenlee committed Aug 23, 2023
    Configuration menu
    Copy the full SHA
    6026918 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    eb60ad5 View commit details
    Browse the repository at this point in the history
  8. unify MetricDetails and MetricsCard

    It's not really necessary for MetricDetails to be its own component - it is actually simpler to just include these few lines of code in MetricsCard.
    Then MetricsCard will handle the memoized computation either way, whether it's `chartData` or `metricSumValues` that is needed (depending on whether 'graph' or 'details' is active)
    JGreenlee committed Aug 23, 2023
    Configuration menu
    Copy the full SHA
    18eafef View commit details
    Browse the repository at this point in the history
  9. delete MetricDetails.tsx

    It was incorporated into MetricsCard and is no longer a standalone component
    JGreenlee committed Aug 23, 2023
    Configuration menu
    Copy the full SHA
    db06256 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    9f46973 View commit details
    Browse the repository at this point in the history

Commits on Aug 24, 2023

  1. generalize format functions in useImperialConfig

    It is useful to have the format function (which handles rounding to 2 or 3 sig figs) generic enough to work for any unit.
    We can also have it use Intl.NumberFormat to work better with other languages (other languages might use commas and periods differently, or have a different decimal marking altogether)
    JGreenlee committed Aug 24, 2023
    Configuration menu
    Copy the full SHA
    cf4f0e6 View commit details
    Browse the repository at this point in the history
  2. fix formatForDisplay

    JGreenlee committed Aug 24, 2023
    Configuration menu
    Copy the full SHA
    964da4b View commit details
    Browse the repository at this point in the history
  3. show units correctly on MetricsCards

    Using a prop passed to MetricsCard called unitFormatFn, we will format the raw numerical values as human-readable strings in the correct unit of measurement.
    JGreenlee committed Aug 24, 2023
    Configuration menu
    Copy the full SHA
    c417879 View commit details
    Browse the repository at this point in the history
  4. support aggregate metrics on MetricsCard

    Added a second pair of SegmentedButtons to allow toggling between 'user' and 'aggregate' metrics.
    So now there are two toggles - instead of repeating all that SegmentedButtons code, I extracted it out into a new ToggleSwitch component, which is a generic wrapper around SegmentedButtons for our particular uses.
    
    Each MetricsCard now accepts both userMetricsDays and aggMetricsDays, instead of just one metricDataDays, and it determines which to use based on the value of the toggleswitch - "populationMode"
    JGreenlee committed Aug 24, 2023
    Configuration menu
    Copy the full SHA
    7a3a6c6 View commit details
    Browse the repository at this point in the history
  5. fix MetricsCard not always updating details view

    viewMode was not in the dependency array, so if it was changed in isolation, metricSumValues would not recompute.
    JGreenlee committed Aug 24, 2023
    Configuration menu
    Copy the full SHA
    b04aab7 View commit details
    Browse the repository at this point in the history
  6. fix vertical scrolling on new Dashboard tab

    I noticed that when the content was tall enough to allow vertical scrolling, you could not scroll to see the bottom even though the content was in a ScrollView.
    Upon inspection, the new Dashboard tab was growing infinitely tall, past the bottom of its Angular parent container.
    
    We've had this happen a couple times before when embedding React components into Angular views.
    
    The way we get around this is with a CSS class called 'fill-container'. I modified it slightly to only affect the *direct* child, not all grand- and great-grand-children. Without this modification, the entire tab would be hidden from view.
    JGreenlee committed Aug 24, 2023
    Configuration menu
    Copy the full SHA
    b6dfb4f View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    d0763cd View commit details
    Browse the repository at this point in the history
  8. update BarChart for categorical data & flat inputs

    We have been showing time-based data on the BarChart, where one of the axes (depending if horizontal or vertical) has values as Unix timestamps.
    
    We'd like this component to also work with categorical data, so we will have a boolean prop `timeAxis` to say whether it should be timestamps (true) or categories (false).
    
    Also, the way BarChart receives input data has been changed. ChartJS accepts input, categorized by 'datasets' which have their own label. For us, this correlates to the different labeled modes.
    
    However, the metrics we get from the server lend themselves better to a 'flattened' structure - we receive an array of days, and what labels were for that day; we don't receive an array of labels with what their value was on each day.
    
    So we would have to flip this data around in each place that the BarChart was used. Instead, it's simpler for BarChart to accept a flattened structure - and we can do the flipping here in BarChart before the flipped data is fed into ChartJS.
    
    And to better keep track of all this, let's introduce typings for the input, flat 'records' and for the resulting, flipped 'chartData'.
    JGreenlee committed Aug 24, 2023
    Configuration menu
    Copy the full SHA
    d074cab View commit details
    Browse the repository at this point in the history
  9. in MetricsCard, pass records to BarChart

    BarChart was reworked to accept a 'flat' array of records instead of a deep structure tailored for ChartJS.
    The flattened structure is more congruent with the userMetricsDays / aggMetricsDays that comes upstream from LabelTab.
    The BarChart component now handles tailoring this to a format that ChartJS can work with.
    JGreenlee committed Aug 24, 2023
    Configuration menu
    Copy the full SHA
    6780dae View commit details
    Browse the repository at this point in the history
  10. styling tweaks and refactoring

    -move some common styles to a common location MetricsTab
    -shorten height of MetricsCard title bar
    -remove top/bottom borders of ToggleSwitch buttons
    JGreenlee committed Aug 24, 2023
    Configuration menu
    Copy the full SHA
    4e7b054 View commit details
    Browse the repository at this point in the history

Commits on Aug 25, 2023

  1. add chart to ActiveMinutesCard

    Considering the most recent two weeks for which days of metric data have been loaded, we calculate the total weekly time spend a) walking and b) biking. We store these totals as weeklyActiveMinutesRecords to be included in a vertical, categorical BarChart.
    
    `flex: 1` was added to the BarChart component (if it is vertical), as well as to the card content. This allows the "Active Minutes" chart to grow as tall as the Card and display the bar chart more effectively.
    
    Also add i18n key for "active minutes"
    JGreenlee committed Aug 25, 2023
    Configuration menu
    Copy the full SHA
    8f8d229 View commit details
    Browse the repository at this point in the history

Commits on Aug 26, 2023

  1. begin Carbon Footprint card

    Bulk of the work here is data formatting to use FootprintHelper, done in two main steps
    
    parseDataFromMetrics takes in the userData of one metric at a time from the server and gathers "mode bins" resulting in an array of objects with "key"(mode) and "values"(array of arrays of values, one array per day with times and value of the mode)
    
    THEN generateSummaryFromData takes each of those binned modes, and aggregates down to a single value - either with sum or avg
    
    The 'distance' mode from this summary is digestible to FootprintHelper, used so far to get low and high estimates
    
    lots TODO - splitting into "current" and "prev" weeks, agg metrics, goals ...
    Abby Wheelis committed Aug 26, 2023
    Configuration menu
    Copy the full SHA
    4aa123a View commit details
    Browse the repository at this point in the history

Commits on Aug 28, 2023

  1. BarChart: support stacked bars

    BarCharts will be stacked by default for:
    -Active minutes ('walk' and 'bike' minutes stacked together)
    -MetricsCard charts - but they will be toggleable by a checkbox, so they can be either unstacked/stacked. Stacked looks a lot cleaner, especially with a lot of modes showing, so it will be the default.
    
    In BarChart.tsx, getChartHeight was modified to account for stacked charts - if labels are stacked on the chart, then the chart height doesn't depend on how many labels are showing and we can just use a constant for the height of each bar (36 was a comfy height).
    JGreenlee committed Aug 28, 2023
    Configuration menu
    Copy the full SHA
    db5c005 View commit details
    Browse the repository at this point in the history
  2. show date ranges for weeks on ActiveMinutesCard

    To make it clearer what data is being used to calculate week-wise metrics, "Past week" and "Previous week" should be annotated with the specific dates they encompass.
    For this to not clutter the chart, I wanted these to be on a newline, like this:
    
    Past Week
    8/21-8/27
    
    ChartJS doesn't support this by itself - `\n` is just rendered as a space - but we can remedy this by adding a callback function under ChartJS options > 'scales' > 'ticks' that splits a label into an array if it has `\n`.
    JGreenlee committed Aug 28, 2023
    Configuration menu
    Copy the full SHA
    23a479c View commit details
    Browse the repository at this point in the history
  3. readable labels on new dashboard

    the dashboard works with the label keys "e.g. 'walk', 'drove_alone'. To show these as readable text we can repurpose a function from `confirmHelper.ts` which is used for "other" text.
    Let's rename it to be more generic, make it work with more than just 1 underscore, and export it so we can use it on the dashboard too,
    JGreenlee committed Aug 28, 2023
    Configuration menu
    Copy the full SHA
    c480d67 View commit details
    Browse the repository at this point in the history
  4. fix axis units on MetricsCard

    `unitFormatFn` should be used on the chart so the values appear in the listed unit and not the raw value.
    (e.g., '3 miles' instead of '4828 meters')
    JGreenlee committed Aug 28, 2023
    Configuration menu
    Copy the full SHA
    9e40252 View commit details
    Browse the repository at this point in the history
  5. refactor new dashboard into Carousel

    The horizontal ScrollView requires a few tricks to get the scrolling to snap correctly while managing the card widths and margins.
    Let's extract this logic to a reusable "Carousel" component so we can use it multiple times without MetricsTab getting too cluttered.
    JGreenlee committed Aug 28, 2023
    Configuration menu
    Copy the full SHA
    fde2283 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    167e3d1 View commit details
    Browse the repository at this point in the history
  7. more user metrics

    card now retrieves and stores user data for past and previous weeks, worst-case emissions, and US goals
    
    used filterToRecentWeeks from metricsHelper.ts to separate user data into the last two weeks, and display data for both if the range is 2 weeks or more
    
    worst-case carbon is calculated with a method in FootPrintHelper called on the total distance for the most recent week
    Abby Wheelis committed Aug 28, 2023
    Configuration menu
    Copy the full SHA
    76ebb17 View commit details
    Browse the repository at this point in the history
  8. add percent change to carbon card

    if there is a previous week, we use current and previous to calculate a percent change over the two and display it to the user
    Abby Wheelis committed Aug 28, 2023
    Configuration menu
    Copy the full SHA
    8972b51 View commit details
    Browse the repository at this point in the history
  9. rough draft carbon chart

    using bar chart, we are able to present the carbon metrics to the user visually. There will be two colors on the graph, one for "certain" and one for "uncertain" to display the range -- graph in rough draft stage currently, want to add baselines and adjust colors
    
    also tweaked the labeling in BarChart in response to an error thrown when there were more x axis than labels -- this change shows correct x axis labels for both cards that rely on these categories
    Abby Wheelis committed Aug 28, 2023
    Configuration menu
    Copy the full SHA
    9c8e884 View commit details
    Browse the repository at this point in the history
  10. comment out "average speed" card

    "Average speed" needs to be handled differently because it is not mathematically correct to average it across days without considering differences in distance and duration between those days.
    (described in e-mission/e-mission-docs#961)
    
    We can comment this out; maybe revisit later
    JGreenlee committed Aug 28, 2023
    Configuration menu
    Copy the full SHA
    8839613 View commit details
    Browse the repository at this point in the history
  11. dashboard: initial load 15 days ago to yesterday

    Let's change the initial loaded range so that we get 2 full weeks of data. This is so that the weekwise comparisons can show "past week" and "previous week" - if we only had 13 days we could only show "past week" and not the full "previous week"
    JGreenlee committed Aug 28, 2023
    Configuration menu
    Copy the full SHA
    7643895 View commit details
    Browse the repository at this point in the history
  12. add carbon goal lines

    using the lineAnnotations attribute, adding the goal lines to the Carbon data graph
    Abby Wheelis committed Aug 28, 2023
    Configuration menu
    Copy the full SHA
    35cd467 View commit details
    Browse the repository at this point in the history

Commits on Aug 29, 2023

  1. move %change to Card Title

    Right component of the CarbonFootprintCard is now an indication of change over past two weeks
    
    The element is only visible when there is a change to show, is red when carbon increasing and yellow when carbon decreasing, and shows ranges when labeling leaves doubt
    
    The new ChangeIndicator component accepts an array of numbers of length 1 or 2 to display change as a single value or a range. This new component separates the logic and styling, and could be used on another card later if desired.
    Abby Wheelis committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    0fa637d View commit details
    Browse the repository at this point in the history
  2. flip bar chart to horizonal

    change the boolean for isHorizonal to true and flip x and y values (since x and y are flipped to turn horizontal)
    Abby Wheelis committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    f4179f3 View commit details
    Browse the repository at this point in the history
  3. clean up CarbonFootprintCard

    remove unused code, unused imports, and development log statements
    
    also refactored userCarbonRecords useMemo to handle the graph records, old UserCarbon was used for text-based display in initial draft
    Abby Wheelis committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    3d0c910 View commit details
    Browse the repository at this point in the history
  4. support split-line labels in horizontal BarChart

    incorporating a patch from @JGreenlee to allow the labels to split lines when the graph is horizontal
    Abby Wheelis committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    c93961b View commit details
    Browse the repository at this point in the history
  5. i18n for CarbonFootprintCard

    made updates to en.json and CarbonCard to enable i18n translation of labels, titles, etc.
    
    "(kg Co2)" is now the only hard-coded string here
    Abby Wheelis committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    9e8aebc View commit details
    Browse the repository at this point in the history
  6. add group metrics to chart

    using aggMetrics and the same data processing functions, group average is shown alongside user specific metrics
    
    We might need to consider hiding this if it is too far out (I'm thinking of nrel-commute, for example, where about 5/6 trips are unlabeled)
    Abby Wheelis committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    5aad944 View commit details
    Browse the repository at this point in the history
  7. adjust styling of ChangeIdicator

    remove accidental import, and adjust to better match the wireframe
    Abby Wheelis committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    e6370c0 View commit details
    Browse the repository at this point in the history

Commits on Aug 30, 2023

  1. prevent double negative

    in ChangeIndicator, discovered an error where negative values showed prefixed by -- instead of -
    
    added abs calls to prevent this double negative
    Abby Wheelis committed Aug 30, 2023
    Configuration menu
    Copy the full SHA
    258721c View commit details
    Browse the repository at this point in the history
  2. fix time ticks

    When we override the callback in any manner, we're responsible for all formatting of the ticks https://www.chartjs.org/docs/latest/axes/labelling.html
    
    overriding to "undefined" meant that the default tick formatter was never called, and the time ticks were unformatted
    
    By bumping the timeAxis switch up a level, we prevent overriding the default time ticks, and the dates are shown in an intuitive way
    Abby Wheelis committed Aug 30, 2023
    Configuration menu
    Copy the full SHA
    8151d7f View commit details
    Browse the repository at this point in the history
  3. patches to % change

    when switching from 2+ weeks to a date range < 2 weeks, we should take the change indicator off the card, we accomplish this by setting the emissionsChange to "{}"
    
    in the case of NaN, we want to display the change as infinite, since it's a result of dividing by a 0 value for the previous week
    Abby Wheelis committed Aug 30, 2023
    Configuration menu
    Copy the full SHA
    4c44a00 View commit details
    Browse the repository at this point in the history
  4. eliminate create range function

    This range is no longer needed, as we can use the {low, high} object without converting it
    Abby Wheelis committed Aug 30, 2023
    Configuration menu
    Copy the full SHA
    8cc6d7f View commit details
    Browse the repository at this point in the history
  5. show certain/uncertain and goal lines

    show group bar with user metrics for "seeing how you stack up"
    
    add goal lines in yellow and red to show that "less is more"
    Abby Wheelis committed Aug 30, 2023
    Configuration menu
    Copy the full SHA
    9b128b7 View commit details
    Browse the repository at this point in the history

Commits on Aug 31, 2023

  1. make ToggleSwitch more generic

    This is basically just a wrapper around SegmentedButtons; let's type it as such and still allow any other SegmentedButtonsprops to be passed through
    JGreenlee committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    8fc1c65 View commit details
    Browse the repository at this point in the history
  2. move ToggleSwitch to /js/components

    So it may be used on other screens in the future
    JGreenlee committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    c468478 View commit details
    Browse the repository at this point in the history
  3. match ToggleSwitch props to SegmentedButtonProps

    Now this is a perfect wrapper around SegmentedButton, accepting exactly the same props and just applying a different default style.
    This should aid in reusing this component on other screens.
    JGreenlee committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    29a0ab1 View commit details
    Browse the repository at this point in the history
  4. revert extra functions in metricsHelper.ts

    These functions were committed by accident in c468478 and did not belong there
    JGreenlee committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    d2a8dc5 View commit details
    Browse the repository at this point in the history
  5. ActiveMinutesCard -> WeeklyActiveMinutesCard

    refactoring this and putting it in a Carousel in preparation of creating a new card component to place in the carousel
    JGreenlee committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    d9f478b View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    4613f80 View commit details
    Browse the repository at this point in the history
  7. add LineChart.tsx

    The LineChart has only a few differences from BarChart - there is no 'stacked' or 'annotations', but we must consider a few new properties: 'borderColor' 'borderWidth' and 'tension' for the lines between points
    JGreenlee committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    8a605e0 View commit details
    Browse the repository at this point in the history
  8. add DailyActiveMinutesCard to MetricsTab

    This component has a line chart showing (up to) the last 14 days, with active minutes for each day on the Y axis. There are separate lines for bike and walk.
    JGreenlee committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    2aea2e5 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    691c206 View commit details
    Browse the repository at this point in the history
  10. add weekly minutes goal, fix lone "0"

    -adds the CDC recommended 150 minutes, positioned centered
    -the 'overall' totals should show if activeModesDurations exists and has a length greater than 0 - if we don't include the '>' operator the expression may evaluate as the number 0, which would be rendered as text
    JGreenlee committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    41ba903 View commit details
    Browse the repository at this point in the history
  11. allow gaps in daily active minutes line chart

    It's actually important to push records for every day on this chart, even if the values are undefined or otherwise falsy.
    For example, most people don't bike every day - so we need to show gaps in the line graph on the days they don't, and the only way to do that is to pass falsy values through.
    JGreenlee committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    20b457a View commit details
    Browse the repository at this point in the history
  12. Merge remote-tracking branch 'origin/dashboard-rewrite' into dashboar…

    …d-rewrite
    
    Needed to resolve merge conflicts in order to preserve local changes
    Abby Wheelis committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    6504bae View commit details
    Browse the repository at this point in the history
  13. color meter chart

    added parameter to BarChart to allow for a "meter" chart -- with a green/yellow/red scale changing at specified "middle" and "high" values, dashed lines for uncertainty appear when labeled "dash_key"
    
    changed "goal" for "guideline" to further emphasize NOT exceeding it, shortened for better formatting
    
    added keys for "labeled" and "unlabeled", replaced what was hard-coded as "certain" and "uncertain"
    Abby Wheelis committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    bcc1010 View commit details
    Browse the repository at this point in the history
  14. darken the guideline lines

    when the dashed guidelines are the same colors as the bars - and they cross- the line disappears
    
    By darkening the lines slightly, we preserve their visibility when the two objects cross
    
    e-mission/e-mission-docs#961 (comment)
    Abby Wheelis committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    71adf57 View commit details
    Browse the repository at this point in the history
  15. forgotten color import

    this import should have been a part of 71adf57
    Abby Wheelis committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    950b163 View commit details
    Browse the repository at this point in the history
  16. add footnote

    adding an explanatory footnote to the Carbon card, so users know what the goals mean
    
    e-mission/e-mission-docs#961 (comment)
    Abby Wheelis committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    09d4711 View commit details
    Browse the repository at this point in the history

Commits on Sep 1, 2023

  1. refactor BarChart

    With all the charting features we've added, this file has gotten fairly long and messy.
    To keep things tidy, let's extract some of these functions to a separate file called charting.ts.
    
    In the process, let's ensure the BarChart is properly typed. Upon reading documentation, I found out that we can type the chart data by using ChartData<'bar', {Z}> where Z is the values that each data point has (in our case, x and y values, which can be number | string)
    
    This makes all the type definitions line up - before this, we had a lot of different type warnings because TypeScript didn't understand our data structure.
    JGreenlee committed Sep 1, 2023
    Configuration menu
    Copy the full SHA
    a9b311a View commit details
    Browse the repository at this point in the history

Commits on Sep 5, 2023

  1. Configuration menu
    Copy the full SHA
    d48d333 View commit details
    Browse the repository at this point in the history
  2. add text to Carbon Card

    for accessibility purposes, the information should be available in ways other than the graph, so that it is easier for a screen reader to successfully navigate the page
    Abby Wheelis committed Sep 5, 2023
    Configuration menu
    Copy the full SHA
    0f4a4e9 View commit details
    Browse the repository at this point in the history

Commits on Sep 6, 2023

  1. move carbon footprint text to dedicated card

    e-mission/e-mission-docs#961 (comment) -> implementing this suggestion
    
    isolate the text to a dedicated card, and place the "meter" card and "text" card in a carousel, now we have three rows, each a carousel.
    
    also isolated data management functions shared across the two cards into `metricsHelper.ts`
    
    The two cards keeps information easily accessible to those using a screen reader, while maintaining focus on the "meter" card and not cluttering the screen
    Abby Wheelis committed Sep 6, 2023
    Configuration menu
    Copy the full SHA
    15ed685 View commit details
    Browse the repository at this point in the history
  2. shorten carbon chart labels

    Abby Wheelis committed Sep 6, 2023
    Configuration menu
    Copy the full SHA
    1c3b532 View commit details
    Browse the repository at this point in the history
  3. bars colored by mode

    Update the color scheme to correspond to the colors used on the label screen to represent each mode
    
    Otherwise duplicated colors are handled by darkening or lightening the base color for subsequent modes of the same "base"
    
    storing the modeColors with useMemo means they will only update when chartDatasets change (preventing bog-down issue encountered in development)
    Abby Wheelis committed Sep 6, 2023
    Configuration menu
    Copy the full SHA
    b377933 View commit details
    Browse the repository at this point in the history

Commits on Sep 7, 2023

  1. remove extraneous commented code

    this was committed by accident as an artifact of some earlier experimentation
    JGreenlee committed Sep 7, 2023
    Configuration menu
    Copy the full SHA
    e2b6b99 View commit details
    Browse the repository at this point in the history
  2. refactor makeColorMap

    - use 'forEach' as it is a bit more concise than the traditional for loop
    - instead of formatLabelForSearch, we can borrow a function from confirmHelper that does exactly this and was just sitting around waiting to be used. Let's also ensure this function follows the same process as its opponent function `labelKeyToReadable`, but in reverse, and unify their naming scheme and add descriptions. This function can also be used in MultilabelButtonGroup because we do the same formatting there.
    JGreenlee committed Sep 7, 2023
    Configuration menu
    Copy the full SHA
    4143bf0 View commit details
    Browse the repository at this point in the history
  3. refactor modeColors

    chartData itself depends on modeColors, and nothing else uses modeColors. modeColors and chartData both depend on the same thing (chartDatasets) and should update whenever it does.
    So we can just have modeColors be computed inside of the body of chartData.
    
    And to ensure we have labelOptions defined, we'll add that to the dependency array, returning blank data if it isn't defined
    JGreenlee committed Sep 7, 2023
    Configuration menu
    Copy the full SHA
    e0c7d82 View commit details
    Browse the repository at this point in the history
  4. slim the Carousel card margins

    The gap between cards should not be bigger than the gap before the first card / after the last card. To get this effect, the first and last card need full size margins, while the inner margins can be half that.
    Overall this gives us slimmer margins that are uniform.
    JGreenlee committed Sep 7, 2023
    Configuration menu
    Copy the full SHA
    40a9b5e View commit details
    Browse the repository at this point in the history
  5. decrease Y axis font size on BarChart

    in an effort to give some more space to the chart itself
    e-mission/e-mission-docs#961 (comment)
    JGreenlee committed Sep 7, 2023
    Configuration menu
    Copy the full SHA
    96ee1c6 View commit details
    Browse the repository at this point in the history
  6. format CarbonTextCard as rows

    it seems more comprehensible when organized this way
    JGreenlee committed Sep 7, 2023
    Configuration menu
    Copy the full SHA
    3335086 View commit details
    Browse the repository at this point in the history
  7. fix warnings in MetricsCard

    React warns us about the missing 'key' prop if we don't put a key whenever we iterate and repeat components, so a `key` was added to this View.
    
    The way the brackets were arranged on line 89 was actually causing a single space " " to be rendered, which React was also warning us about in the console.
    JGreenlee committed Sep 7, 2023
    Configuration menu
    Copy the full SHA
    50c5292 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    3cb062a View commit details
    Browse the repository at this point in the history
  9. style US decarbonization goals text as footnote

    This description is basically a footnote - why not formally represent it as such?
    We'll use small text and a superscript ¹ to mark the footnote.
    JGreenlee committed Sep 7, 2023
    Configuration menu
    Copy the full SHA
    aad133e View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    3ef6860 View commit details
    Browse the repository at this point in the history
  11. make Carousel cards slightly wider

    We want these cards as wide as possible to show all the info we have without it seeming cramped.
    But we cannot go too wide or the bleeding edge won't show. Here is a good balance.
    JGreenlee committed Sep 7, 2023
    Configuration menu
    Copy the full SHA
    ac59d00 View commit details
    Browse the repository at this point in the history
  12. fix previous week bar value

    mistakenly, the previous and past weeks were showing the same "certain" value
    
    I noticed that even with a 43% change the bars looked the same, and was able to catch and fix my mistake
    Abby Wheelis committed Sep 7, 2023
    Configuration menu
    Copy the full SHA
    9976516 View commit details
    Browse the repository at this point in the history

Commits on Sep 8, 2023

  1. adjust color-by-mode on dashboard

    We want our code used for charting to be fairly generic and not specific to any particular use case. So instead of handling the mode labels and their base modes in charting.ts, we should refactor this so the logic is encapsulated in the appropriate areas of the codebase.
    
    To accomplish this, BarChart can accept a function `getColorForLabel` that it will use on each of the labels it finds in `records`. This way, BarChart and charting.ts don't have to specificially deal with the lookup of the base mode colors.
    
    The logic that *does* get included in the charting code, because it is needed for visually distinguishing labels on the charts, is the de-duplication function. I refactored this to be more generic as well - not based on fixed 'stops' of darkening/lightening. Instead, it finds how many duplicates there are and evenly distributes them in lightness. So if there are 2, one will be lightened and the other darkened. With an odd number, the middle will stay the same. And the more duplicates, the closer in shade they will be.
    Darkening was toned down by a scale of .5 because it has a more drastic effect than lightening.
    
    The modeColors themselves were also slightly adjusted in diaryHelper.ts - notably, the difference in hue between 'pink' and 'red' was widened. Besides this, everything was made very slightly lighter and the oklch comments were updated to reflect in-gamut saturation values.
    JGreenlee committed Sep 8, 2023
    Configuration menu
    Copy the full SHA
    e4cadd2 View commit details
    Browse the repository at this point in the history

Commits on Sep 9, 2023

  1. Configuration menu
    Copy the full SHA
    4c1e967 View commit details
    Browse the repository at this point in the history

Commits on Sep 11, 2023

  1. Configuration menu
    Copy the full SHA
    44d3185 View commit details
    Browse the repository at this point in the history
  2. big refactor of BarChart & LineChart

    Instead of repeating a bunch of code between BarChart and LineChart, let's refactor this into a common Chart component that works with a type of either 'bar' or 'line'.
    
    Then BarChart and LineCharts will simply be composed of a Chart with the appropriate type specified.
    Any logic specific to BarCharts or LineCharts can be put in the respective files.
    
    Currently, LineChart has no specific logic and the only thing BarCharts have specifically is the 'meter' prop.
    JGreenlee committed Sep 11, 2023
    Configuration menu
    Copy the full SHA
    25a5f5a View commit details
    Browse the repository at this point in the history
  3. add base mode colors to DailyActiveMinutesCard

    Now that we refactored, the line chart can accept getColorForLabel in the same way that bar charts do.
    JGreenlee committed Sep 11, 2023
    Configuration menu
    Copy the full SHA
    83aa958 View commit details
    Browse the repository at this point in the history
  4. convert the log page to React

    for react routing, we need to convert this page and the sync settings page
    
    maintain access for now by routing to a React page with angular routing
    
    using AlertBars for the error messages
    
    first draft: scrolling the FlashList is broken and the data doesn't load unless you manually tap refresh
    Abby Wheelis committed Sep 11, 2023
    Configuration menu
    Copy the full SHA
    c240f79 View commit details
    Browse the repository at this point in the history

Commits on Sep 12, 2023

  1. Configuration menu
    Copy the full SHA
    7f73823 View commit details
    Browse the repository at this point in the history
  2. change "Co2" to "CO₂"

    JGreenlee committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    ca8edbe View commit details
    Browse the repository at this point in the history
  3. fix name of CarbonTextCard

    JGreenlee committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    6a353f8 View commit details
    Browse the repository at this point in the history
  4. add ActiveMinutesTableCard

    The new dashboard has a lot of charts. In consideration of accessibility, we want to also display this information in non-graphical text formats.
    
    This cards shows all the metrics for active minutes in the form of a paginated table.
    JGreenlee committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    62ea9f4 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    17f401c View commit details
    Browse the repository at this point in the history
  6. Merge remote-tracking branch 'upstream/label_dashboard_profile_sept_2…

    …023' into unblock-routing
    Abby Wheelis committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    ef6ba26 View commit details
    Browse the repository at this point in the history
  7. implement refresh() on MetricsTab

    Also, the type of dateRange was changed to `DateTime[]` (since I realized it had been declared using the wrong typing style)
    JGreenlee committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    8ebc390 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    89e3d64 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    06f7b2d View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    72f6437 View commit details
    Browse the repository at this point in the history
  11. dashboard: use rich mode text, not readable label

    The dashboard should show the full text of the mode as defined in the label options - e.g. show "Gas Car Drove Alone", not "Drove Alone".
    According to #1026 (comment) we shouldn't convert keys like "drove_alone" to readable like "Drove Alone", except in the case of user-defined labels ('other text')
    JGreenlee committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    9208ec0 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    7dbc343 View commit details
    Browse the repository at this point in the history
  13. refactor dialogStyle and create Action Menu

    instead of making dialogStyle a parameter, export and import the stylesheet where it is used, to maintain consistency and limit parameters
    
    Needed something similar to some of the dialogs in ProfileSettings for the SyncLogs -- so create a component `ActionMenu` to show the list of options, replacing the two hard-coded modals (carbon and force state) with an instance of ActionMenu
    Abby Wheelis committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    c8ceafe View commit details
    Browse the repository at this point in the history
  14. ActionMenu title

    so each has it's own title, add a title parameter
    Abby Wheelis committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    b682e53 View commit details
    Browse the repository at this point in the history
  15. make space for annotation at top of chart

    If the annotations sit at the top of a horizontal bar chart, they will cover up much of the top bar.
    We can offset them so they sit higher, and set clip=false so they can show above the chart area, but then they crowd the legend.
    
    There isn't a good way to add padding/margin to a ChartJS legend, so we have this workaround in 'plugins'
    JGreenlee committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    7d2b9dc View commit details
    Browse the repository at this point in the history
  16. fix footprint calculations using baseModes

    The footprint calculations were not using because we were looking up footprints by rich mode and we needed to be looking up by base mode.
    JGreenlee committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    5fcc5d4 View commit details
    Browse the repository at this point in the history
  17. add SensedPage, fix scrolling

    the other page that needs conversion is the one that shows sensed data, so convert it as well
    
    Resolved scroll issue by getting out of Angular -- using a full screen modal helps us accomplish this
    Abby Wheelis committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    7e55e83 View commit details
    Browse the repository at this point in the history
  18. take out old code

    we no longer rely on any of the angular code that controlled the log pages, so we can remove the files and the places they were imported
    Abby Wheelis committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    4c430d2 View commit details
    Browse the repository at this point in the history
  19. adjust ChangeIndicator colors and text

    -round percentage change to whole numbers because it is less cluttered that way
    -show % sign on both sides of the range
    - internationalize 'this week'
    -use transparency on background/border colors so it does not clash with the colors on the card
    
    -make 'success' color less washed-out
    JGreenlee committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    7d0eb81 View commit details
    Browse the repository at this point in the history
  20. update log page to load more

    previously, was not loading more when you hit the end of the list, now the list loads more when you reach the end
    Abby Wheelis committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    f1f9b57 View commit details
    Browse the repository at this point in the history
  21. load on enter

    load the log pages when their visibility changes, this seems cleaner than tying it to the config, since this is unrelated to the config
    Abby Wheelis committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    e21cb6e View commit details
    Browse the repository at this point in the history
  22. fix dateRange issue

    The use of UTC time here was inconsistent with how MetricsDateSelect works - MetricsDateSelect uses the local timezone for date selection.
    DateTime.utc returns a DateTime object which may be on a different day than the day in the local timezone.
    
    MetricsDateSelect works properly for this and the initial load should follow suit.
    JGreenlee committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    92ad2ee View commit details
    Browse the repository at this point in the history
  23. refactor .then() to try/catch

    Abby Wheelis committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    496b353 View commit details
    Browse the repository at this point in the history
  24. resolve error

    I was getting a mysterious "unrecognized selector" error and came to the conclusion that it was because loadStats.currentStart was null on first load, by setting a fallback, the error is resolved
    Abby Wheelis committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    fe44ae6 View commit details
    Browse the repository at this point in the history
  25. remove infiniteScrollComplete broadcasts

    these had been commented out, and by searching the codebase I came to the conclusion that they were for communicating with angular/ionic, which we no longer use
    
    unlike other broadcasts, this is not received by other parts of our code, to trigger some action, so we don't need it
    Abby Wheelis committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    e50f0a1 View commit details
    Browse the repository at this point in the history
  26. fix sensed formatting

    I was using react-native Text when I wanted react-native-paper Text
    Abby Wheelis committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    fd32aee View commit details
    Browse the repository at this point in the history

Commits on Sep 13, 2023

  1. i18n for ui strings

    Adding translations for the user-visible strings to ensure users can access the dev zone, the logs will be in English, but with headers and error messages in selected language participating in debugging will be easier
    Abby Wheelis committed Sep 13, 2023
    Configuration menu
    Copy the full SHA
    d20bf2e View commit details
    Browse the repository at this point in the history
  2. remove old functions

    we don't need these show sensed or show logs anymore!
    Abby Wheelis committed Sep 13, 2023
    Configuration menu
    Copy the full SHA
    f132056 View commit details
    Browse the repository at this point in the history
  3. factor out "Locations" and "Motion Type"

    these two options are not supported, so we should not present them to the user -- removing them leaves us with one option, so no need for an options menu
    
    This reduces the complexity of the sensed data page significantly
    
    note about removing options: #1029 (comment)
    Abby Wheelis committed Sep 13, 2023
    Configuration menu
    Copy the full SHA
    723c5e7 View commit details
    Browse the repository at this point in the history
  4. combine dev-errors into errors

    Abby Wheelis committed Sep 13, 2023
    Configuration menu
    Copy the full SHA
    d04d5ee View commit details
    Browse the repository at this point in the history

Commits on Sep 14, 2023

  1. Configuration menu
    Copy the full SHA
    a3b0c08 View commit details
    Browse the repository at this point in the history
  2. re-order "Prev. week" before "Past week", refactor

    Order changed on Carbon + Active minutes cards - Prev week comes first to establish a trend.
    
    - 'filterToRecentWeeks' refactored into 'segmentDaysByWeeks'. Although it does largely the same thing, the new one is more generic because it works for any number of weeks, not just 2
    JGreenlee committed Sep 14, 2023
    Configuration menu
    Copy the full SHA
    b9e1416 View commit details
    Browse the repository at this point in the history
  3. tweak ChangeIndicator style

    A little bit better contrast
    JGreenlee committed Sep 14, 2023
    Configuration menu
    Copy the full SHA
    0ecfa58 View commit details
    Browse the repository at this point in the history
  4. fix error sometimes if metrics is not defined yet

    If metrics is not defined, we can simply skip this and let the function return [] - it will be re-run from upstream once metrics is defined
    JGreenlee committed Sep 14, 2023
    Configuration menu
    Copy the full SHA
    54e6d8b View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    907737b View commit details
    Browse the repository at this point in the history
  6. adjust carbon meter gradient

    We will now use the same yellow-orange-red gradient for all bars that have a gradient, instead of making a specific gradient for each bar. This allows the gradients on each bar to line up.
    
    The gradient will only apply to bars that exceed meter.low. Anything below low is green. Anything in middle is yellow, becoming orange-red as it gets higher. If it goes above high, it will start to become dark red up to high+20.
    
    #1018 (comment)
    JGreenlee committed Sep 14, 2023
    Configuration menu
    Copy the full SHA
    a3264e2 View commit details
    Browse the repository at this point in the history
  7. refactor: remove darkenForBorder + fix

    We already have a function that serves this purpose, so let's just use it (darkenOrLighten)
    It turns out that it was actually flipped from what was intended, though -- negative numbers should equate to darkening and positive to lightening.
    It didn't really matter before because it was used for deduping where one duplicate is always lightened while the other is darkened.
    JGreenlee committed Sep 14, 2023
    Configuration menu
    Copy the full SHA
    67111b8 View commit details
    Browse the repository at this point in the history
  8. React Control Helpers

    create a React version of ControlCollectionHelper and ControlSync Helper. These hold the logic for interfacing with the plugins, as well as UI elements for editing menus and various alerts / messages
    
    The place this is being stored has also changed, we no longer need to import from the other repos
    
    These helpers will eliminate the last parts of React routing, and allow us to no longer rely on the broadcast of "control update complete" to ensure the UI stays up to date
    Abby Wheelis committed Sep 14, 2023
    Configuration menu
    Copy the full SHA
    5e7a50c View commit details
    Browse the repository at this point in the history
  9. fix medium accuracy

    medium accuracy switch was broken, now can be toggled smoothly
    Abby Wheelis committed Sep 14, 2023
    Configuration menu
    Copy the full SHA
    9255675 View commit details
    Browse the repository at this point in the history
  10. remove update complete listeners

    no longer needed, as refreshCollect settings is called after toggling accuracy, toggling tracking, and when the settings editor is closed
    Abby Wheelis committed Sep 14, 2023
    Configuration menu
    Copy the full SHA
    1b8a43c View commit details
    Browse the repository at this point in the history
  11. eliminate settingsScope

    no longer rely on settingsScope to catch recomputeAppStatus, because we check on resume, this is not needed
    Abby Wheelis committed Sep 14, 2023
    Configuration menu
    Copy the full SHA
    9078488 View commit details
    Browse the repository at this point in the history
  12. remove "safeToggle"

    the debouncing patch for toggleLowAccuracy is no longer needed!
    Abby Wheelis committed Sep 14, 2023
    Configuration menu
    Copy the full SHA
    e02db4a View commit details
    Browse the repository at this point in the history
  13. prevent "missing argument errors"

    since these arguments are optional, and we render based on their existence, set the default to undefined
    Abby Wheelis committed Sep 14, 2023
    Configuration menu
    Copy the full SHA
    d55760f View commit details
    Browse the repository at this point in the history
  14. remove safe toggle code

    no longer need to debounce, so no need to keep code around
    Abby Wheelis committed Sep 14, 2023
    Configuration menu
    Copy the full SHA
    2cb1145 View commit details
    Browse the repository at this point in the history
  15. isolate forceSync code to ControlSyncHelper

    to start decluttering `ProfileSettings` move the component to the ControlSyncHelper then import it into `Profile Settings` by exporting a component, we can wrap the popups and their states into one place
    Abby Wheelis committed Sep 14, 2023
    Configuration menu
    Copy the full SHA
    1189700 View commit details
    Browse the repository at this point in the history
  16. don't store a duplicate copy of the collectConfig

    this was one way I attempted to control the ControlSettings, but moved to set/get from a central location (plugin) for one-off changes (toggles) and using the local config, and saving once, when editing with the settings editor modal
    Abby Wheelis committed Sep 14, 2023
    Configuration menu
    Copy the full SHA
    df78758 View commit details
    Browse the repository at this point in the history

Commits on Sep 15, 2023

  1. fix segmentDaysByWeeks

    if we had dates for the 1st through 15th (15 days), this function would mistakenly return the 8th through 14th and the 1st through 7th.
    
    We actually want the 9th through 15th and the 2nd throgh 8th, because it should be relative to the most recent day.
    
    To fix this we iterate over the days backwards, not forwards. With this approach we also don't have to reverse the weeks when we return them because they are already with the most recent first.
    JGreenlee committed Sep 15, 2023
    Configuration menu
    Copy the full SHA
    fe2dd55 View commit details
    Browse the repository at this point in the history
  2. use custom labels

    we had figured out that there were some differences e-mission/e-mission-docs#961 (comment)
    
    Eventually, we realized this was because the new dashboard was not using the custom labels.
    
    This commit adds the methods that check to see if the labels are custom or sensed to `metricsHelper`, checks for custom labels and indicates the need for custom footprint mappings in `CarbonFootprintCard` and the finally reverts back to "rich modes" rather than "base modes" in `metrics-factory` so we use the custom labels
    Abby Wheelis committed Sep 15, 2023
    Configuration menu
    Copy the full SHA
    f57603c View commit details
    Browse the repository at this point in the history
  3. Merge branch 'dashboard-rewrite' of https://github.com/JGreenlee/e-mi…

    …ssion-phone into dashboard-rewrite
    Abby Wheelis committed Sep 15, 2023
    Configuration menu
    Copy the full SHA
    f9822c5 View commit details
    Browse the repository at this point in the history
  4. carbon chart: fix border of green, 'low' emissions

    this hardcoded value caused the returned color to be the same for both the bar background and the border. The darkening should be based on the parameter allowing the border to use a darkened green while the background is not darkened.
    JGreenlee committed Sep 15, 2023
    Configuration menu
    Copy the full SHA
    388b5d7 View commit details
    Browse the repository at this point in the history
  5. add slight borderRadius to Charts

    This gives the bar charts a slightly softer feel, more in line with the rest of the UI which is pretty rounded off everywhere.
    JGreenlee committed Sep 15, 2023
    Configuration menu
    Copy the full SHA
    44753f6 View commit details
    Browse the repository at this point in the history
  6. reorder goal lines + adjust colors

    If the scale of the graph is too large, the 2030 and 2050 guidelines labels might overlap. In that case, we should show the 2030 label on top.
    
    Also, the colors are kind of hard to see with the bars having their new gradient color scheme. So for the colors of the lines, let's just darken the yellow, and bump up the saturation of both.
    JGreenlee committed Sep 15, 2023
    Configuration menu
    Copy the full SHA
    9cad0ee View commit details
    Browse the repository at this point in the history
  7. fix group text

    found a bug where the text for the group was being calculated off of user metrics!
    Abby Wheelis committed Sep 15, 2023
    Configuration menu
    Copy the full SHA
    c2c656c View commit details
    Browse the repository at this point in the history
  8. only show metrics for whole weeks

    to avoid showing metrics for partial weeks, check the length before displaying.
    Abby Wheelis committed Sep 15, 2023
    Configuration menu
    Copy the full SHA
    dd126a7 View commit details
    Browse the repository at this point in the history
  9. move functions into helpers

    moving endForceSync and forceTransition into their respective helpers
    Abby Wheelis committed Sep 15, 2023
    Configuration menu
    Copy the full SHA
    1551eee View commit details
    Browse the repository at this point in the history
  10. restore log statement

    Abby Wheelis committed Sep 15, 2023
    Configuration menu
    Copy the full SHA
    1cfb190 View commit details
    Browse the repository at this point in the history
  11. fetch DB before updating

    Abby Wheelis committed Sep 15, 2023
    Configuration menu
    Copy the full SHA
    f012973 View commit details
    Browse the repository at this point in the history

Commits on Sep 18, 2023

  1. move sync rows to devZone

    Abby Wheelis committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    c46e2dc View commit details
    Browse the repository at this point in the history
  2. move from .then to await

    for consistency and readability, re-writing the forceSync to rely on await rather than chained .then statements
    Abby Wheelis committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    7f8ff42 View commit details
    Browse the repository at this point in the history
  3. endTripForceSync using await

    for readability, switch from chained .then statements to using await calls
    Abby Wheelis committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    2876872 View commit details
    Browse the repository at this point in the history
  4. "taxi" -> "worst case"

    Abby Wheelis committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    de20d3b View commit details
    Browse the repository at this point in the history
  5. remove calorie keys

    we've moved away from showing "calories burned in active travel" and started to show "minutes spent in active travel" Therefore, we no longer need the keys about calories, calibrating to user date (already left profile) or comparing the calories to food.
    Abby Wheelis committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    8f5fb89 View commit details
    Browse the repository at this point in the history

Commits on Sep 19, 2023

  1. Merge remote-tracking branch 'upstream/label_dashboard_profile_sept_2…

    …023' into dashboard-rewrite
    Abby Wheelis committed Sep 19, 2023
    Configuration menu
    Copy the full SHA
    edd8624 View commit details
    Browse the repository at this point in the history

Commits on Sep 25, 2023

  1. Configuration menu
    Copy the full SHA
    ab26e18 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #1029 from Abby-Wheelis/unblock-routing

    Profile changes to unblock routing
    shankari authored Sep 25, 2023
    Configuration menu
    Copy the full SHA
    e93059f View commit details
    Browse the repository at this point in the history
  3. Merge branch 'dashboard-rewrite' of https://github.com/JGreenlee/e-mi…

    …ssion-phone into dashboard-rewrite
    Abby Wheelis committed Sep 25, 2023
    Configuration menu
    Copy the full SHA
    da20511 View commit details
    Browse the repository at this point in the history
  4. Merge upstream, resolved main.js

    also tested this code by running in emulator to ensure no errors
    Abby Wheelis committed Sep 25, 2023
    Configuration menu
    Copy the full SHA
    4cc97db View commit details
    Browse the repository at this point in the history
  5. update comments about prev vs past week

    since we have room in the code, clarify what we mean by referencing "how many days ago" the calculations cover
    Abby Wheelis committed Sep 25, 2023
    Configuration menu
    Copy the full SHA
    8c6bdb2 View commit details
    Browse the repository at this point in the history
  6. not >= 7 day weeks, == 7 day weeks

    Abby Wheelis committed Sep 25, 2023
    Configuration menu
    Copy the full SHA
    752674b View commit details
    Browse the repository at this point in the history
  7. update infinity behavior on changeIndicator

    if the change is infinite, show that. If the change is infinite, and infinitely uncertain (-inf/+inf) don't show, and otherwise show the finite range
    Abby Wheelis committed Sep 25, 2023
    Configuration menu
    Copy the full SHA
    bb4fdd0 View commit details
    Browse the repository at this point in the history

Commits on Sep 26, 2023

  1. Merge pull request #1018 from JGreenlee/dashboard-rewrite

    📊 Rewrite of the New Dashboard Tab
    shankari authored Sep 26, 2023
    Configuration menu
    Copy the full SHA
    87b3456 View commit details
    Browse the repository at this point in the history

Commits on Sep 27, 2023

  1. register all ChartJS elements as workaround

    Described in e-mission/e-mission-docs#986 (comment), we have a production-specific error where the needed ChartJS elements are not recognized as being registered.
    Likely an incompatibility between ChartJS and Webpack.
    
    As a workaround, we will register all of the `registerables`. Unfortunately, we will no longer benefit from tree-shaking with this approach.
    JGreenlee committed Sep 27, 2023
    Configuration menu
    Copy the full SHA
    00d808d View commit details
    Browse the repository at this point in the history
  2. Merge pull request #1039 from JGreenlee/chartjs-register-workaround

    Register all ChartJS elements as workaround
    shankari authored Sep 27, 2023
    Configuration menu
    Copy the full SHA
    c190794 View commit details
    Browse the repository at this point in the history

Commits on Sep 28, 2023

  1. fix: handle undetermined state of appstatus checks

    In AppStatusModal, we listen for the value of overallStatus and if it is false, we trigger the permissions popup.
    
    But there is an issue where the AppStatusModal sometimes shows up even if all the checks are green.
    This is because it can take some time for the checks to initialize and return back their value. During this time, we want to have a sort of 'undetermined' state for overallStatus, so that we don't show the popup prematurely.
    
    We'll do this by allowing overallStatus to be either true/false OR undefined. If there are no checks yet, overallStatus will be undefined and we won't show the popup yet. Once the checks are initialized, we'll be able to determine the status and it will return true or false.
    
    For the individual checks themselves, they also need to be able to report an 'undetermined' state. If their statusStates are false by default, and are false before they have actually been determined, then overallStatus will also be false while the check is still ongoing.
    So we should remove the initial 'false' condition from the few checks that had it, allowing the initial to be 'undefined', and when we iterate through the checks, we will explicitly check if `statusState === false` instead of just checking if `!statusState`.
    
    Result of this is that AppStatusModal only shows if any permissions are broken.
    
    Tested by loading the app, with all of the correct permissions, 20 times both before and after the change.
    Before the change, 2 of the attempts resulted in the AppStatusModal incorrectly appearing.
    After the change, the AppStatusModal did not appear on any of the 20 attempts. After this, I disallowed the Location permission and the modal did still appear as expected.
    JGreenlee committed Sep 28, 2023
    Configuration menu
    Copy the full SHA
    8b6c316 View commit details
    Browse the repository at this point in the history
  2. fix blank checkList problem

    on some occasions, the checkList was failing to be initialized. Upon investigation, this turned out to be because platform and osver were "" and 0, respectively. The underlying issue is that they were held in useState, which is updated asyncronously.
    
    useRef is more appropriate here, as the platform and osver only need to be set once, and are not anticipated to change. The access changed, as useRef variables are read and set from "var.current"
    
    Before these changes, roughly 1/3 of the time, the platform and osver were not set yet, and so the checks were not set up as the platform was interpreted as not valid. After the change, the platform and osver are always set properly in time to call createChecklist.
    
    I also updated the useEffect that calls the createChecklist to do so if checkList does not exist or has a length of 0, rather than the else that I had before.
    Abby Wheelis committed Sep 28, 2023
    Configuration menu
    Copy the full SHA
    8e061a0 View commit details
    Browse the repository at this point in the history
  3. export modeColors so it can be used in tests

    Something I noticed while adding new tests - modeColors is used in diaryHelper.test.ts, but it isn't exported from diaryHelper.ts. I think this was due to a bad merge conflict.
    Simply exporting it fixes the tests, so I'm just going to bundle in that fix here.
    JGreenlee committed Sep 28, 2023
    Configuration menu
    Copy the full SHA
    faaeda6 View commit details
    Browse the repository at this point in the history
  4. fix toggle issue - remove cch

    I forgot to remove cch from one place in this file when I translated it from it's former angular version, which was causing the problem with android devices and the medium accuracy toggle
    
    While here, resolve the syntax highlighting related to window.cordova by replacing it with window['cordova'], not fixing this syntax in the first place likely contributed to me overlooking this error.
    Abby Wheelis committed Sep 28, 2023
    Configuration menu
    Copy the full SHA
    e5b2834 View commit details
    Browse the repository at this point in the history
  5. Merge pull request #1041 from JGreenlee/fix-appstatus-checks

    Fixes for End of Sept RC
    shankari authored Sep 28, 2023
    Configuration menu
    Copy the full SHA
    0f7caef View commit details
    Browse the repository at this point in the history