Peaks label - margin top should be managed in percentage.
- Dominant language
- TypeScript
- Stars
- 80
- Forks
- 34
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 36
Description
> 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](https://github.com/cheminfo/nmrium/issues/4015#issuecomment-4005325561)_
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.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.