-
Notifications
You must be signed in to change notification settings - Fork 39
Correct and rename types around bit states #563
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
Conversation
There was a problem hiding this 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
BitStateTypeenum toChartLineValueand replacedBitStateIndexTypewith a newBitStatetype alias - Renamed
averagedBitState()togetSingleBitState()and updated its documentation with clearer examples - Renamed variables for clarity (e.g.,
accumulator→accumulatedBitStates,stateToIndex→chartLineToBitState)
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.
f8028e7 to
612b3ef
Compare
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. :-)