Skip to content

Fix focus behaviour when opening single-purpose pages, and rooms#2349

Merged
ajbura merged 9 commits intocinnyapp:devfrom
GimleLarpes:fix-autofocus
Jun 28, 2025
Merged

Fix focus behaviour when opening single-purpose pages, and rooms#2349
ajbura merged 9 commits intocinnyapp:devfrom
GimleLarpes:fix-autofocus

Conversation

@GimleLarpes
Copy link
Copy Markdown
Contributor

@GimleLarpes GimleLarpes commented Jun 1, 2025

Description

This PR improves focus behaviour as formulated in #2348 when opening pages/popups that have a singular purpose.
It also focuses the message field when opening a room, to more clearly indicate to the user that they can begin typing immediately.

The reasoning for suggesting these changes is primarily that pages where you can only do one thing, should let you do those things in one click (ie. search, creating new DM). Focusing on the message field enables simply entering a room and immediately starting to type (while the user can currently do this, that is not communicated to the user). Not gaining focus on mobile prevents the onscreen keyboard from appearing when it's not wanted (ie. when just reading messages).

This also unifies the UX as CTRL+K search already gains focus automatically.

This PR makes the following changes:

The following always gain focus:

  • "Join with Address"
  • "Message Search" (Spaces and Home)
  • "Create Chat" (new DM, invite to room)

The following gain focus when not on mobile:

  • Room message field

Example videos:

Current:

Desktop-Current-LQ.mp4
Mobile-Current.mp4

After changes:

Desktop-After-LQ.mp4
Mobile-After.mp4

Fixes #2348, Fixes #2261

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • [o] New feature (non-breaking change which adds functionality)
  • [o] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [o] This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 27, 2025

Preview: https://2349--pr-cinny.netlify.app
⚠️ Exercise caution. Use test accounts. ⚠️

Comment thread src/app/features/room/RoomView.tsx Outdated
@GimleLarpes GimleLarpes requested a review from ajbura June 28, 2025 11:49
@ajbura ajbura merged commit 77ab37f into cinnyapp:dev Jun 28, 2025
2 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 28, 2025
@GimleLarpes GimleLarpes deleted the fix-autofocus branch June 28, 2025 14:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve focus behaviour on single-purpose pages/popups and room message field Auto select text input

2 participants