Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow multiple tasks for command_webview #4307

Merged

Conversation

jpelgrom
Copy link
Member

Summary

'Fix' #3343 by allowing command_webview to create multiple, new tasks. This allows launching the webview to work reliably irrespective of how the app was originally started.

While this behavior may not be perfect in my opinion (you end up with hidden tasks which can be unpredictable), all app features that allow you to navigate to a specific page the webview such as shortcuts, tapping on notifications, device controls long press, etc. use this to reliably load the frontend with a specific page. Different behavior for this specific feature (which as a result didn't always work) doesn't make a lot of sense.

Screenshots

n/a

Link to pull request in Documentation repository

Docs don't mention anything about tasks/recents so let's not complicate things

Any other notes

Based on these specific reproduction steps, without this change:

  • If the initial task was from the launcher, it seems to create a new activity (which will load the page)
  • If the initial task was from command_webview, it seems to bring the existing activity to the front and that's it

There must be something here with task stacks/affinity different for launch vs webview as the 'root' that allowed it to work without requiring the multiple tasks flag. I've also tried checking the intent extras in onNewIntent for the second point, but it didn't call the function.

Copy link
Member

@dshokouhi dshokouhi left a comment

Choose a reason for hiding this comment

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

Good to keep things consistent!

@dshokouhi dshokouhi merged commit 3154f9a into home-assistant:master Mar 29, 2024
4 checks passed
@osnwt
Copy link

osnwt commented Mar 29, 2024

Wow, thanks! I hope it will be in release soon.

@dshokouhi
Copy link
Member

Wow, thanks! I hope it will be in release soon.

it will be part of tomorrows beta push

@jpelgrom jpelgrom deleted the fix-repeated-command-webview branch March 29, 2024 15:48
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.

command_webview notification does not change current view on the companion app
3 participants