Skip to content

Conversation

@camillobruni
Copy link
Contributor

When selecting a search page (flags, plugins or settings) autofocus directly on the search input to required fewer mouse inputs.

@camillobruni camillobruni requested a review from a team as a code owner January 21, 2026 09:26
@camillobruni camillobruni changed the title ui: Autofocus settings pages search input ui: Autofocus search input on settings pages Jan 21, 2026
@github-actions
Copy link

github-actions bot commented Jan 21, 2026

🎨 Perfetto UI Build

✅ UI build is ready: https://storage.googleapis.com/perfetto-ci-artifacts/gh-21373958017-1-ui/ui/index.html

@stevegolton
Copy link
Member

stevegolton commented Jan 21, 2026

Unfortunately as pages are retained in memory even after switching away (in order to avoid losing things like scroll position), this only works the first time the pages are navigated to, which feels a little janky.

I'm not aware of an elegant solution to this problem, but open to suggestions.

@sashwinbalaji sashwinbalaji requested review from stevegolton and removed request for sashwinbalaji January 26, 2026 12:59
* Whenever the Page transitions from closed to open, the focus() methods is
* called.
*/
export abstract class FocusPage<T extends FocusPageAttrs>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Likely not the right place to add this – but this was the easiest for now.

@camillobruni
Copy link
Contributor Author

Took another stab at this by adding a FocusPage that internally tracks the open state and update PageManagerImpl to pass along the open state to the render method too.

Copy link
Member

@stevegolton stevegolton left a comment

Choose a reason for hiding this comment

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

I'm not particularly keen on this approach because:

  • Manual drilling of the 'open' state through potentially many layers of components.
  • FocusPage needs oncreate and onupdate but it's all to easy to override by mistake in subclases.
  • Only works with pages (not subpages, or tabs, which also mostly use Gate to control visibility).

I've been playing around with my take on this problem here: #4603 - I'd be interested to hear your thoughts.

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.

2 participants