Repository navigation
fix(files): accept a typed email address as a share recipient - #499
Conversation
- Offer a complete typed email address as an email share recipient that Enter or a tap confirms, so Create share no longer depends on the sharee search echoing the address back. - Validate email recipients before the Share API request and explain incomplete or malformed addresses instead of a generic missing-recipient message. - Keep the chosen recipient typed with its share target so a recipient chosen for one target can never become the shareWith value of another. - Creation stays blocked unless the server advertises sharing by email. Advances #420
Obiente previewNC Native · Obiente updates this comment as the preview changes. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7f984a3c15
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- Record whether a share recipient was typed or returned by the sharee search, and apply the local email address grammar only to typed input. Sharee results such as single-label domains or quoted local parts are sent as returned and left to the Share API to validate. - Always show the server result that matches the typed address as the leading choice, even when the server listed it after the visible result limit, so the address has exactly one choice. - Target matching and email capability gating are unchanged. Advances #420
Outcome
Advances #420.
A typed, valid email address can now be confirmed as an email share recipient by pressing Enter or tapping it, even when the server's sharee search does not return it. In the reported build the server's matching result appeared as a plain row with no selection affordance, and the recipient was only set if that row was clicked, so Create share stayed disabled with "A share recipient is required."
mainalready auto-selects the address when the server returns it as an exact email match (1e518cf). This PR covers the remaining cases: a failed or still-running search, a server result limit, or an exact match found by another route.FileShareEmailAddress.kt:validateFileShareEmailAddress()returns a typed Valid or Invalid(reason). Quoted names, IP or bracket domains, and domains without a dot are rejected; letters outside ASCII are accepted.FileShareDialogUiState.recipientis now a typedFileShareRecipient?that records its origin (ServerorTyped), and a recipient is only used when its target matches the selected share type, so a recipient picked for one share type can never be sent as another.Contract checked against Nextcloud server source: email shares are type 4 with
shareWithset to the address,MailPluginonly returns the typed address as an exact match when nothing else matched and the result limit was not reached, andShareAPIController::createSharedoes not require a prior sharee search.Verification
bash tools/check-repository.shpasseschanges/unreleased/fragment records the changeRun on Windows with JDK 21:
:ui:desktopTestfor the 7 share-related test classes: 71 tests pass.:ui:desktopTest: 3786 tests, 0 failures, 69 skipped.:androidApp:testDebugUnitTest: 1167 tests, 0 failures.bash tools/check-kotlin-architecture.sh,bash tools/test-text-hygiene.sh,node tools/changelog-fragments.mjs validate: pass.New and updated tests:
FileShareEmailAddressTest(valid addresses and 21 invalid cases),FileShareRecipientSelectionTest(+8: typed row while loading or after failure, hidden once the server returns the address, capability blocking, target mismatch, local rules applied only to typed addresses, and a match past the visible limit promoted to the first row),FileOperationsTest(exact type 4 request bodies, including unusual server-returned addresses, and messages), andFileShareRecipientPickerSceneTest(+3 desktop Compose tests for Enter and tap selection, a late search result not clearing the choice, and a ninth-place server match shown and selectable).Compatibility and risk
Visual changes
Adds a "Typed address" row and address-specific validation messages to the share recipient picker. Screenshots not yet captured.