Skip to content

fix: prevent trim end input from stripping decimal points while typing#907

Open
Nightcoder-26 wants to merge 5 commits into
magic-peach:mainfrom
Nightcoder-26:fix-trim-end-decimal-bug
Open

fix: prevent trim end input from stripping decimal points while typing#907
Nightcoder-26 wants to merge 5 commits into
magic-peach:mainfrom
Nightcoder-26:fix-trim-end-decimal-bug

Conversation

@Nightcoder-26
Copy link
Copy Markdown

@Nightcoder-26 Nightcoder-26 commented May 22, 2026

Description

Fixes a bug where typing a decimal point in the Trim End input field would immediately strip the decimal, making it impossible to type values like 1.5 manually.
Previously, the Trim End input field bound its value directly to recipe.trimEnd. Because trimEnd is stored as a parsed float, typing a decimal point (e.g., 1.) caused the trailing decimal to be immediately stripped by parseFloat during the React re-render.

Fix: Introduced a local endInput state variable for the Trim End input, mirroring the existing architecture used for the startInput field. This acts as an intermediary text state, allowing users to type decimals naturally while keeping the underlying recipe state synchronized.

Related Issue

fixes #904

Type of Contribution

  • Bug fix
  • New feature
  • Documentation update
  • GSSoC contribution

Participant Info

  • GitHub username: Nightcoder-26
  • Contribution level (Beginner/Intermediate/Advanced): Intermediate

Screen Recording

Recording.2026-05-22.125056.mov

Checklist

  • I have read the contribution guidelines
  • My changes follow the project structure
  • I have tested my changes in Chrome, Firefox, and Safari
  • bun run lint passes (no ESLint errors)
  • bunx tsc --noEmit passes (no TypeScript errors)
  • New interactive elements have aria-label / accessible names
  • No console.log statements left in
  • This PR is related to a valid issue
  • Screen recording attached above (required for UI/feature/design changes)

The Trim End input field previously bound its value directly to 'recipe.trimEnd'. Because 'trimEnd' is stored as a parsed float, typing a decimal point (e.g. '1.') caused the trailing decimal to be immediately stripped by parseFloat during the change handler, making it impossible to type decimal values manually.

Fix: Introduce a local 'endInput' state variable for the Trim End input, mirroring the existing architecture used for 'startInput'. This acts as an intermediary text state, allowing users to type decimals naturally while keeping the underlying recipe state synchronized.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 22, 2026

Someone is attempting to deploy a commit to the magic-peach1's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 22, 2026

✅ PR Format Check Passed — @Nightcoder-26

Basic format checks passed. A maintainer will review your code changes.

This does not mean the PR is approved — it just means the format is correct.

@github-actions
Copy link
Copy Markdown
Contributor

👋 Thanks for your PR, @Nightcoder-26!

Welcome to Reframe — a browser-based video editor built for everyone 🎬

🟠 GSSoC'26 PR detected — thanks for contributing under GirlScript Summer of Code 2026!

What happens next

  1. 🤖 Automated checks — build & TypeScript typecheck will run automatically
  2. Vercel preview — a preview deployment will be created (requires maintainer authorization for fork PRs)
  3. 👀 Code review — a maintainer will review your changes
  4. 🚀 Merge — once approved, your PR will be merged!

Quick checklist

  • PR title follows Conventional Commits (e.g. feat: add dark mode)
  • Linked the issue this PR closes (e.g. Closes #123)
  • Tested the changes locally (bun run dev)
  • Build passes (bun run build)

Useful links

Happy coding! 🎉

@github-actions github-actions Bot added level:beginner Beginner level - 20 pts type:bug Bug fix type:design UI/UX design type:docs Documentation type:feature New feature gssoc'26 GirlScript Summer of Code 2026 labels May 22, 2026
@Nightcoder-26
Copy link
Copy Markdown
Author

@magic-peach kindly review the PR and merge it

# Conflicts:
#	src/components/TrimControl.tsx
@Nightcoder-26
Copy link
Copy Markdown
Author

@magic-peach please review it and merge or close it, if you want me to any changes kindly mention that i am happy to work accordingly

@magic-peach magic-peach removed type:feature New feature type:docs Documentation type:design UI/UX design labels May 24, 2026
@magic-peach
Copy link
Copy Markdown
Owner

@Nightcoder-26 The fix looks correct — introducing a local endInput state for the Trim End input mirrors the existing pattern for startInput and prevents the decimal stripping issue.

However, build/lint/typecheck CI hasn't run on this PR. Could you push a minor update to trigger the full CI suite? We need build, lint, and typecheck to pass before merging.

Note: PR #945 also fixes the same endInput bug as part of a broader critical bug fix PR — if that gets merged first, you'd need to rebase. But both address valid issues, so we'll handle them in order.

Once CI passes, this will be merged quickly!

@github-actions github-actions Bot added type:design UI/UX design type:docs Documentation type:feature New feature labels May 24, 2026
@github-actions github-actions Bot added the level:intermediate Intermediate level - 35 pts label May 24, 2026
@Nightcoder-26
Copy link
Copy Markdown
Author

Hi! @magic-peach Both follow-up commits are pushed and the local build passes with ✓ Compiled successfully. However, I can see the CI is still blocked by "5 workflows awaiting approval" — this is GitHub's fork protection policy and the workflows cannot start until a maintainer approves them.

Could you please click "Approve and run workflows" in the Checks section of this PR? That single click will unblock all 5 workflows and CI should pass immediately after. 🙏

@Nightcoder-26
Copy link
Copy Markdown
Author

Nightcoder-26 commented May 25, 2026

@magic-peach kindly check the PR and merge it and close it as soon as possible. the issues has been solved please review it humble request
Gentle ping @magic-peach 👋
The workflows are still awaiting approval, so CI hasn't been able to run yet. Once approved, the required checks should execute normally.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc'26 GirlScript Summer of Code 2026 level:beginner Beginner level - 20 pts level:intermediate Intermediate level - 35 pts type:bug Bug fix type:design UI/UX design type:docs Documentation type:feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] : Trim End Decimal Point Input Stripping

2 participants