Skip to content

Parameters new design#4040

Merged
thangqp merged 15 commits into
mainfrom
parameters-new-design
Jul 6, 2026
Merged

Parameters new design#4040
thangqp merged 15 commits into
mainfrom
parameters-new-design

Conversation

@khouadrired

Copy link
Copy Markdown
Contributor

use new Parameters Layout
refactor State Estimation Params

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The 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 ParameterLayout with reset and validation handlers.

Changes

Parameters Layout Refactor

Layer / File(s) Summary
Shared tab and pane style updates
src/components/dialogs/parameters/util/styles.ts, src/components/utils/tab-utils.ts, src/components/results/common/glass-pane.tsx
scrollableGrid drops maxHeight and gains padding with flexGrow; tabStyles adds menuSelect, updates listDisplay height, and changes contentBox to a flex column with narrower padding; GlassPane now wraps its content in a Box and accepts sx.
Responsive parameters tab navigation
src/components/parameters-tabs.tsx
ParametersTabs adds container-width measurement with useContainerXs, builds shared tabOptions for both Select and Tabs, conditionally renders developer tabs, wraps content in ParameterLayoutProvider, and changes the StateEstimation tab disabled condition.
State estimation tab panel extraction
src/components/dialogs/parameters/state-estimation/state-estimation-parameters-form.tsx, src/components/dialogs/parameters/state-estimation/state-estimation-general-parameters.tsx
StateEstimationParametersForm introduces a typed props contract and renders the localized tab header plus four TabPanel sections, using tab error state to compute tab indicator and tab styles; StateEstimationGeneralParameters is wrapped in a grid container and inner grid column.
State estimation dialog layout wiring
src/components/dialogs/parameters/state-estimation/state-estimation-parameters.tsx
StateEstimationParameters removes local reset-confirmation state and in-file tab/footer composition, updates form typing and callbacks, and renders StateEstimationParametersForm inside ParameterLayout with reset and validate handlers.

Suggested reviewers

Suggested reviewers: TheMaskedTurtle

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is relevant but too vague to clearly describe the main change. Rename it to mention the new Parameters Layout and State Estimation parameter refactor.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description is related to the changeset and mentions the new Parameters Layout and State Estimation refactor.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
src/components/results/common/glass-pane.tsx (1)

34-34: ⚡ Quick win

Use MUI's SxProps<Theme> type instead of any for better type safety.

The sx prop should be typed as SxProps<Theme> from @mui/system to 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 win

Simplify the redundant ternary in orientation prop.

Since this Tabs component is only rendered when isXsScreen is false (inside the else block starting at line 592), the ternary expression orientation={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

📥 Commits

Reviewing files that changed from the base of the PR and between 9611910 and c86e337.

📒 Files selected for processing (5)
  • src/components/dialogs/parameters/state-estimation/state-estimation-parameters.tsx
  • src/components/dialogs/parameters/util/styles.ts
  • src/components/parameters-tabs.tsx
  • src/components/results/common/glass-pane.tsx
  • src/components/utils/tab-utils.ts
💤 Files with no reviewable changes (1)
  • src/components/dialogs/parameters/util/styles.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3f4ffda and 7d67690.

📒 Files selected for processing (3)
  • src/components/dialogs/parameters/state-estimation/state-estimation-parameters-form.tsx
  • src/components/dialogs/parameters/state-estimation/state-estimation-parameters.tsx
  • src/components/parameters-tabs.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/parameters-tabs.tsx

Comment on lines 89 to 92
const clear = useCallback(() => {
resetStateEstimationParameters();
onValidationError();
setOpenResetConfirmation(false);
}, [resetStateEstimationParameters, onValidationError]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 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.

Comment thread src/components/results/common/glass-pane.tsx Outdated
thangqp added 3 commits July 3, 2026 19:30
Signed-off-by: Thang PHAM <phamthang37@gmail.com>
Signed-off-by: Thang PHAM <phamthang37@gmail.com>
Signed-off-by: Thang PHAM <phamthang37@gmail.com>
Comment thread src/components/parameters-tabs.tsx
thangqp and others added 4 commits July 6, 2026 14:24
Signed-off-by: Thang PHAM <phamthang37@gmail.com>
Signed-off-by: Thang PHAM <phamthang37@gmail.com>
Signed-off-by: Thang PHAM <phamthang37@gmail.com>
@sonarqubecloud

sonarqubecloud Bot commented Jul 6, 2026

Copy link
Copy Markdown

@thangqp thangqp merged commit ec22c8a into main Jul 6, 2026
6 checks passed
@thangqp thangqp deleted the parameters-new-design branch July 6, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants