Skip to content

fix: trap keyboard focus within onboarding dialog - #885

Open
karthikeya20012007 wants to merge 5 commits into
magic-peach:mainfrom
karthikeya20012007:fix/onboarding-focus-trap
Open

fix: trap keyboard focus within onboarding dialog#885
karthikeya20012007 wants to merge 5 commits into
magic-peach:mainfrom
karthikeya20012007:fix/onboarding-focus-trap

Conversation

@karthikeya20012007

Copy link
Copy Markdown
Contributor

Description

Fixes an accessibility issue where keyboard focus could escape the onboarding dialog while the tour was active.

Added FocusTrap to keep keyboard navigation contained within the onboarding modal and preserved existing dismissal/navigation behavior.

Related Issue

Closes #878

Type of Contribution

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

Participant Info

  • GitHub username: karthikeya20012007
  • Contribution level (Beginner/Intermediate/Advanced): Intermediate

Screen Recording

Recording / Loom link:

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)

@vercel

vercel Bot commented May 21, 2026

Copy link
Copy Markdown

@karthikeya20012007 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 github-actions Bot added level:intermediate Intermediate level - 35 pts type:bug Bug fix type:design UI/UX design labels May 21, 2026
@github-actions

github-actions Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor

✅ PR Format Check Passed — @karthikeya20012007

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 github-actions Bot added type:docs Documentation type:feature New feature labels May 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

👋 Thanks for your PR, @karthikeya20012007!

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 the gssoc'26 GirlScript Summer of Code 2026 label May 21, 2026
@magic-peach magic-peach added type:accessibility Accessibility and removed type:feature New feature type:docs Documentation labels May 23, 2026
@magic-peach

Copy link
Copy Markdown
Owner

Hey @karthikeya20012007! Thanks for fixing keyboard focus trapping in the onboarding dialog — this is an important accessibility fix.

This PR currently has merge conflicts with main. Please rebase:

git fetch origin
git rebase origin/main
# resolve any conflicts
git push --force-with-lease origin <your-branch>

Once rebased and CI passes, I'll review and merge this.

@magic-peach magic-peach removed the type:design UI/UX design label May 23, 2026
@github-actions github-actions Bot added type:design UI/UX design type:docs Documentation type:feature New feature labels May 23, 2026
@magic-peach

Copy link
Copy Markdown
Owner

Hey @karthikeya20012007! This PR had a merge conflict with `main` due to a concurrent refactor of `OnboardingTour.tsx` — I've resolved it automatically and pushed the result.

Here's what was merged:

  • `src/components/OnboardingTour.tsx`: kept both your `FocusTrap` wrapper (the core change of this PR) and main's `currentStep` variable refactoring. The `Tooltip` now uses `currentStep` (from main) instead of `TOUR_STEPS[stepIndex]!` — functionally identical but cleaner.

CI has been re-triggered. The focus trap implementation looks correct — `focus-trap-react` is already in `package.json` and this is a solid accessibility improvement.

@karthikeya20012007

Copy link
Copy Markdown
Contributor Author

Thanks for resolving the conflicts and integrating the refactor changes. I appreciate the review and the detailed explanation!

@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

@karthikeya20012007 This PR has merge conflicts with main in src/components/OnboardingTour.tsx. The conflicts involve multiple functional changes on both sides (your FocusTrap addition and main's improved retry logic + requestAnimationFrame-based scroll/resize tracking).

Please rebase your branch on the latest main and resolve the conflicts:

git fetch upstream
git rebase upstream/main
# For each conflict in src/components/OnboardingTour.tsx:
# - Keep your FocusTrap wrapper in the return statement
# - Keep main's tryMeasure retry logic (the retryCount/retryTimer approach)
# - Keep main's remeasure with requestAnimationFrame + scroll listener
# Then:
git add src/components/OnboardingTour.tsx
git rebase --continue
git push --force-with-lease origin fix/onboarding-focus-trap

Once rebased and CI passes, this will be merged quickly!

@github-actions github-actions Bot added level:advanced Advanced level - 55 pts type:design UI/UX design type:docs Documentation type:feature New feature labels May 24, 2026
@karthikeya20012007

Copy link
Copy Markdown
Contributor Author

Hi @magic-peach, just following up — I synced the branch with the latest upstream changes and resolved the remaining merge conflicts locally. The branch should now be up to date on my side. Please let me know if any additional changes are needed from me.

@karthikeya20012007

Copy link
Copy Markdown
Contributor Author

Hi @magic-peach, just following up — I synced the branch with the latest upstream changes and resolved the remaining merge conflicts locally. The branch should now be up to date on my side.

@magic-peach

Copy link
Copy Markdown
Owner

Hi @karthikeya20012007 — good news and a small ask.

Your PR passed review in our backlog cleanup and was queued to merge. We merged 38 PRs today, and yours now conflicts with main purely because of that — several of them touched the same files. Nothing is wrong with your change.

To land it:

git fetch origin
git rebase origin/main
# resolve conflicts
git push --force-with-lease

Ping me here once it's green and I'll merge it straight away — it's already approved on our side, so it won't go back into the queue. Thanks for your patience with how long this sat 🙏

@magic-peach magic-peach added the merge-ready PR is approved and ready to merge label Aug 14, 2026
karthikeya20012007 and others added 4 commits August 16, 2026 13:46
…agic-peach#892)

When speed is zero or negative, the while loop dividing remaining by
0.5 never converges: 0 / 0.5 == 0, causing an infinite loop that
blocks the browser thread entirely.

Return an empty filter string immediately for any speed <= 0, which
is consistent with the existing behavior of omitting atempo filters
when no adjustment is needed.

Closes magic-peach#862
…N dimensions (magic-peach#894)

NaN comparisons (NaN < 16, NaN > 7680) always evaluate to false, so a
customWidth or customHeight that is NaN passes all boundary checks and
validateRecipe returns null (no error). The NaN then propagates to the
FFmpeg scale filter as scale=NaN:NaN, crashing the export immediately.

Two fixes applied:

1. validateRecipe: prefix each custom-dimension check with Number.isNaN()
   so a NaN value is caught as a validation error before any comparison.

2. Legacy localStorage parser: replace bare nullish-coalescing on
   parsed.customWidth/customHeight with a sanitizeDimension helper that
   calls Number.isFinite() and enforces the [16, 7680] range. Any
   corrupted, non-numeric, or out-of-range stored value falls back to the
   previous safe default instead of being merged into state as NaN.

Closes magic-peach#864
@karthikeya20012007
karthikeya20012007 force-pushed the fix/onboarding-focus-trap branch from 2388541 to 79c7bfd Compare August 16, 2026 08:34
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:advanced Advanced level - 55 pts level:intermediate Intermediate level - 35 pts merge-ready PR is approved and ready to merge type:accessibility Accessibility 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.

OnboardingTour dialog does not trap keyboard focus

4 participants