feat(files): auto-accept setting for incoming files, on both devices - #12
Open
X-Ryl669 wants to merge 1 commit into
Open
feat(files): auto-accept setting for incoming files, on both devices#12X-Ryl669 wants to merge 1 commit into
X-Ryl669 wants to merge 1 commit into
Conversation
Receiving a file batch always prompted — a desktop banner on the laptop, a notification on the phone — with no way to say "I trust this device, stop asking me". Add an independent switch on each device, each governing the direction that device receives in: the laptop's covers phone→laptop, the phone's covers laptop→phone. Deliberately NOT one setting synced across the link — trusting files onto a laptop and onto a phone are separate decisions, and coupling them would let one choice silently widen the other. Both default to OFF. This removes a consent gate, so it only ever turns on because the user asked for it; on the laptop an unreadable or unrecognised state file also reads as OFF, so a missing or corrupt file can never be the reason everything gets accepted. Laptop: `file_consent::request()` returns immediately when the setting is on, so no banner is posted and the sender isn't left waiting out the 45 s consent timeout. Persisted in `~/.local/share/vortex/file_auto_accept` (the convention `voice_settings` and `universal_control` already use) rather than living in memory like the clipboard-sync toggle: a consent setting that silently reverted on restart would leave the user believing files are still gated when they are not, or waiting for a prompt that no longer comes. The setter forces the lazy load first, so a later load cannot clobber the choice, and the UI switch reverts if the write fails rather than showing "on" over a setting that didn't stick. Phone: `FileAutoAcceptSetting` mirrors `ClipboardSyncSetting` (StateFlow over the same `vortex_ui_settings` prefs) and `FileConsent.request()` short-circuits on it, with an idempotent `init` at that call site as well as at service start — an offer arriving before the UI was ever opened is still answered from the user's real choice, not from a default. Strings added for all three locales (en/ru/uz) on both sides, keyed identically across `Strings.kt` and `src/lib/locales` as the two UIs expect. The ru/uz wording has not been checked by a native speaker. With auto-accept on, the transfer pill stays the only signal — deliberately: a confirmation toast would reintroduce the interruption the setting exists to remove. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Receiving a file batch always prompted — a desktop banner on the laptop, a notification on the phone — with no way to say "I trust this device, stop asking me".
Add an independent switch on each device, each governing the direction that device receives in: the laptop's covers phone→laptop, the phone's covers laptop→phone. Deliberately NOT one setting synced across the link — trusting files onto a laptop and onto a phone are separate decisions, and coupling them would let one choice silently widen the other.
Both default to OFF. This removes a consent gate, so it only ever turns on because the user asked for it; on the laptop an unreadable or unrecognised state file also reads as OFF, so a missing or corrupt file can never be the reason everything gets accepted.
Laptop:
file_consent::request()returns immediately when the setting is on, so no banner is posted and the sender isn't left waiting out the 45 s consent timeout. Persisted in~/.local/share/vortex/file_auto_accept(the conventionvoice_settingsanduniversal_controlalready use) rather than living in memory like the clipboard-sync toggle: a consent setting that silently reverted on restart would leave the user believing files are still gated when they are not, or waiting for a prompt that no longer comes. The setter forces the lazy load first, so a later load cannot clobber the choice, and the UI switch reverts if the write fails rather than showing "on" over a setting that didn't stick.Phone:
FileAutoAcceptSettingmirrorsClipboardSyncSetting(StateFlow over the samevortex_ui_settingsprefs) andFileConsent.request()short-circuits on it, with an idempotentinitat that call site as well as at service start — an offer arriving before the UI was ever opened is still answered from the user's real choice, not from a default.Strings added for all three locales (en/ru/uz) on both sides, keyed identically across
Strings.ktandsrc/lib/localesas the two UIs expect. The ru/uz wording has not been checked by a native speaker.With auto-accept on, the transfer pill stays the only signal — deliberately: a confirmation toast would reintroduce the interruption the setting exists to remove.
Authored by Claude.