Skip to content

Conversation

hahn-kev
Copy link
Collaborator

@hahn-kev hahn-kev commented Sep 8, 2025

closes #1975

Description

  • Fix issue with the handling of mailto links to ensure proper functionality.

Copy link

coderabbitai bot commented Sep 8, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

Implements platform-specific handling for mailto: links. On Android, adds a BlazorWebView UrlLoading handler that intercepts mailto: and launches an external email intent while canceling in-webview navigation. Wires the handler in MainPage and exposes StartPath setter. In the frontend, marks the FeedbackDialog mailto button as external.

Changes

Cohort / File(s) Summary
Android WebView mailto handling
backend/FwLite/FwLiteMaui/MainPage.xaml.Android.cs
Adds UrlLoading handler that detects mailto: URLs, launches Android email intent via ActionSendto, starts external activity, and cancels WebView navigation.
MainPage wiring and API tweak
backend/FwLite/FwLiteMaui/MainPage.xaml.cs
Binds BlazorWebView.UrlLoading to platform-specific handler; adds partial method for ANDROID and no-op for others; adds setter to internal StartPath property.
Feedback dialog external link
frontend/viewer/src/lib/about/FeedbackDialog.svelte
Sets the mailto Button to external with a clarifying comment to ensure external handling of mailto links.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Assessment against linked issues

Objective Addressed Explanation
Open “Send us a message” mailto link in default mail app across devices (#{1975})
Prevent in-app/webview navigation to mailto: and route externally (#{1975})
Fix desktop routing that prepends /project/{projectCode}/ to mailto links (#{1975})

Assessment against linked issues: Out-of-scope changes

(no out-of-scope functional changes identified)

Possibly related PRs

  • create feedback dialog #1918 — Introduces the FeedbackDialog with a mailto action; this PR complements it by ensuring mailto opens externally and is handled on Android.

Suggested labels

💻 FW Lite

Poem

A whisper of links in the Blazor breeze,
I hop to your mail with Android ease.
No more paths that twist or fail—
I launch Gmail on the bunny trail. ✉️🐇
Click, whoosh, and off we go,
Feedback flies like carrot snow!

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-contact-us-link

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added the 💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related label Sep 8, 2025
Copy link

github-actions bot commented Sep 8, 2025

UI unit Tests

  1 files  ±0   41 suites  ±0   17s ⏱️ ±0s
 90 tests ±0   90 ✅ ±0  0 💤 ±0  0 ❌ ±0 
124 runs  ±0  124 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 3eac660. ± Comparison against base commit d8051b6.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Sep 8, 2025

C# Unit Tests

130 tests  ±0   130 ✅ ±0   18s ⏱️ -1s
 20 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 3eac660. ± Comparison against base commit d8051b6.

♻️ This comment has been updated with latest results.

Copy link

argos-ci bot commented Sep 8, 2025

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Sep 9, 2025, 5:09 AM

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (3)
frontend/viewer/src/lib/about/FeedbackDialog.svelte (1)

38-39: Small UX/accessibility touch-up (optional)

Consider clarifying that this opens the email app (e.g., aria-label or visually hidden note) to set user expectation.

backend/FwLite/FwLiteMaui/MainPage.xaml.Android.cs (1)

39-48: Consider covering other external schemes (optional)

If users tap tel:, sms:, or geo: links, you likely want similar behavior (launch external app and cancel WebView navigation). Easy extension alongside mailto.

backend/FwLite/FwLiteMaui/MainPage.xaml.cs (1)

15-15: Event subscription is fine; avoid duplicates if this ctor can run more than once

If there’s any chance this page gets re-initialized, pre-unsubscribe to prevent multiple handlers.

-        blazorWebView.UrlLoading += BlazorWebViewOnUrlLoading;
+        blazorWebView.UrlLoading -= BlazorWebViewOnUrlLoading; // idempotency
+        blazorWebView.UrlLoading += BlazorWebViewOnUrlLoading;
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d8051b6 and 11ed34c.

📒 Files selected for processing (3)
  • backend/FwLite/FwLiteMaui/MainPage.xaml.Android.cs (2 hunks)
  • backend/FwLite/FwLiteMaui/MainPage.xaml.cs (2 hunks)
  • frontend/viewer/src/lib/about/FeedbackDialog.svelte (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-07T08:35:47.803Z
Learnt from: hahn-kev
PR: sillsdev/languageforge-lexbox#1885
File: backend/FwLite/FwLiteMaui/MainPage.xaml.Windows.cs:30-41
Timestamp: 2025-08-07T08:35:47.803Z
Learning: In backend/FwLite/FwLiteMaui/MainPage.xaml.Windows.cs, the SetPermissionStateAsync calls in BlazorWebViewInitialized method are intentionally used in a fire-and-forget pattern with pragma warning suppression for VSTHRD110, as awaiting them is not necessary and async void should be avoided.

Applied to files:

  • backend/FwLite/FwLiteMaui/MainPage.xaml.Android.cs
  • backend/FwLite/FwLiteMaui/MainPage.xaml.cs
🧬 Code graph analysis (2)
backend/FwLite/FwLiteMaui/MainPage.xaml.Android.cs (1)
backend/FwLite/FwLiteMaui/MainPage.xaml.cs (2)
  • BlazorWebViewOnUrlLoading (40-40)
  • BlazorWebViewOnUrlLoading (43-45)
backend/FwLite/FwLiteMaui/MainPage.xaml.cs (1)
backend/FwLite/FwLiteMaui/MainPage.xaml.Android.cs (1)
  • BlazorWebViewOnUrlLoading (39-48)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: Build API / publish-api
  • GitHub Check: Build UI / publish-ui
  • GitHub Check: frontend-component-unit-tests
  • GitHub Check: check-and-lint
  • GitHub Check: frontend
  • GitHub Check: Build FW Lite and run tests
  • GitHub Check: Analyze (csharp)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (3)
frontend/viewer/src/lib/about/FeedbackDialog.svelte (1)

38-39: External link flag for mailto looks correct

Using the Button’s external prop avoids target="_blank" so UrlLoading can intercept on Android. LGTM.

backend/FwLite/FwLiteMaui/MainPage.xaml.Android.cs (1)

3-3: Android intent namespace import is appropriate

Importing Android.Content is needed for Intent usage. LGTM.

backend/FwLite/FwLiteMaui/MainPage.xaml.cs (1)

20-24: StartPath setter addition looks good

This keeps the API symmetrical and enables programmatic navigation.

Copy link
Collaborator

@myieye myieye left a comment

Choose a reason for hiding this comment

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

Worked for me on Maui and Android 👍

@myieye myieye merged commit 13cf941 into develop Sep 15, 2025
26 of 27 checks passed
@myieye myieye deleted the fix-contact-us-link branch September 15, 2025 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feedback dialog: Send us a message doesn't work
2 participants