Closed Bug 1811563 Opened 3 years ago Closed 1 year ago

Re-design permissions screen to support optional permissions

Categories

(Firefox for Android :: WebExtensions, enhancement, P3)

All
Android
enhancement

Tracking

()

RESOLVED FIXED
128 Branch
Tracking Status
firefox128 --- fixed

People

(Reporter: amejia, Assigned: zmckenney)

References

(Blocks 1 open bug)

Details

(Whiteboard: [addons-jira])

Attachments

(4 files)

Attached image permission_screen.png

In this screen:

We will have three type of permissions "Required" , "Optional" and "host permissions".

"Required" are not updated able.

"Optional" can be removed or granted a run-time

"Host" they can be allow all or site specific.

Desktop side was handled in bug 1745820 and bug 1777354.

Although the summary here frames this as a MV3-only task, it's also relevant to MV2.
The main difference between MV2 and MV3 in the context of permissions is that MV3 makes all host permissions optional, whereas in MV2 an extension can have required host permissions.

In MV2 (and MV3), the extension API to request optional permissions on demand is permissions.request(). The GeckoView side of it has been implemented in bug 1601420. But the A-C/Fenix side still needs to be implemented, in bug 1810047.

The bug here would be the user-facing interface to control the permissions.

See Also: → 1745820, 1777354, 1601420, 1810047

Thanks Rob for all the context!

Blocks: 1796175
No longer depends on: 1796175
See Also: → 1811900
Depends on: fenix-mv3
No longer blocks: 1796175
No longer depends on: fenix-mv3
Depends on: fenix-mv3
Blocks: fenix-mv3
No longer depends on: fenix-mv3
Summary: Re-design permission screen for MV3 → Re-design permission screen to support
Summary: Re-design permission screen to support → Re-design permissions screen to support
Depends on: 1812320, 1796176
Depends on: 1811900
Severity: -- → N/A
Priority: -- → P3
Summary: Re-design permissions screen to support → Re-design permissions screen to support optional permissions
Whiteboard: [addons-jira]
Blocks: 1863829
Depends on: 1879543
Depends on: 1879547
Assignee: nobody → rebecatudor273
Assignee: rebecatudor273 → zmckenney
Pushed by zmckenney@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ddf7cf138e84 Strings for Addon Permissions screen redesign r=android-reviewers,amejiamarmol
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 126 Branch

The bug didn't have the leave-open keyword but not all the patches have landed yet.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: 126 Branch → ---
Attachment #9392633 - Attachment description: WIP: Bug 1811563 - Redesign permissions screen for addons → Bug 1811563 - Redesign permissions screen for addons
See Also: → 1896180
Pushed by zmckenney@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7ac962179505 Redesign permissions screen for addons r=android-reviewers,amejiamarmol,gl

Backed out for causing linting failures on AddonPermissionsScreen.kt

[task 2024-05-15T04:55:39.983Z] > Task :detekt
[task 2024-05-15T04:55:39.983Z] /builds/worker/checkouts/gecko/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/addons/ui/AddonPermissionsScreen.kt:261:5: The function AddonPermissionsScreenPreview is missing documentation. [UndocumentedPublicFunction]
[task 2024-05-15T04:55:39.983Z] /builds/worker/checkouts/gecko/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/addons/AddonPermissionsDetailsFragment.kt:27:12: AddonPermissionsUpdateRequest is missing required documentation. [UndocumentedPublicClass]
[task 2024-05-15T04:55:39.984Z] /builds/worker/checkouts/gecko/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/addons/ui/AddonPermissionsScreen.kt:42:27: The function AddonPermissionsScreen(permissions: List<String>, optionalPermissions: List<Addon.LocalizedPermission>, originPermissions: List<Addon.LocalizedPermission>, isAllSitesSwitchVisible: Boolean, isAllSitesEnabled: Boolean, onAddOptionalPermissions: (AddonPermissionsUpdateRequest) -> Unit, onRemoveOptionalPermissions: (AddonPermissionsUpdateRequest) -> Unit, onAddAllSitesPermissions: () -> Unit, onRemoveAllSitesPermissions: () -> Unit, onLearnMoreClick: (String) -> Unit) has too many parameters. The current threshold is set to 8. [LongParameterList]
[task 2024-05-15T04:55:39.984Z] /builds/worker/checkouts/gecko/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/addons/ui/AddonPermissionsScreen.kt:42:5: The function AddonPermissionsScreen is too long (88). The maximum length is 75. [LongMethod]
[task 2024-05-15T04:55:39.984Z] /builds/worker/checkouts/gecko/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/addons/ui/AddonPermissionsScreen.kt:237:27: Missing braces on this branch, add them. [BracesOnIfStatements]
[task 2024-05-15T04:55:39.984Z] /builds/worker/checkouts/gecko/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/addons/ui/AddonPermissionsScreen.kt:240:27: Missing braces on this branch, add them. [BracesOnIfStatements]
[task 2024-05-15T04:55:39.984Z] /builds/worker/checkouts/gecko/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/addons/ui/AddonPermissionsScreen.kt:248:27: Missing braces on this branch, add them. [BracesOnIfStatements]
[task 2024-05-15T04:55:39.984Z] /builds/worker/checkouts/gecko/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/addons/ui/AddonPermissionsScreen.kt:251:27: Missing braces on this branch, add them. [BracesOnIfStatements]
[task 2024-05-15T04:55:39.984Z] 
[task 2024-05-15T04:55:39.984Z] /builds/worker/checkouts/gecko/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/addons/ui/AddonPermissionsScreen.kt - 1h 20min debt
[task 2024-05-15T04:55:39.984Z] 	UndocumentedPublicFunction - [The function AddonPermissionsScreenPreview is missing documentation.] at /builds/worker/checkouts/gecko/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/addons/ui/AddonPermissionsScreen.kt:261:5
[task 2024-05-15T04:55:39.984Z] 	LongParameterList - 10/8 - [The function AddonPermissionsScreen(permissions: List<String>, optionalPermissio(...)] at /builds/worker/checkouts/gecko/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/addons/ui/AddonPermissionsScreen.kt:42:27
[task 2024-05-15T04:55:39.984Z] 	LongMethod - 88/75 - [The function AddonPermissionsScreen is too long (88). The maximum length is 75.] at /builds/worker/checkouts/gecko/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/addons/ui/AddonPermissionsScreen.kt:42:5
[task 2024-05-15T04:55:39.984Z] 	BracesOnIfStatements - [Missing braces on this branch, add them.] at /builds/worker/checkouts/gecko/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/addons/ui/AddonPermissionsScreen.kt:237:27
[task 2024-05-15T04:55:39.984Z] 	BracesOnIfStatements - [Missing braces on this branch, add them.] at /builds/worker/checkouts/gecko/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/addons/ui/AddonPermissionsScreen.kt:240:27
[task 2024-05-15T04:55:39.984Z] 	BracesOnIfStatements - [Missing braces on this branch, add them.] at /builds/worker/checkouts/gecko/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/addons/ui/AddonPermissionsScreen.kt:248:27
[task 2024-05-15T04:55:39.984Z] 	BracesOnIfStatements - [Missing braces on this branch, add them.] at /builds/worker/checkouts/gecko/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/addons/ui/AddonPermissionsScreen.kt:251:27
[task 2024-05-15T04:55:39.984Z] /builds/worker/checkouts/gecko/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/addons/AddonPermissionsDetailsFragment.kt - 20min debt
[task 2024-05-15T04:55:39.984Z] 	UndocumentedPublicClass - [AddonPermissionsUpdateRequest is missing required documentation.] at /builds/worker/checkouts/gecko/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/addons/AddonPermissionsDetailsFragment.kt:27:12
[task 2024-05-15T04:55:39.984Z] 
[task 2024-05-15T04:55:39.984Z] Overall debt: 1h 40min
[task 2024-05-15T04:55:39.984Z] 
[task 2024-05-15T04:55:39.984Z] comments - 40min debt
[task 2024-05-15T04:55:39.984Z] 	UndocumentedPublicFunction - [The function AddonPermissionsScreenPreview is missing documentation.] at /builds/worker/checkouts/gecko/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/addons/ui/AddonPermissionsScreen.kt:261:5
[task 2024-05-15T04:55:39.984Z] 	UndocumentedPublicClass - [AddonPermissionsUpdateRequest is missing required documentation.] at /builds/worker/checkouts/gecko/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/addons/AddonPermissionsDetailsFragment.kt:27:12
[task 2024-05-15T04:55:39.984Z] complexity - 40min debt
[task 2024-05-15T04:55:39.984Z] 	LongParameterList - 10/8 - [The function AddonPermissionsScreen(permissions: List<String>, optionalPermissio(...)] at /builds/worker/checkouts/gecko/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/addons/ui/AddonPermissionsScreen.kt:42:27
[task 2024-05-15T04:55:39.984Z] 	LongMethod - 88/75 - [The function AddonPermissionsScreen is too long (88). The maximum length is 75.] at /builds/worker/checkouts/gecko/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/addons/ui/AddonPermissionsScreen.kt:42:5
[task 2024-05-15T04:55:39.984Z] style - 20min debt
[task 2024-05-15T04:55:39.984Z] 	BracesOnIfStatements - [Missing braces on this branch, add them.] at /builds/worker/checkouts/gecko/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/addons/ui/AddonPermissionsScreen.kt:237:27
[task 2024-05-15T04:55:39.984Z] 	BracesOnIfStatements - [Missing braces on this branch, add them.] at /builds/worker/checkouts/gecko/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/addons/ui/AddonPermissionsScreen.kt:240:27
[task 2024-05-15T04:55:39.984Z] 	BracesOnIfStatements - [Missing braces on this branch, add them.] at /builds/worker/checkouts/gecko/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/addons/ui/AddonPermissionsScreen.kt:248:27
[task 2024-05-15T04:55:39.984Z] 	BracesOnIfStatements - [Missing braces on this branch, add them.] at /builds/worker/checkouts/gecko/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/addons/ui/AddonPermissionsScreen.kt:251:27
[task 2024-05-15T04:55:39.984Z] 
[task 2024-05-15T04:55:39.984Z] Overall debt: 1h 40min
[task 2024-05-15T04:55:40.083Z] 
[task 2024-05-15T04:55:40.083Z] Complexity Report:
[task 2024-05-15T04:55:40.083Z] 	- 119,731 lines of code (loc)
[task 2024-05-15T04:55:40.083Z] 	- 88,592 source lines of code (sloc)
[task 2024-05-15T04:55:40.083Z] 	- 59,957 logical lines of code (lloc)
[task 2024-05-15T04:55:40.083Z] 	- 17,605 comment lines of code (cloc)
[task 2024-05-15T04:55:40.083Z] 	- 10,454 cyclomatic complexity (mcc)
[task 2024-05-15T04:55:40.083Z] 	- 5,481 cognitive complexity
[task 2024-05-15T04:55:40.083Z] 	- 8 number of total code smells
[task 2024-05-15T04:55:40.083Z] 	- 19% comment source ratio
[task 2024-05-15T04:55:40.083Z] 	- 174 mcc per 1,000 lloc
[task 2024-05-15T04:55:40.084Z] 	- 0 code smells per 1,000 lloc
Flags: needinfo?(zmckenney)
Pushed by zmckenney@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1a0e0c388eb6 Redesign permissions screen for addons r=android-reviewers,amejiamarmol,gl

Running the linter in the root directory doesn't work but after running in the Fenix directory I was able to replicate the lint errors. I've now fixed all of them and am pushing the changes. Sorry for the double backout.

Flags: needinfo?(zmckenney)
Pushed by zmckenney@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7a02a6d36e80 Redesign permissions screen for addons r=android-reviewers,amejiamarmol,gl
Status: REOPENED → RESOLVED
Closed: 1 year ago1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 128 Branch

Zac, would you like to nominate this for a release note?
More info at: https://wiki.mozilla.org/Release_Management/Release_Notes_Nomination

Flags: needinfo?(zmckenney)
Depends on: 1888239
Flags: needinfo?(zmckenney)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: