nmrium icon indicating copy to clipboard operation
nmrium copied to clipboard

feat: migrate form to tanstack & zod

Open Sebastien-Ahkrin opened this issue 2 months ago • 6 comments

Sebastien-Ahkrin avatar Nov 06 '25 09:11 Sebastien-Ahkrin

Deploying nmrium with  Cloudflare Pages  Cloudflare Pages

Latest commit: da0df6b
Status: ✅  Deploy successful!
Preview URL: https://9e7a7db6.nmrium.pages.dev
Branch Preview URL: https://3809-start-using-tanstack-fo.nmrium.pages.dev

View logs

The form now look like that with react-science components :

CleanShot 2025-11-07 at 11 06 21

Sebastien-Ahkrin avatar Nov 07 '25 10:11 Sebastien-Ahkrin

Validation should not accept an empty string.

targos avatar Nov 07 '25 12:11 targos

CleanShot 2025-11-07 at 13 49 38@2x

Layout is not ok, please make sure it looks as nice as before.

stropitek avatar Nov 07 '25 12:11 stropitek

CleanShot 2025-11-07 at 13 57 46

Do you want it to looks like this ?

Sebastien-Ahkrin avatar Nov 07 '25 12:11 Sebastien-Ahkrin

Do you want it to looks like this ?

Not strictly. But the previous layout had a fixed width which made much more sense.

Regarding button color, I don't know on what ground you changed the button color. Ok if it is for consistency reasons, but otherwise keep the original green color.

stropitek avatar Nov 07 '25 13:11 stropitek

@Sebastien-Ahkrin It seems you forgot this PR.

targos avatar Nov 28 '25 12:11 targos

CleanShot 2025-12-01 at 10 21 04

Is this looking better ? @stropitek

Sebastien-Ahkrin avatar Dec 01 '25 09:12 Sebastien-Ahkrin

If we want the label text to not be centered, we have to change the react-science components

Sebastien-Ahkrin avatar Dec 01 '25 09:12 Sebastien-Ahkrin

Why is it centered?

targos avatar Dec 01 '25 09:12 targos

Why is it centered?

NVM its because i use DialogContent, i can change the behavior. its now done

Sebastien-Ahkrin avatar Dec 01 '25 10:12 Sebastien-Ahkrin

DialogContent is centered by default?

targos avatar Dec 01 '25 10:12 targos

DialogContent is centered by default?

yep it looks like that

Sebastien-Ahkrin avatar Dec 01 '25 10:12 Sebastien-Ahkrin

I see that DialogContent is a component defined in this file and only used here. I don't understand why you override the value instead of changing the component directly.

Now I think we should entirely remove this component and just render DialogBody.

targos avatar Dec 01 '25 10:12 targos

Previously, the input element was auto-focused. Now with the refactor it is not anymore.

Probably related to react-science, but I don't think the help message should be red. Only the error message.

Image

Yep, to set the error / text message in other color, i have to change react-science. Same for auto-focus, i should change the behavior in react-science.

Sebastien-Ahkrin avatar Dec 01 '25 13:12 Sebastien-Ahkrin