Skip to content

Conversation

@toupper
Copy link
Contributor

@toupper toupper commented Jun 19, 2025

Closes WOOMOB-620

Description

With this PR, we persist whether the POS tab was shown for a site in the last run, so we can show it as soon as possible. This makes it easier to jump to POS faster. Read more about this idea in the original issue or this PR woocommerce/woocommerce-ios#15753

Steps to reproduce

  1. Open a site that has POS enabled. The tab should be shown.
  2. Switch to a site that doesn't have POS enabled
  3. Switch to the first one. See that the tab is shown right away, without any delay.

The tests that have been performed

Site switching, default values, login.

Images/gif

Before

Even if it happens quite fast, note how the tab takes a while to be shown.

Screen_Recording_20250619_120716_Woo.Pre-Alpha.mp4

After

Screen_Recording_20250619_120428_Woo.Pre-Alpha.mp4
  • I have considered if this change warrants release notes and have added them to RELEASE-NOTES.txt if necessary. Use the "[Internal]" label for non-user-facing changes.

@toupper toupper added this to the 22.7 milestone Jun 19, 2025
@toupper toupper marked this pull request as draft June 19, 2025 11:46
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jun 19, 2025

📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
App Name WooCommerce-Wear Android
Platform⌚️ Wear OS
FlavorJalapeno
Build TypeDebug
Commit1275211
Direct Downloadwoocommerce-wear-prototype-build-pr14218-1275211.apk

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jun 19, 2025

📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.

App Name WooCommerce Android
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Commit1275211
Direct Downloadwoocommerce-prototype-build-pr14218-1275211.apk

@toupper toupper changed the title Issue/woomob 620 cache pos tab value [POS as a Tab] Persist value for site Jun 19, 2025
@toupper toupper changed the title [POS as a Tab] Persist value for site [POS as a Tab] Persist Value for Site Jun 19, 2025
@toupper toupper marked this pull request as ready for review June 19, 2025 14:00
@toupper toupper requested a review from malinajirka June 19, 2025 14:00
@malinajirka malinajirka self-assigned this Jun 19, 2025
Copy link
Contributor

@malinajirka malinajirka left a comment

Choose a reason for hiding this comment

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

Thanks @toupper, the code works as expected. I left one minor suggestions.

I noticed detekt is failing and you recently asked about a pre-commit/pre-push hooks. Here is a pre-push hook I created after our conversation. It essentially runs detekt and then out-loud reads Detekt Passed or Detekt Failed, which is quite convenient if you want to switch to a different context but want to make sure you don't forget. (if you are pushing through AS, make sure to mark enable-hooks checkbox).

#!/bin/bash

echo "Running detekt check..."
./gradlew detektAll
EXIT_CODE=$?
if [ $EXIT_CODE -ne 0 ]; then
  echo "***********************************************"
  echo "              Detekt failed                    "
  echo " Please fix the above issues before pushing    "
  echo "***********************************************"
  say "Detekt failed" 2>/dev/null || true
  exit 1  # This will block the push
else
  echo "Detekt passed successfully!"
  say "Detekt passed" 2>/dev/null || true
  exit 0  # Allow the push to proceed
fi

@malinajirka malinajirka enabled auto-merge June 20, 2025 10:14
@toupper
Copy link
Contributor Author

toupper commented Jun 20, 2025

Thanks for the pre-push hook @malinajirka! That looks great, to avoid forgetting it as in this case.

@toupper toupper mentioned this pull request Jun 20, 2025
1 task
@malinajirka malinajirka merged commit 88c7077 into trunk Jun 20, 2025
17 checks passed
@malinajirka malinajirka deleted the issue/WOOMOB-620-cache-POS-tab-value branch June 20, 2025 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants