Skip to content

feat(files): auto-accept setting for incoming files, on both devices - #12

Open
X-Ryl669 wants to merge 1 commit into
zoir-dev:mainfrom
X-Ryl669:feat/auto-accept-files
Open

feat(files): auto-accept setting for incoming files, on both devices#12
X-Ryl669 wants to merge 1 commit into
zoir-dev:mainfrom
X-Ryl669:feat/auto-accept-files

Conversation

@X-Ryl669

Copy link
Copy Markdown

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.

Authored by Claude.

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>
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