Skip to content

feat: Auto-fill URL field when adding a link from selected text in the editor#2870

Merged
FabianDevel merged 6 commits into
mainfrom
autofill-url-from-selection
May 11, 2026
Merged

feat: Auto-fill URL field when adding a link from selected text in the editor#2870
FabianDevel merged 6 commits into
mainfrom
autofill-url-from-selection

Conversation

@aymericmariaux
Copy link
Copy Markdown
Contributor

@aymericmariaux aymericmariaux commented Apr 16, 2026

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 16, 2026

PR Reviewer Guide 🔍

(Review updated until commit 382cfec)

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ No major issues detected

Comment thread app/src/main/java/com/infomaniak/mail/ui/newMessage/NewMessageEditorManager.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/ui/newMessage/NewMessageEditorManager.kt Outdated
@github-actions
Copy link
Copy Markdown

Persistent review updated to latest commit 382cfec

Comment thread app/src/main/java/com/infomaniak/mail/ui/newMessage/NewMessageEditorManager.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/ui/newMessage/NewMessageEditorManager.kt Outdated
@github-actions
Copy link
Copy Markdown

Failed to generate code suggestions for PR

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support for pre-filling the “URL” field in the insert-link dialog when the user triggers “Add link” with a URL selected in the editor.

Changes:

  • Add URL extraction helper based on Patterns.WEB_URL to detect when selected text is a URL.
  • Fetch editor selected text before opening the insert-link dialog and pass it as default URL/display name values.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/src/main/java/com/infomaniak/mail/ui/newMessage/NewMessageEditorManager.kt Outdated
@aymericmariaux aymericmariaux force-pushed the autofill-url-from-selection branch 2 times, most recently from 54356c1 to 266af8c Compare April 23, 2026 07:28
@github-actions
Copy link
Copy Markdown

Failed to generate code suggestions for PR

@aymericmariaux aymericmariaux force-pushed the autofill-url-from-selection branch from c97d39f to c3b7179 Compare April 23, 2026 08:07
@github-actions
Copy link
Copy Markdown

Failed to generate code suggestions for PR

@aymericmariaux aymericmariaux force-pushed the autofill-url-from-selection branch from c3b7179 to 87c34c8 Compare April 28, 2026 12:01
@solrubado solrubado force-pushed the rich-editor branch 4 times, most recently from e799647 to 088aaab Compare May 8, 2026 11:26
Base automatically changed from rich-editor to main May 8, 2026 11:43
@aymericmariaux aymericmariaux force-pushed the autofill-url-from-selection branch from 87c34c8 to e0673bd Compare May 8, 2026 12:17
Change the selection logic to retrieve a link only if it is the sole content of the text, rather than extracting any link found within the text.
@aymericmariaux aymericmariaux force-pushed the autofill-url-from-selection branch from e0673bd to a708153 Compare May 8, 2026 14:18
Comment thread app/src/main/java/com/infomaniak/mail/ui/newMessage/NewMessageEditorManager.kt Outdated
@sonarqubecloud
Copy link
Copy Markdown

@FabianDevel FabianDevel merged commit f6663ea into main May 11, 2026
7 checks passed
@FabianDevel FabianDevel deleted the autofill-url-from-selection branch May 11, 2026 13:18
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.

3 participants