Skip to content

Settings search: long press on a result shows the setting in its screen - #799

Open
4di-hello wants to merge 1 commit into
LeanBitLab:mainfrom
4di-hello:feature/settings-jump-v2-pr
Open

4di-hello wants to merge 1 commit into
LeanBitLab:mainfrom
4di-hello:feature/settings-jump-v2-pr

Conversation

@4di-hello

Copy link
Copy Markdown
Contributor

A new version of #739, reworked after your review:

  • No saved state is changed. A closed fine-tune section is opened only for the screen that shows the setting, in that screen's back stack entry. The saved open/closed state is never written. If the user opens or closes the section himself, that is what counts from then on.
  • Standard long press. The long press is a normal combinedClickable on the preference, with an accessibility label, so it also works with TalkBack. No pointer handling of its own.
  • No global state. The setting to show and the sections opened for it are kept in the SavedStateHandle of the target screen's back stack entry; the nav controller is passed down as a CompositionLocal. No timeout.
  • The setting itself is brought into view, also further down in a large card, and highlighted for a moment.

Tests: SettingsJumpTest (the steps: open sections, keep only the one with the setting, give up). Also tested on an emulator: long press on a search result, the setting is shown and highlighted, and the saved section state is unchanged afterwards.

Reworked after the review of LeanBitLab#739:
- No saved state is changed: a closed fine-tune section is opened only for
  the screen that shows the setting (in its back stack entry); a section the
  user opens or closes himself is as he wants from then on.
- The long press is a normal combinedClickable on the preference, with an
  accessibility label, no pointer handling of its own.
- No global object: the setting to show and the sections opened for it are
  kept in the SavedStateHandle of the target screen's back stack entry, the
  nav controller is passed down as a CompositionLocal. No timeout.
- The setting itself is brought into view, also further down in a large card,
  and highlighted for a moment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VuiaMhLXwhErf9shhrr1uD
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.

1 participant