Skip to content

Fix/remove duplicates default recipe#886

Open
rahul-rajak-nsut wants to merge 4 commits into
magic-peach:mainfrom
rahul-rajak-nsut:fix/remove-duplicates-default-recipe
Open

Fix/remove duplicates default recipe#886
rahul-rajak-nsut wants to merge 4 commits into
magic-peach:mainfrom
rahul-rajak-nsut:fix/remove-duplicates-default-recipe

Conversation

@rahul-rajak-nsut
Copy link
Copy Markdown
Contributor

Description

DEFAULT_RECIPE and SPEED_STEPS were defined in both src/lib/types.ts
and src/lib/constants.ts, and the two DEFAULT_RECIPE definitions had
silently diverged. types.ts had contrast:0 and saturation:0 — values
that cause fully grey and greyscale video output via FFmpeg's eq filter.
constants.ts had the correct neutral values (contrast:1, saturation:1).

useKeyboardShortcuts.ts was importing DEFAULT_RECIPE from types.ts
(the wrong source). This PR removes the duplicates from types.ts and
fixes the import to point to constants.ts.

Related Issue

Closes #881

Type of Contribution

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

Participant Info

Screen Recording

Not applicable — no UI or visual changes. Fix is purely in module
imports and type definitions. No component or DOM element was modified.

Changes made

src/lib/types.ts — removed duplicate exports:

  • Removed DEFAULT_RECIPE (was wrong: contrast:0, saturation:0)
  • Removed SPEED_STEPS (already canonical in constants.ts)

src/hooks/useKeyboardShortcuts.ts — fixed import:

  • Before: import { EditRecipe, DEFAULT_RECIPE, ExportStatus } from "@/lib/types"
  • After: import { EditRecipe, ExportStatus } from "@/lib/types"
  •     import { DEFAULT_RECIPE } from "@/lib/constants"
    

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
  • bunx tsc --noEmit passes
  • New interactive elements have aria-label — N/A, no UI changes
  • No console.log statements left in
  • This PR is related to a valid issue
  • Screen recording attached — N/A, no UI/visual changes

- Validate width/height in handleWidthChange and handleHeightChange
- Reject values outside 16–7680 range and NaN before updating state
- Add autoComplete='off' to width and height inputs

Fixes magic-peach#24
…d ratios

Previously, any video that didn't closely match 9:16, 16:9, or 1:1
always fell back to 'vertical-9-16' (portrait), regardless of actual
orientation. A 1440x900 (16:10) landscape video would be suggested a
portrait preset.

Fix the fallback to check width vs height:
- wide videos (width >= height) → 'landscape-16-9'
- tall videos (height < width)  → 'vertical-9-16'

Also updates the test that was encoding the wrong behavior as expected,
and adds coverage for 4:3 and 16:10 landscape/portrait inputs.

Fixes magic-peach#880
…s.ts

DEFAULT_RECIPE was defined in both types.ts and constants.ts with
diverged values. types.ts had contrast:0 and saturation:0, while
constants.ts had the correct neutral values contrast:1 and saturation:1.

FFmpeg's eq filter treats contrast=0 as fully grey and saturation=0
as greyscale, so any reset via the wrong definition would corrupt output.

useKeyboardShortcuts.ts was importing DEFAULT_RECIPE from types.ts
(the broken one). Fixed to import from constants.ts instead.

SPEED_STEPS was also duplicated — removed from types.ts since
constants.ts is the canonical source already used everywhere else.

All 54 tests pass with no regressions.

Fixes #YOUR_ISSUE_NUMBER
@vercel
Copy link
Copy Markdown

vercel Bot commented May 21, 2026

@rahul-rajak-nsut 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

👋 Thanks for your PR, @rahul-rajak-nsut!

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:intermediate Intermediate level - 35 pts gssoc'26 GirlScript Summer of Code 2026 type:bug Bug fix type:design UI/UX design type:docs Documentation type:feature New feature labels May 21, 2026
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ PR Format Issues — @rahul-rajak-nsut

Please fix the following before your PR can be reviewed:

  • ⚠️ Use a conventional PR title. Examples:
    • feat: add dark mode support
    • fix: resolve aria label missing on slider
    • docs: add deployment guide to README

Push new commits after fixing — this comment will update automatically.

📖 CONTRIBUTING.md

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: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] DEFAULT_RECIPE duplicated in types.ts and constants.ts with diverged contrast/saturation defaults — keyboard reset applies wrong values

1 participant