Skip to content

Stop the Commands tab from opening the first command - #133

Open
mvanhorn wants to merge 1 commit into
SimonSchubert:masterfrom
mvanhorn:fix/131-commands-tab-default-detail
Open

mvanhorn wants to merge 1 commit into
SimonSchubert:masterfrom
mvanhorn:fix/131-commands-tab-default-detail

Conversation

@mvanhorn

Copy link
Copy Markdown

Summary

When the window is wide enough for the navigation rail (a tablet, a landscape phone, or a phone with a small display size like in the report), the Commands tab opened straight into the first command, 2048, as soon as the list loaded.

CommandsPaneScreen had a launch effect that picked the first item on expanded layouts. This removes it, so the detail pane shows the existing "Select a command" placeholder until you tap something. The isExpanded parameter only fed that effect, so it is gone too, along with the LinuxNavGraph argument.

Deeplinks like /man/2048 and tapping a list item still open the detail page. They go through pendingSelection and normal navigation, which are unchanged.

Demo

Emulator at 240 dpi (rail layout), opening the Commands tab on a fresh install.

Before After

Testing

  • Added testCommandListDoesNotSelectFirstCommandOnExpandedLayout to ComposeDeeplinkTests. It sets the content with a LocalWindowInfo that reports a 1280x800 dp window so the two-pane layout is used, waits until the command list has loaded, then checks that "Select a command" is shown and no command detail is open. It passes with this change and fails on master.
  • I built the debug app and the instrumented test APK locally, and ktlint reports the changed files clean.
  • The other tests in ComposeDeeplinkTests fail on master too, because nothing sets the TopAppBarTitle content description anymore. I left them alone. On an API 37 emulator I also had to bump espresso-core to 3.7.0 locally to run instrumented tests at all. That change is not part of this PR.

Fixes #131

Removed the expanded-layout auto-selection and its `isExpanded`
plumbing. Added a Compose test that verifies an expanded Commands layout
shows the selection prompt and does not display command-detail search
controls.

Fixes SimonSchubert#131
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.

When switching to the search tab, the page for 2048 is on

1 participant