Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FXVPN-32 add message (and fix bug involving lists and shared strings) #10045

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mcleinman
Copy link
Collaborator

@mcleinman mcleinman commented Nov 14, 2024

This PR cannot be merged into main before #10065 is merged into main, to ensure we don't add bad translation IDs.

Description

This adds the in-app message and notification for the web extension.

Notes:

  • Before this goes live, we'll need to do a few final touch ups (being tracked as FXVPN-280):
    • Confirm the pref will flip (otherwise we need to change a condition)
    • Confirm the version this will go live with (otherwise we need to change a condition)
    • Update the URL for AMO
    • Update the datestamp (if needed)
  • I included some fixes for addons shared strings work, originally done as VPN-5748: Use shared strings for addons #9763. There were some bugs when using unordered or ordered lists, which have been fixed in this PR.
  • I removed sample strings from the strings.yaml file, as we now have enough strings that we don't need those samples.
  • I also fixed up some documentation

Testing

This code will not be seen until 2.25.1. Thus, you need to change the conditions block. Given that QA will not be able to test this after merging to main, we need at least one other VPN engineer to test this code. To test:

To test:

  1. Change the conditions block to the following (substituting the platform for another one, depending on what you're using):
  "conditions": {
    "min_client_version": "2.23.1",
    "enabled_features": ["webExtension"],
    "trigger_time": 1000,
    "platforms": ["macos"]
  },
  1. After this is merged, we’ll get updated translation files from the translation repo. For now, manually add these lines to the end of ./3rdparty/i18n/en/addons/strings.xliff:
<trans-unit id="vpn.tryFirefoxExtension.title">
        <note annotates="source" from="developer">Standard text in a composer block</note>
        <source>Try the Firefox extension</source>
      </trans-unit>
      <trans-unit id="vpn.tryFirefoxExtension.subtitle">
        <note annotates="source" from="developer">Standard text in a composer block</note>
        <source>Personalize your VPN protections to meet your web browsing needs.</source>
      </trans-unit>
      <trans-unit id="vpn.tryFirefoxExtension.bullet1">
        <note annotates="source" from="developer">Standard text in a composer block</note>
        <source>Turn off VPN for specific websites</source>
      </trans-unit>
      <trans-unit id="vpn.tryFirefoxExtension.bullet2">
        <note annotates="source" from="developer">Standard text in a composer block</note>
        <source>Set different locations for different websites, to see the web as you prefer</source>
      </trans-unit>
      <trans-unit id="vpn.tryFirefoxExtension.bullet3">
        <note annotates="source" from="developer">Standard text in a composer block</note>
        <source>Keep protection for Firefox on, even when the Mozilla VPN app is off</source>
      </trans-unit>
      <trans-unit id="vpn.tryFirefoxExtension.finalLine">
        <note annotates="source" from="developer">Standard text in a composer block</note>
        <source>Not using Firefox to browse? Give it a try. </source>
      </trans-unit>      
      <trans-unit id="vpn.tryFirefoxExtension.getExtension">
        <note annotates="source" from="developer">Standard text in a composer block</note>
        <source>Get the extension</source>
      </trans-unit>
      <trans-unit id="vpn.tryFirefoxExtension.downloadFirefox">
        <note annotates="source" from="developer">Standard text in a composer block</note>
        <source>Download Firefox</source>
      </trans-unit>
  1. Follow the instructions in the How to implement and test add-ons section of ./docs/Components/Addons/index.md.
  2. Compile and run the app.
  3. In the debug menu, turn on the webExtension feature. Hard quit and relaunch the app.
  4. You should see the message and notification when you relaunch the app.

Reference

FXVPN-32

Checklist

  • My code follows the style guidelines for this project
  • I have not added any packages that contain high risk or unknown licenses (GPL, LGPL, MPL, etc. consult with DevOps if in question)
  • I have performed a self review of my own code
  • I have commented my code PARTICULARLY in hard to understand areas
  • I have added thorough tests where needed

"type": "message",
"conditions": {
"min_client_version": "2.25.1",
"enabled_features": ["webExtension"],
Copy link
Member

Choose a reason for hiding this comment

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

++localProxy

Copy link
Collaborator

Choose a reason for hiding this comment

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

Actually, we just removed the localProxy feature in PR #10058 since it's no longer something that the client can toggle (it's just a service that happens to exist on Windows and Linux). The "feature" still gets reported through the web extension, but it's value just checks if the corresponding serivce is running.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm, maybe that was a mistake and I should put it back as an un-toggle-able feature.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@lesleyjanenorton , were you suggesting adding localProxy in addition to webExtension?

(I'm looking for the name of a feature that will be the thing we "flip on" to make this go live for users - to be clear this is not a user-toggleable thing.)

"message": {
"date": 1733157651,
"usesSharedStrings": true,
"shortVersion": "N/A",
Copy link
Member

Choose a reason for hiding this comment

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

should this be "" ?

Copy link
Collaborator Author

@mcleinman mcleinman Nov 22, 2024

Choose a reason for hiding this comment

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

Updated this. It doesn't change anything for the user, as it's never shown - it's used for update/what's new messages (to drop a version number in the "Update to ___" slot).

Potentially this was a bad design choice of mine to always require it (messages using shared strings don't pass validation without it). I'm not inclined to update it right now, given how rarely we have messages like this - though let me know if you think it's needed now.

});

uo->registerUrlLabel("downloadFirefoxWindows", []() -> QString {
return "https://www.mozilla.org/firefox/windows/";
Copy link
Member

Choose a reason for hiding this comment

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

If we do https://www.mozilla.org/firefox/new/ it will take them directly to the desktop install page and bedrock will automagically determine the platform. We probably want to attach some UTM parameters to this link too.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, updated the URL (and name). I left a message for Santiago on the associated ticket to see if he wants UTM params on either of these links.

@mcleinman mcleinman marked this pull request as draft November 22, 2024 22:46
@mcleinman
Copy link
Collaborator Author

This is reviewable - I've put it on draft as a reminder to not merge it before #10065.

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.

4 participants