Skip to content

fix(speed): accept a trailing × or x in the custom speed field - #1444

Merged
EtienneLescot merged 1 commit into
getopenscreen:mainfrom
ITx-prash:fix/1441-custom-speed-suffix
Oct 31, 2026
Merged

EtienneLescot merged 1 commit into
getopenscreen:mainfrom
ITx-prash:fix/1441-custom-speed-suffix

Conversation

@ITx-prash

@ITx-prash ITx-prash commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Typing 1.25x or 1.25× into the Custom speed field was rejected and the field reverted. The placeholder is 2× and the zoom field already accepts the suffix, so the two disagreed. The parser now trims the input, converts a comma decimal to a dot, strips one trailing x or ×, and passes the rest to Number().

This regressed in 59df3544 (v1.8.0), which replaced the old character-stripping parser with Number(). Details and the recording are in #1441.

One related change: an empty or suffix-only draft now returns empty instead of too-slow. SpeedControl handles both the same way, so users see no difference. It's needed because stripping a bare x leaves "", and Number("") is 0. Happy to split it out if you prefer.

Related issue

Fixes #1441

Type of change

  • Bug fix
  • Feature
  • Enhancement
  • Documentation
  • Refactor / maintenance
  • Performance
  • Security

Release impact

  • Patch
  • Minor
  • Major / breaking change
  • No release note needed

Desktop impact

  • Windows
  • macOS
  • Linux
  • Installer / packaging
  • Not platform-specific

Screenshots / video

None. The field looks the same before and after. The recording of the bug is in #1441.

Testing

  • New parser tests: accepted suffixes (1.25x, 1.25×, 1.25X, 1,25×, 1.25 x, and a whitespace-padded one), rejected ones (1.25xx, x1.25, 1x2), blank and bare-suffix input, and the 0.25 to 16 bounds after stripping.
  • New component test: typing 1,25× commits 1.25 and clears the field.
  • npx vitest --run src/components/video-editor/customPlaybackSpeed.test.ts src/components/ai-edition/v4/SpeedControl.test.tsx: 29 passed
  • npx tsc --noEmit and npx tsc -p tsconfig.test.json --noEmit: pass
  • npx biome check on the three touched files: clean
  • Full suite not run locally; CI runs it.

Summary by CodeRabbit

  • New Features
    • Playback-speed inputs now accept a trailing “x” or “×” suffix, surrounding whitespace, and comma decimal separators.
  • Bug Fixes
    • Blank inputs and suffix-only entries are handled as empty rather than as speeds below the allowed minimum.

Copilot AI balanced review requested due to automatic review settings October 31, 2026 11:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 71527b83-e104-4727-b2be-1e26a6d0c8fc
Commits

Reviewing files that changed from the base of the PR and between ac65755 and 600141b.

Files selected for processing: 3
  • src/components/ai-edition/v4/SpeedControl.test.tsx
  • src/components/video-editor/customPlaybackSpeed.test.ts
  • src/components/video-editor/customPlaybackSpeed.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Walkthrough

The custom playback speed parser now accepts trailing x and × suffixes, trims whitespace, and converts decimal commas. Tests cover parser results, speed bounds, and committing a suffixed value.

Changes: Custom speed input

Layer / File(s) Summary
Sanitize and validate speed drafts
src/components/video-editor/customPlaybackSpeed.ts, src/components/video-editor/customPlaybackSpeed.test.ts, src/components/ai-edition/v4/SpeedControl.test.tsx
The parser trims whitespace, converts decimal commas, removes one trailing x or ×, and returns empty when no input remains. Tests cover accepted and rejected formats, bounds, and committing 1,25× as 1.25.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: etiennelescot

Merge Risk: Minimal · up to 60014

The change adds multiplier-suffix support to custom speed input. No concrete merge-blocking risk is established; it is mergeable subject to normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title names the fix and the affected field: it makes the custom speed field accept a trailing × or x. The changeset does this in parseCustomPlaybackSpeedInput, and the tests cover the accepted and…
Description check Passed The description follows the repository template. It includes Summary, a Related issue that uses 'Fixes #1441' (the issue is linked and the fix is complete), Type of change (Bug fix checked), Release i…
Linked Issues check Passed [#1441] Requirement: Custom speed must accept a trailing x or × suffix, as the Custom zoom field does. At the reviewed head, parseCustomPlaybackSpeedInput in `src/components/video-editor/customP…
Out of Scope Changes check Passed Whole-PR scope, base f7894518 to head 600141b4. The change touches the parser and its tests, and one component test. Each change serves the #1441 fix. The stripping step adds the suffix support. T…
Full details: Title check

Explanation

The title names the fix and the affected field: it makes the custom speed field accept a trailing × or x. The changeset does this in parseCustomPlaybackSpeedInput, and the tests cover the accepted and rejected suffix forms. The title does not mention the empty/suffix-only return change, which is a secondary part of the diff.

Full details: Description check

Explanation

The description follows the repository template. It includes Summary, a Related issue that uses 'Fixes #1441' (the issue is linked and the fix is complete), Type of change (Bug fix checked), Release impact (Patch checked), Desktop impact (Not platform-specific checked), Screenshots/video (explained, with a link to the recording in #1441), and Testing with commands and results. It also explains the one related behavior change (empty vs too-slow) and why it is needed.

Full details: Linked Issues check

Explanation

[#1441] Requirement: Custom speed must accept a trailing x or × suffix, as the Custom zoom field does. At the reviewed head, parseCustomPlaybackSpeedInput in src/components/video-editor/customPlaybackSpeed.ts trims the draft, converts commas to dots, and removes one trailing /\s*[×x]$/i. It then calls Number() on the remainder. 1.25x, 1.25×, 1.25X, and 1,25× therefore parse to 1.25. Speed bounds are checked after stripping, so suffixed values are bounded like plain values. Inputs that must stay rejected also fail: 1.25xx leaves 1.25x, which gives NaN; x1.25 and 1x2 give NaN. Plain decimal input is unchanged. The summary reports new parser tests and a component test in SpeedControl.test.tsx that types 1,25× and expects a commit of 1.25. I did not read those test files, so this verdict rests on the source code and the reported test results. No coding requirement of #1441 is unmet.

Full details: Out of Scope Changes check

Explanation

Whole-PR scope, base f7894518 to head 600141b4. The change touches the parser and its tests, and one component test. Each change serves the #1441 fix. The stripping step adds the suffix support. The new empty return for blank or bare-suffix drafts follows directly from that step: stripping a bare x leaves "", and Number("") is 0, which would otherwise classify the draft as too-slow. The author states this in the PR description. The change is related to the fix and does not add unrelated behavior. Unverified point: the claim that SpeedControl handles empty and too-slow the same way. I could not read the SpeedControl source. The path src/components/ai-edition/v4/SpeedControl.tsx did not resolve at head. This affects UI behavior, not scope, so it does not change this verdict.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 3 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@EtienneLescot
EtienneLescot merged commit 093569c into getopenscreen:main Oct 31, 2026
20 checks passed
@ITx-prash
ITx-prash deleted the fix/1441-custom-speed-suffix branch October 31, 2026 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Custom speed rejects the "×" suffix that Custom zoom accepts

3 participants