Alpha 0.1.10/485 fla refactor#698
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR implements a significant refactoring of the Flight Log Analyser (FLA) module, separating concerns and improving maintainability. The refactoring splits the monolithic FLA component into focused modules, introduces utility functions, and modernizes Redux state management with selectors.
- Split main FLA component into
SelectFlightLogandFlaMainDisplaycomponents for better separation of concerns - Extracted utility functions and constants into dedicated modules for better organization
- Updated Redux slice to use modern selectors pattern instead of direct state access
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| gcs/src/redux/store.js | Updated import path for relocated logAnalyserSlice |
| gcs/src/redux/slices/logAnalyserSlice.js | Added selectors, removed unused setChartData reducer |
| gcs/src/fla.jsx | Major refactoring: extracted components, utilities, and modernized Redux usage |
| gcs/src/components/fla/utils.js | New utility module with extracted helper functions |
| gcs/src/components/fla/constants.js | New constants module for centralized configuration |
| gcs/src/components/SelectFlightLog.jsx | New component for flight log selection interface |
| gcs/src/components/FlaMainDisplay.jsx | New component for main FLA display functionality |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1Blademaster
left a comment
There was a problem hiding this comment.
Please also update all notifications to use the actions in gcs/src/redux/slices/notificationSlice.js
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
1Blademaster
left a comment
There was a problem hiding this comment.
Some more bugs found; talked on discord
* moved constants and utility functions * move redux selectors to logAnalyserSlice * refactor loadFile seems to work fine * added jsdoc style comments to utils * refactored the html * more jsdoc style comments for readability * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix lint error * filter before looping for efficiency * used Math.min instaead of reduce * resolved all PR comments * lint error * further reducing props passed to Fla Main Display * random comment * extra improvements based on feedback from copilot * replacing FileInput + Button with FileButton from mantine * fixed issues with event logs * renaming a variable * updating notifications to use actions from slice * formatting * made all updates * lint * copilot suggestions * Clean up dispatch functions, remove most lodash usage * fixed preset bug * Revert notifications changes --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Kush Makkapati <kush.makkapati@icloud.com>
Main improvements
Separated the jsx into two main files:
SelectFlightLog.jsxfor the initial flight log selection/upload screen.FlaMainDisplay.jsxas the main display component for FLA.Utility and logic enhancements:
fla/utils.js, providing functions for color conversion, GPS/UTC time handling, message filtering, mean/min/max calculations, flight mode extraction, etc.fla/constants.jsto centralize reused configuration, color palettes, and ignored message/field lists.Redux state management:
setChartDatareducer.