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

Merged
merged 8 commits into from
Dec 2, 2024

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. #10065 was merged.

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

@mcleinman mcleinman force-pushed the fxvpn-32-in-app-message branch from bca3988 to 3bf28f4 Compare November 15, 2024 00:05
"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.)

Copy link
Member

Choose a reason for hiding this comment

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

we just removed the localProxy feature in PR #10058 since it's no longer something that the client can toggle

@oskirby Does this mean that the proxy will be available by default on Windows in v2.25? If yes, we should put it back behind the 'localProxy' feature flag.

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.

@mcleinman Let's sort this out in the office hours meetings. Previously this was 'localProxy' and 'webExtension'.

Copy link
Collaborator

Choose a reason for hiding this comment

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

To summarize a zoom discussion: I'm not in favor of adding a localProxy feature flag back. The proxy, being a windows/systemd service required administrative privileges to start and stop and the client UI does not hold such privileges... to make this controllable by a feature flag it would have to be managed through the daemon and that is a lot of work for not a lot of gain.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated per our meeting

addons/message_try_firefox_extension/manifest.json Outdated Show resolved Hide resolved
src/mozillavpn.cpp Outdated Show resolved Hide resolved
@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.

@mcleinman mcleinman marked this pull request as ready for review December 2, 2024 16:36
@mcleinman
Copy link
Collaborator Author

Taking off draft as #10065 is merged

@mcleinman
Copy link
Collaborator Author

mcleinman commented Dec 2, 2024

I removed the feature trigger (as it no longer is accurate) and I updated the version to something far in the future (so this message won't accidentally get shown) - I've updated the follow-up ticket as appropriate.

"name": "Try the Firefox extension",
"type": "message",
"conditions": {
"min_client_version": "3.25.1",
Copy link
Member

Choose a reason for hiding this comment

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

So that QA can start testing this we could do "env": "staging", instead.

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, I thought I was forgetting one. I've updated this, and will update that follow up ticket in a moment.

Copy link
Collaborator

@oskirby oskirby left a comment

Choose a reason for hiding this comment

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

Probably good enough to merge. Just a few nits.

@@ -0,0 +1,3 @@
((api) => {
api.urlOpener.openUrlLabel('downloadFirefox');
Copy link
Collaborator

Choose a reason for hiding this comment

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

As a minor nitpick requiring the URL to be defined by label in the client binary is probably unnecessary, we could just put it into this file as api.urlOpener.openUrl('https://foo.bar/baz/...')

Copy link
Collaborator

@oskirby oskirby Dec 2, 2024

Choose a reason for hiding this comment

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

I don't like that to change the URL we would have to change the client, which kind of makes the addon system unnecessarily brittle.

Copy link
Collaborator Author

@mcleinman mcleinman Dec 2, 2024

Choose a reason for hiding this comment

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

I was following convention here, though I don't love it either.

That said, nearly all addon changes take client work (for non-English languages), as we need to release new client versions to get updated translations - a brand new addon without a client update wouldn't be translated.

Since it's a nit, I'm going to leave this for now. If we want to change the convention, let's do it for all addons at once.

@@ -0,0 +1,3 @@
((api) => {
api.urlOpener.openUrlLabel('downloadExtension');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same comment as for downloadFirefox.js this could done directly as api.urlOpener.openUrl('https://foo.bar/baz/...')

@mcleinman mcleinman merged commit b5e5dc1 into main Dec 2, 2024
103 checks passed
@mcleinman mcleinman deleted the fxvpn-32-in-app-message branch December 2, 2024 20:31
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