Parameters new design#4040
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe PR updates shared parameters styling, adds responsive tab selection for the parameters page, extracts the state estimation tab content into a dedicated form component, and rewires the state estimation dialog to use ChangesParameters Layout Refactor
Suggested reviewersSuggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/components/results/common/glass-pane.tsx (1)
34-34: ⚡ Quick winUse MUI's
SxProps<Theme>type instead ofanyfor better type safety.The
sxprop should be typed asSxProps<Theme>from@mui/systemto match MUI's conventions and enable proper type checking.🔧 Suggested type improvement
First, add the import at the top of the file:
+import { SxProps, Theme } from '`@mui/system`';Then update the interface:
interface GlassPaneProps { active: boolean; children: ReactNode; loadingMessageText?: string; - sx?: any; + sx?: SxProps<Theme>; }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/components/results/common/glass-pane.tsx` at line 34, The sx property in the glass-pane.tsx component interface is typed as any, which reduces type safety. Import SxProps and Theme from `@mui/system` at the top of the file, then update the sx property definition to use SxProps<Theme> instead of any. This will enable proper TypeScript type checking and align with MUI conventions for styling props.src/components/parameters-tabs.tsx (1)
605-605: ⚡ Quick winSimplify the redundant ternary in
orientationprop.Since this
Tabscomponent is only rendered whenisXsScreenisfalse(inside theelseblock starting at line 592), the ternary expressionorientation={isXsScreen ? 'horizontal' : 'vertical'}will always evaluate to'vertical'.🧹 Simplification
- orientation={isXsScreen ? 'horizontal' : 'vertical'} + orientation="vertical"🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/components/parameters-tabs.tsx` at line 605, The Tabs component's orientation prop at line 605 contains a redundant ternary expression that always evaluates to 'vertical' because this component is only rendered when isXsScreen is false (inside the else block at line 592). Remove the ternary expression and replace it with just the string 'vertical' as the orientation prop value, since that is the only possible outcome in this conditional rendering context.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/components/parameters-tabs.tsx`:
- Line 605: The Tabs component's orientation prop at line 605 contains a
redundant ternary expression that always evaluates to 'vertical' because this
component is only rendered when isXsScreen is false (inside the else block at
line 592). Remove the ternary expression and replace it with just the string
'vertical' as the orientation prop value, since that is the only possible
outcome in this conditional rendering context.
In `@src/components/results/common/glass-pane.tsx`:
- Line 34: The sx property in the glass-pane.tsx component interface is typed as
any, which reduces type safety. Import SxProps and Theme from `@mui/system` at the
top of the file, then update the sx property definition to use SxProps<Theme>
instead of any. This will enable proper TypeScript type checking and align with
MUI conventions for styling props.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f2a45db2-e761-4ed0-9aca-a261e6f00e9a
📒 Files selected for processing (5)
src/components/dialogs/parameters/state-estimation/state-estimation-parameters.tsxsrc/components/dialogs/parameters/util/styles.tssrc/components/parameters-tabs.tsxsrc/components/results/common/glass-pane.tsxsrc/components/utils/tab-utils.ts
💤 Files with no reviewable changes (1)
- src/components/dialogs/parameters/util/styles.ts
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@src/components/dialogs/parameters/state-estimation/state-estimation-parameters.tsx`:
- Around line 89-92: The clear flow in stateEstimation-parameters.tsx only calls
resetStateEstimationParameters and onValidationError, so the local form state
stays populated and formState.isDirty can remain true. Update the clear callback
and the related reset handler in StateEstimationParameters to also call
reset(...) and synchronize stateEstimationParams back to the default/empty
values, so the form UI and react-hook-form state are fully cleared when
ParameterLayout triggers reset.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: aacf6b14-64db-4a18-8cbb-e6646613d1bd
📒 Files selected for processing (3)
src/components/dialogs/parameters/state-estimation/state-estimation-parameters-form.tsxsrc/components/dialogs/parameters/state-estimation/state-estimation-parameters.tsxsrc/components/parameters-tabs.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- src/components/parameters-tabs.tsx
| const clear = useCallback(() => { | ||
| resetStateEstimationParameters(); | ||
| onValidationError(); | ||
| setOpenResetConfirmation(false); | ||
| }, [resetStateEstimationParameters, onValidationError]); |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Reset no longer clears the form state.
clear() only sends the backend reset and clears tab errors. It never calls reset(...) or updates stateEstimationParams, so the form can stay populated and formState.isDirty can remain true after the user clicks the reset action now wired through ParameterLayout.
Also applies to: 124-125
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@src/components/dialogs/parameters/state-estimation/state-estimation-parameters.tsx`
around lines 89 - 92, The clear flow in stateEstimation-parameters.tsx only
calls resetStateEstimationParameters and onValidationError, so the local form
state stays populated and formState.isDirty can remain true. Update the clear
callback and the related reset handler in StateEstimationParameters to also call
reset(...) and synchronize stateEstimationParams back to the default/empty
values, so the form UI and react-hook-form state are fully cleared when
ParameterLayout triggers reset.
Signed-off-by: Thang PHAM <phamthang37@gmail.com>
Signed-off-by: Thang PHAM <phamthang37@gmail.com>
Signed-off-by: Thang PHAM <phamthang37@gmail.com>
Signed-off-by: Thang PHAM <phamthang37@gmail.com>
Signed-off-by: Thang PHAM <phamthang37@gmail.com>
|



use new Parameters Layout
refactor State Estimation Params