Skip to content

Refactor Variable and Group Dialogs: Remove Add Dialogs, Apply Edit Restrictions, and Apply the new AppDialog #1215

@Shraddha0903

Description

@Shraddha0903

What are you missing?

Currently, the experiment setup flow includes two separate dialogs each for variables and groups:

  • One for adding
  • One for editing

The "add" dialogs are redundant after the initial setup and don't align with how users interact with experiment data in later stages. In addition, these dialogs use an outdated dialog component instead of the new shared AppDialog component.

Why do you need a solution?

  1. Redundancy & Maintenance Overhead
    Maintaining two similar dialogs (add + edit) creates duplication in UI code and logic.

  2. Inconsistent UX
    Users must learn two different dialogs, even though the actions are conceptually similar. This breaks flow, especially once variables or groups are already in use.

  3. Missing Restriction Logic
    The current edit dialogs do not handle important restrictions like:

  • Preventing deletion of used variables/groups
  • Locking variable type if already used
  • Allowing only safe edits (e.g., renaming, adding levels)
  1. Component Inconsistency
    The dialogs still rely on a legacy implementation and haven’t been migrated to the reusable AppDialog component, which offers a cleaner layout and consistent header/footer behaviour.

Ideas

  1. Remove Add Dialogs
  • Eliminate the standalone "Add Variable" and "Add Group" dialogs.
  • After initial creation, only the unified edit dialogs are used.
  1. Create a Unified Edit Dialog per Entity

EditExpVariablesDialog and EditExpGroupsDialog support:

  • Adding new entries
  • Editing existing entries with appropriate restrictions
  • Deleting unused groups (but not variables)
  1. Apply Restriction Rules

Variables:

  • If used in groups: only rename, and add levels
  • Type locked; no deletion or level removal

Groups:

  • If used in samples: only rename
  • Condition and replicate count editable only if unused
  • Only unused groups can be deleted
  1. Add Visual Feedback

Lock icon (🔒) with tooltip on restricted fields (e.g., unit, level removal, condition)

  1. Migrate to AppDialog
  • Refactor both dialogs to use the new shared AppDialog component
  • Use consistent dialog headers, footers, and spacing

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    In Progress

    Status

    No status

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions