Skip to content

Peaks label - margin top should be managed in percentage. #4039

@tpoisseau

Description

@tpoisseau

This fields seems to be in pixels so we should remove the cap (even allow for negative value maybe ?)

But I think for proper display, with nmrium file sharing. This kind of offset should be stored in percentage (relative) instead pixels (absolute).
Also I wonder if drag-n-drop if peaks label should save per-spectra the offset in the view of the state.

Originally posted by @tpoisseau in #4015

  1. workspace migration to reset the value to 0 (%). A migration context cannot guess the height available so reset to 0 seems to best the best to do.
  2. Add tsdoc to the property to explicit allowed interval ([0; 100] or [0; 1])
  3. adapt the form. Cap the value in [0; 100] interval. (convert the interval if needed with zod codec)

Today. drag n drop the labels don't change the value in workspace, check if it is serialized / stored somewhere else, If not I suppose drag n drop should update the workspace. If it is serialized / stored somewhere else (like the view), also migrate to percentage and ensure it is serialized in the state (file-sharing).

The idea is peaks label offset should look to the same position on loading a state and responsive to different screen sizes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions