Skip to content

android: move taildrop directory selector out of onboarding #669

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kari-ts
Copy link
Collaborator

@kari-ts kari-ts commented Jun 14, 2025

-ShareFileHelper manages directory readiness; when a file is being shared to the device, it emits a signal to prompt the user to pick a directory -Remove MDM auth key check; there is no longer any need to make assumptions about Taildrop usage, and we only show the directory selector when they are receiving a Taildropped file -Listen for Taildrop receipt in application view model (formerly VpnViewModel, now renamed due to its expanded scope), since Taildrop can occur even without MainActivity TODO: in OSS, SAF mode should be determined by OS, and not by the dir, since the dir may not be set immediately.

Updates tailscale/corp#29211

Copy link

review-ai-agent bot commented Jun 14, 2025

Pull Request Revisions

RevisionDescription
r3
Removed log and updated WindowInsets referenceCode changes include removing a debug log statement in App.kt and updating a WindowInsets reference to use explicit companion object in MainView.kt
r2
Go toolchain revision updatedUpdated Go toolchain revision from 98e8c99c to 1cd3bf1a commit hash
r1
Refactored VpnViewModel to AppViewModelReplaced VpnViewModel with more comprehensive AppViewModel, adding Taildrop directory management and merging VPN-related state tracking

✅ AI review completed for r3
Help React with emojis to give feedback on AI-generated reviews:
  • 👍 means the feedback was helpful and actionable
  • 👎 means the feedback was incorrect or unhelpful
💬 Replying to feedback with a comment helps us improve the system. Your input also contributes to shaping future interactions with the AI reviewer.

We'd love to hear from you—reach out anytime at team@review.ai.

@kari-ts kari-ts requested a review from barnstar June 14, 2025 00:01
Comment on lines 221 to +224
}
}

viewModel.setDirectoryPickerLauncher(directoryPickerLauncher)
appViewModel.setDirectoryPickerLauncher(directoryPickerLauncher)

Choose a reason for hiding this comment

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

In the MainActivity.kt (lines 221-224), you've moved the directory picker launcher assignment from viewModel to appViewModel, but I don't see corresponding changes in the AppViewModel class to handle this functionality. Make sure the method exists in the new class.

Choose a reason for hiding this comment

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

The generateNewFilename method in ShareFileHelper.kt currently uses UUID for generating unique filenames. Would using a more user-friendly approach like adding a simple incrementing number (e.g., 'file(1).txt') provide a better user experience for duplicate files?

-ShareFileHelper manages directory readiness; when a file is being shared to the device, it emits a signal to prompt the user to pick a directory
-Remove MDM auth key check; there is no longer any need to make assumptions about Taildrop usage, and we only show the directory selector when they are receiving a Taildropped file
-Listen for Taildrop receipt in application view model (formerly VpnViewModel, now renamed due to its expanded scope), since Taildrop can occur even without MainActivity
TODO: in OSS, SAF mode should be determined by OS, and not by the dir, since the dir may not be set immediately.

Updates tailscale/corp#29211

Signed-off-by: kari-ts <kari@tailscale.com>
@@ -372,7 +372,7 @@ func (a *App) watchFileOpsChanges() {
a.directFileRoot = newPath
a.backendRestartCh <- struct{}{}
case helper := <-onShareFileHelper:
log.Printf("Got shareFIleHelper")
log.Printf("Got shareFileHelper")

Choose a reason for hiding this comment

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

In backend.go, there's a simple typo fix from 'shareFIleHelper' to 'shareFileHelper' which is good. Consider adding a simple comment before this log statement to describe the purpose of this branch in the select statement for better code maintainability.

Choose a reason for hiding this comment

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

In MainView.kt, the WindowInsets access has been changed from WindowInsets.statusBars to WindowInsets.Companion.statusBars. This appears to be a regression as the Companion access is typically needed for older Kotlin versions, whereas direct property access is the modern approach. Unless there's a specific compatibility issue, consider reverting to the direct property access.

Copy link
Member

@barnstar barnstar left a comment

Choose a reason for hiding this comment

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

Needs a rebase and a quick check against the lastest main. I think I probably broke this with some of the temporary 1.84 patches.

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