Skip to content

Conversation

@datenreisender
Copy link
Contributor

In b2352a7 some wrong types are corrected.

After that several things are renamed and documentation is adjusted. Hoping this makes it more clear when we look at this code again. :-)

@datenreisender datenreisender added doc not required All PRs either need "doc required" or "doc not required". ui not required All PRs either need "ui required" or "ui not required". labels Oct 22, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors type names and documentation related to bit state handling to improve code clarity. The changes correct type usage where BitState (a 2-bit value) was confused with ChartLineValue (rendering coordinates), and renames functions and variables for better semantic meaning.

Key changes:

  • Renamed BitStateType enum to ChartLineValue and replaced BitStateIndexType with a new BitState type alias
  • Renamed averagedBitState() to getSingleBitState() and updated its documentation with clearer examples
  • Renamed variables for clarity (e.g., accumulatoraccumulatedBitStates, stateToIndexchartLineToBitState)

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/utils/bitConversion.ts Updates function/variable names and documentation; changes type references from BitStateType/BitStateIndexType to ChartLineValue/BitState
src/components/Chart/data/dataTypes.ts Replaces BitStateIndexType type and BitStateType enum with BitState type and ChartLineValue enum; removes unused type guard function
src/components/Chart/data/dataAccumulator.ts Updates type imports and renames stateToIndex function to chartLineToBitState
src/components/Chart/data/bitDataStorage.ts Updates type references from BitStateType to BitState in interface definitions
src/components/Chart/data/bitDataSelector.ts Renames function call from averagedBitState to getSingleBitState
src/components/Chart/data/bitDataAccumulator.ts Renames accumulator to accumulatedBitStates and updates type/function references
src/actions/exportChartAction.ts Renames function call from averagedBitState to getSingleBitState

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

And also describe the different values of BitState where the type is
defined, not at the function averagedBitState.
The old name sounded like it calculated an average, but it just
extracted the single bit state from a 16-bit value.
@datenreisender datenreisender merged commit 18506e8 into main Oct 22, 2025
3 checks passed
@datenreisender datenreisender deleted the push-ptommrokmryx branch October 22, 2025 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc not required All PRs either need "doc required" or "doc not required". ui not required All PRs either need "ui required" or "ui not required".

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants