refactor: unused code after migration from nextui#3900
Closed
billybonks wants to merge 2 commits intopromptfoo:mainfrom
Closed
refactor: unused code after migration from nextui#3900billybonks wants to merge 2 commits intopromptfoo:mainfrom
billybonks wants to merge 2 commits intopromptfoo:mainfrom
Conversation
as far as i can see none fo this code is being used preloaded data was orginally used using what is now known as fetchId 2 years ago 4ebb21d recentEvals is now loaded using fetchRecentEvals defaultEvalId is now being set during one of the load sequances I also cant see where this component is being used outside of src/app/src/pages/eval/page.tsx
Contributor
Reviewer's GuideThis PR refactors the Sequence Diagram: Eval Component Initialization Flow After RefactorsequenceDiagram
participant E as EvalComponent
Note over E: Component Initialization Sequence
alt fetchId prop is provided
E->>E: Initialize: Fetch data using fetchId
else IS_RUNNING_LOCALLY is true
E->>E: Initialize: Connect to local server websocket
else No fetchId and not running locally
E->>E: Initialize: Fetch recent file evaluations
end
Note over E: The initialization path using the 'preloadedData' prop has been removed.
Class Diagram: Changes to EvalOptions Interface and Eval ComponentclassDiagram
class EvalOptions {
<<Interface>>
+fetchId: string | null
}
note for EvalOptions "Removed optional props:\n- preloadedData: SharedResults\n- recentEvals: ResultLightweightWithLabel[]\n- defaultEvalId: string"
class Eval {
<<FunctionComponent>>
+props: EvalOptions
-state recentEvals: ResultLightweightWithLabel[]
-state defaultEvalId: string
+useEffect_initialization(): void
}
note for Eval "Props are now defined by the simplified EvalOptions.\nState 'recentEvals' initialization changed (e.g., from 'recentEvalsProp || []' to '[]').\nState 'defaultEvalId' initialization changed (e.g., from 'defaultEvalIdProp || ...' to '').\nuseEffect_initialization() logic simplified by removing the 'preloadedData' handling branch."
Eval ..> EvalOptions : "props defined by"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
Contributor
also return from hook is meant to be cleanup
Contributor
Author
|
this is the target #3902 |
Member
|
Thanks for the contribution! The refactoring goals here have been achieved through other changes in main. Closing as stale. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Exploring refactoring this code as commented in #3825, after the migration nextui -> react + 8months of coding caused all this code to exist even though its not used. #1637
Best thing to do is to delete and move on. if it is used please let me know how and close this pr
preloaded data was originally used using what is now known as fetchId 2 years ago 4ebb21d
recentEvals is now loaded using fetchRecentEvals
defaultEvalId is now being set during one of the load sequances
I also cant see where this component is being used outside of
src/app/src/pages/eval/page.tsxSummary by Sourcery
Remove unused and deprecated code related to preloaded data and eval initialization from the Eval component
Enhancements:
Chores: