Skip to content

Fix ios autofocus in drawer + introduce randomUUID fallback for local dev - #42

Merged
Matia-R merged 1 commit into
mainfrom
fix/ios-drawer-autofocus-keyboard
Aug 12, 2026
Merged

Fix ios autofocus in drawer + introduce randomUUID fallback for local dev#42
Matia-R merged 1 commit into
mainfrom
fix/ios-drawer-autofocus-keyboard

Conversation

@Matia-R

@Matia-RMatia-R commented Aug 12, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features

    • Mobile drawer fields now open with immediate focus during the same user interaction.
    • Mobile document title editing provides more reliable keyboard input behavior.
    • Document and avatar identifiers now generate reliably across supported browser environments.
  • Documentation

    • Updated mobile drawer guidance with recommended synchronous focus patterns and examples of approaches to avoid.

@vercel

vercelBot commented Aug 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentActionsUpdated (UTC)
chptrReadyReadyPreviewAug 12, 2026 7:29pm

@coderabbitai

coderabbitaiBot commented Aug 12, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 25f79e15-2038-45bd-9596-cc85777c6bbc

📥 Commits

Reviewing files that changed from the base of the PR and between 679dcd5 and a2158b7.

📒 Files selected for processing (13)
  • .cursor/rules/mobile-drawer-menus.mdc
  • src/app/_components/app-sidebar.tsx
  • src/app/_components/command-menu.tsx
  • src/app/_components/document-breadcrumb.tsx
  • src/app/_components/mobile-drawer/index.ts
  • src/app/_components/mobile-drawer/mobile-drawer-field-view.tsx
  • src/app/_components/mobile-drawer/use-mobile-drawer-stage.ts
  • src/app/_components/mobile-drawer/utils.ts
  • src/app/_components/welcome-client.tsx
  • src/app/documents/page.tsx
  • src/hooks/use-collaborative-doc-crdt.ts
  • src/lib/avatar-schema.ts
  • src/lib/utils.ts

Walkthrough

The PR adds a shared UUID generator with a secure fallback and updates identifier creation sites. It also synchronizes mobile drawer keyboard-view mounting and input focus for iOS gesture requirements.

Changes

Mobile drawer focus

Layer / File(s)Summary
Synchronous drawer state updates
src/app/_components/mobile-drawer/*
Keyboard-view navigation and controlled drawer opening now flush state updates synchronously.
Gesture-bound field focus
src/app/_components/document-breadcrumb.tsx, src/app/_components/mobile-drawer/mobile-drawer-field-view.tsx
Drawer fields focus in a layout effect. Mobile title editing opens the drawer synchronously and focuses the title input.
Mobile drawer implementation guidance
.cursor/rules/mobile-drawer-menus.mdc
The guidance defines same-gesture autofocus patterns and prohibits deferred focus patterns.

UUID generation

Layer / File(s)Summary
UUID utility and fallback
src/lib/utils.ts
randomUUID uses crypto.randomUUID or a secure version 4 UUID fallback.
Identifier generation migration
src/app/_components/app-sidebar.tsx, src/app/_components/command-menu.tsx, src/app/_components/welcome-client.tsx, src/app/documents/page.tsx, src/hooks/use-collaborative-doc-crdt.ts, src/lib/avatar-schema.ts
Document IDs, client IDs, and avatar paths now use the shared utility.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Poem

A rabbit taps the drawer just right,
Fields appear in gesture light.
UUIDs hop through every page,
Secure fallback guards the stage.
Synchronous focus, quick and neat—
“Good changes!” thumps my cotton feet.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 50.00% which is insufficient. The required threshold is 80.00%.Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title clearly summarizes both primary changes: the iOS drawer autofocus fix and the randomUUID fallback.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ios-drawer-autofocus-keyboard

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

Comment @coderabbitai help to get the list of available commands.

@Matia-R
Matia-R merged commit cd2f1fc into mainAug 12, 2026
2 of 3 checks passed
Sign up for freeto 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.

1 participant

@Matia-R